I compiled bewan-adsl-0.9.3-r2 against kernel-2.6.20.6. After modprobe unicorn_usb_atm, I get segmentation fault. The same driver on the same computer works well with kernel 2.6.17. Here is the output of dmesg: unicorn_usb: OHCI Host Controller alloc_obj: kmalloc failed,size=-736780696,type=abc0 BUG: unable to handle kernel NULL pointer dereference at virtual address 00000001 printing eip: dcd49eee *pde = 00000000 Oops: 0000 [#1] PREEMPT Modules linked in: unicorn_usb_atm atm psmouse iptable_filter ip_tables x_tables powernow_k8 freq_table processor snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss sg evdev snd_hda_intel forcedeth snd_hda_codec shpchp agpgart ehci_hcd serio_raw pcspkr snd_pcm snd_timer snd soundcore snd_page_alloc ohci_hcd i2c_core ohci1394 ieee1394 CPU: 0 EIP: 0060:[<dcd49eee>] Not tainted VLI EFLAGS: 00010082 (2.6.20.6 #3) EIP is at xsm_ident+0x6e/0x100 [unicorn_usb_atm] eax: 00000004 ebx: 00000282 ecx: 00000004 edx: 00000001 esi: d3c4b3d0 edi: 00000001 ebp: d4158000 esp: d4159de0 ds: 007b es: 007b ss: 0068 Process modprobe (pid: 2634, ti=d4158000 task=dbe2c030 task.ti=d4158000) Stack: c0119cf7 dcd5e794 d4159df4 d3c4b3c0 00000001 00000001 00000000 00000000 ffffffed d4159e24 dcd283a6 dcd5b3fe 00000000 00000000 00000000 00000000 00000000 d4159e64 dccfe7f8 00000000 d4159e58 00000000 db667b80 db667c20 Call Trace: [<c0119cf7>] printk+0x17/0x20 [<dcd283a6>] _ZN19InterfaceProtectionC1Ev+0x16/0x50 [unicorn_usb_atm] [<dccfe7f8>] AMSW_Modem_SW_Init+0x28/0x180 [unicorn_usb_atm] [<dcd4cf7d>] unicorn_atm_startdevice+0x1d/0x80 [unicorn_usb_atm] [<dcd4b544>] msw_init+0x14/0x1a0 [unicorn_usb_atm] [<dcd4f5d5>] unicorn_attach+0xc5/0x200 [unicorn_usb_atm] [<dcd487aa>] do_probe+0x16a/0x190 [unicorn_usb_atm] [<dcd487e1>] probe_unicorn_usb+0x11/0x20 [unicorn_usb_atm] [<c028f1a8>] usb_probe_interface+0x68/0xb0 [<c0224be4>] really_probe+0x94/0x110 [<c028f4c9>] usb_match_id+0x19/0x50 [<c0224d27>] driver_probe_device+0xb7/0xc0 [<c034528b>] klist_next+0x4b/0xa0 [<c0224e29>] __driver_attach+0x79/0x80 [<c0223fca>] bus_for_each_dev+0x3a/0x60 [<c0224e44>] driver_attach+0x14/0x20 [<c0224db0>] __driver_attach+0x0/0x80 [<c0224542>] bus_add_driver+0x52/0x100 [<c028f998>] usb_register_driver+0x58/0xc0 [<c0119cf7>] printk+0x17/0x20 [<dcbb2055>] unicorn_usb_init+0x55/0x59 [unicorn_usb_atm] [<c0137bb2>] sys_init_module+0xe2/0x150 [<c01030c0>] syscall_call+0x7/0xb ======================= Code: 0c 8b 00 3d 00 49 d9 dc 89 44 24 0c 74 3f 8b 4c 24 0c 81 79 08 c2 ab 00 00 75 e2 89 ce b8 04 00 00 00 83 c6 10 8b 7c 24 14 89 c1 <f3> a6 75 ce 8b 4c 24 0c 89 4d 00 c7 44 24 10 00 00 00 00 eb 0d EIP: [<dcd49eee>] xsm_ident+0x6e/0x100 [unicorn_usb_atm] SS:ESP 0068:d4159de0 <6>note: modprobe[2634] exited with preempt_count 1 BUG: scheduling while atomic: modprobe/0x10000001/2634 [<c0345aa7>] schedule+0x547/0x670 [<c0149440>] unmap_page_range+0xc0/0x150 [<c01166e6>] __cond_resched+0x16/0x40 [<c03463aa>] cond_resched+0x2a/0x40 [<c0149667>] unmap_vmas+0x197/0x1b0 [<c014e156>] exit_mmap+0x66/0x100 [<c0116ea1>] mmput+0x31/0xb0 [<c011bd7a>] do_exit+0xea/0x430 [<c0103cad>] die+0x21d/0x220 [<c0113e15>] do_page_fault+0x335/0x5c0 [<c0345c12>] preempt_schedule+0x42/0x60 [<c0113ae0>] do_page_fault+0x0/0x5c0 [<c0347264>] error_code+0x74/0x80 [<dcd49eee>] xsm_ident+0x6e/0x100 [unicorn_usb_atm] [<c0119cf7>] printk+0x17/0x20 [<dcd283a6>] _ZN19InterfaceProtectionC1Ev+0x16/0x50 [unicorn_usb_atm] [<dccfe7f8>] AMSW_Modem_SW_Init+0x28/0x180 [unicorn_usb_atm] [<dcd4cf7d>] unicorn_atm_startdevice+0x1d/0x80 [unicorn_usb_atm] [<dcd4b544>] msw_init+0x14/0x1a0 [unicorn_usb_atm] [<dcd4f5d5>] unicorn_attach+0xc5/0x200 [unicorn_usb_atm] [<dcd487aa>] do_probe+0x16a/0x190 [unicorn_usb_atm] [<dcd487e1>] probe_unicorn_usb+0x11/0x20 [unicorn_usb_atm] [<c028f1a8>] usb_probe_interface+0x68/0xb0 [<c0224be4>] really_probe+0x94/0x110 [<c028f4c9>] usb_match_id+0x19/0x50 [<c0224d27>] driver_probe_device+0xb7/0xc0 [<c034528b>] klist_next+0x4b/0xa0 [<c0224e29>] __driver_attach+0x79/0x80 [<c0223fca>] bus_for_each_dev+0x3a/0x60 [<c0224e44>] driver_attach+0x14/0x20 [<c0224db0>] __driver_attach+0x0/0x80 [<c0224542>] bus_add_driver+0x52/0x100 [<c028f998>] usb_register_driver+0x58/0xc0 [<c0119cf7>] printk+0x17/0x20 [<dcbb2055>] unicorn_usb_init+0x55/0x59 [unicorn_usb_atm] [<c0137bb2>] sys_init_module+0xe2/0x150 [<c01030c0>] syscall_call+0x7/0xb Reproducible: Always Steps to Reproduce: 1. compile bewna-adsl against kernel 2.6.20.6 on computer with usb ohci controller 2. modprobe unicorn_usb_atm 3. Actual Results: segmentation fault - modem hangs Expected Results: a working usb modem... works with 2.6.17 usb ohci controller kernel 2.6.17 non preemt kernel 2.6.20 preempt
Created attachment 115886 [details] full output of dmesg after segmentation fault
Did you tried it without CONFIG_PREEMT ?
(In reply to comment #2) > Did you tried it without CONFIG_PREEMT ? > Not yet. Today I will recompile the kernel and post the result. Thanks.
(In reply to comment #3) > (In reply to comment #2) > > Did you tried it without CONFIG_PREEMT ? > > > > Not yet. Today I will recompile the kernel and post the result. Thanks. > I compiled 2.6.20.6 without CONFIG_PREEMT and I get the same segmentation fault. On another machine with a preemt kernel 2.6.19.1 the driver works fine. So the situation is: 1) 2.6.17.13 no preemt - ohci - works 2) 2.6.19.1 preempt - uhci -works 3) 2.6.20.6 both no preemt and preemt - ohci - doesn't work (segmentation fault) 1 and 3 is the same machine.
The thing is I don't have the necessary hardware. Do you have the knowledge and available time for fixing it by yourself? Upstream doesn't seem to be interested in maintaining this package, even if you do their work. They ignored a patch sent to them months ago.
(In reply to comment #5) > The thing is I don't have the necessary hardware. > Do you have the knowledge and available time for fixing it by yourself? > > Upstream doesn't seem to be interested in maintaining this package, even if you > do their work. They ignored a patch sent to them months ago. > The knowlede I have is only applying patches :-( Or if you have an idea how to fix it and which lines of code I have to add|change|remove, I could apply and test it. Thanks.
I will try to discover the problem, but I don't count on it.
Unfortunatelly, the problem lies in the binary part of the driver, the modem_ant_USB_LINUX.o file. Since you are a Bewan customer, good luck in asking them to fix this problem. I've modified the ebuild to die if kernel version is 2.6.20 or above. Closed as UPSTREAM.
(In reply to comment #8) > Unfortunatelly, the problem lies in the binary part of the driver, the > modem_ant_USB_LINUX.o file. Since you are a Bewan customer, good luck in asking > them to fix this problem. > > I've modified the ebuild to die if kernel version is 2.6.20 or above. > > Closed as UPSTREAM. > Anyway, thanks for attention.
There may be a fix to this here: https://bugs.launchpad.net/ubuntu/+source/unicorn/+bug/945
er... I know the bug itself is quite old, but it's the comments at the end that are interesting. Just clarifying...
The problem isn't compilation (that I've fix it with patching), but something that is done in the object file modem_ant_USB_LINUX.o. Since we don't have the source file of that, I can't do nothing about it. The only thing you could do is disassemble the object file and fix the problem in the asm file. Can you do that? More importantly, do you care enough to fix Bewan's own problems?
aah, whoops, I'm a PCI modem user - would the same apply to me? Is there a way to compile only the PCI version of the driver if above 2.6.20 kernel version?
You could modify the kernel_is line as follows: if use usb && kernel_is ge 2 6 20 ; then Then run ebuild bewan-adsl-0.9.3-r2.ebuild digest. Tell me if it worked for ya and I'll modify the ebuild accordingly.
Bah - gives me: In file included from /var/tmp/portage/net-dialup/bewan-adsl-0.9.3-r2/work/unicorn/unicorn_pci/unicorn_pcidrv.c:17: include/linux/pci.h: In function 'pci_register_driver': include/linux/pci.h:595: error: 'KBUILD_MODNAME' undeclared (first use in this function) include/linux/pci.h:595: error: (Each undeclared identifier is reported only once include/linux/pci.h:595: error: for each function it appears in.) /var/tmp/portage/net-dialup/bewan-adsl-0.9.3-r2/work/unicorn/unicorn_pci/unicorn_pcidrv.c: In function 'find_unicorn': What should I set this constant to? I'd like to get it compiled to see if it'll work - if not, I'm going back to my USB speedtouch, even though the PCI modem cost me 30 quid. Waste of money. Next time, I'm getting an external modem and going pppoe with it.
You can try adding #ifndef KBUILD_MODULENAME #define KBUILD_MODNAME "unicorn_pci_eth" #endif in the source file, but in the end you will have 2 modules (unicorn_pci_atm.ko and unicorn_pci_eth.ko) that will be build using this define. Anyway, I guess modem_ant_PCI_LINUX.o is as broken as the modem_ant_USB_LINUX.o. Better use another type of device or use kernel versions lower than 2.6.20.
(In reply to comment #16) > Anyway, I guess modem_ant_PCI_LINUX.o is as broken as the > modem_ant_USB_LINUX.o. Better use another type of device or use kernel versions > lower than 2.6.20. > I have published a modified (unofficial) version (0.9.4) of the original 0.9.3 Bewan driver at my site: http://legolas558.iragan.com/index.php?option=downloads&task=info&id=32&Itemid=50&-Bewan-Unicorn-USB-PCI-ETH-ATM-ADSL-driver-v0-9-4-unofficial-version It does not yet work but I am (slowly) working on it, and it's anyway a good start for developers who wants to work on it. And yes, the modem_ant_USB_LINUX.o binary causes NULL-pointer access, I am debugging it and it seems due to the binary using old semaphore structures (perhaps of the old kernel). It can theorically be worked around without reverse engineering (although it has been very stupid for the implementors to tie a binary to kernel structures).