#7252: KDL when removing an active USB network interface ----------------------------------------+----------------------- Reporter: phoudoin | Owner: axeld Type: bug | Status: new Priority: critical | Milestone: R1 Component: Network & Internet/Stack | Version: R1/alpha2 Resolution: | Keywords: Blocked By: | Blocking: Has a Patch: 0 | Platform: All ----------------------------------------+----------------------- Description changed by phoudoin: Old description: > Plug an USB adapter supported by either usb_asix, usb_ecm or usb_pegasus, > with not wire connected. > > The net_server detect it and as the device report (wrongly) a link, it > starts to auto-configure it via DHCP. > Remove the device before DHCP attempts ends. > > I get this KDL: > > {{{ > PANIC: _mutex_lock(): double lock of 0x8102b9fc by thread 264 > Welcome to Kernel Debugging Land... > Thread 264 "/dev/net/pegasus/0 reader" running on CPU 1 > stack trace for thread 264 "/dev/net/pegasus/0 reader" > kernel stack: 0x816b5000 to 0x816b9000 > frame caller <image>:function + offset > 0 816b8bcc (+ 32) 800ed4b3 <kernel_x86>:arch_debug_stack_trace + > 0x000f > 1 816b8bec (+ 16) 80072d1e <kernel_x86> stack_trace_trampoline(void*: > NULL) + 0x000b > 2 816b8bfc (+ 12) 800f2c96 > <kernel_x86>:arch_debug_call_with_fault_handler + 0x001b > 3 816b8c08 (+ 48) 80073215 <kernel_x86>:debug_call_with_fault_handler > + 0x0052 > 4 816b8c38 (+ 80) 800741c6 <kernel_x86> kernel_debugger_loop(char > const*: 0x1 "<???>", char const*: 0x8015b764 "^^k^", char*: 0x816b8cc8, > int32: -2147007438) + 0x0226 > 5 816b8c88 (+ 64) 80074451 <kernel_x86> kernel_debugger_internal(char > const*: 0x1 "<???>", char const*: 0x860446b0 "", char*: 0x816b8ce8, > int32: -2147006943) + 0x0112 > 6 816b8cc8 (+ 32) 80074634 <kernel_x86>:panic + 0x0023 > 7 816b8ce8 (+ 80) 8006cbd5 <kernel_x86>:_mutex_lock + 0x00a7 > 8 816b8d38 (+ 512) 8101705f </boot/system/add- > ons/kernel/network/stack> get_device_interface(const char*: 0x85b6d9ac > "/dev/net/pegasus/0", false) + 0x002f > 9 816b8f38 (+ 64) 81017c86 </boot/system/add- > ons/kernel/network/stack> device_removed(net_device*: 0x85b6d9a8) + > 0x0036 > 10 816b8f78 (+ 96) 81017e0e </boot/system/add- > ons/kernel/network/stack> device_reader_thread(void*: 0x8638b968) + > 0x010e > 11 816b8fd8 (+ 32) 80065d0b <kernel_x86> > _create_kernel_thread_kentry() + 0x0015 > 12 816b8ff8 (+2123657224) 800069578 <kernel_x86> thread_kthread_exit() > + 0x0000 > }}} > > This is with nightly gcc4hybrid r40527 running native on a dual core > system. > > When the device is removed after the DHCP failed attemps, there is no > KDL, but running ifconfig or clicking networkstatus replicant in Deskbar > froze them. > > One also can wonder why the pegasus device report a link when there is > none yet... > > Anyway, device_removed() should not leads to a KDL. New description: Plug an USB adapter supported by usb_pegasus, without ethernet wire connected. The net_server detect it and as the device report (wrongly!) a link, it starts to auto-configure it via DHCP. Remove the device before DHCP attempts ends. I get this KDL: {{{ PANIC: _mutex_lock(): double lock of 0x8102b9fc by thread 264 Welcome to Kernel Debugging Land... Thread 264 "/dev/net/pegasus/0 reader" running on CPU 1 stack trace for thread 264 "/dev/net/pegasus/0 reader" kernel stack: 0x816b5000 to 0x816b9000 frame caller <image>:function + offset 0 816b8bcc (+ 32) 800ed4b3 <kernel_x86>:arch_debug_stack_trace + 0x000f 1 816b8bec (+ 16) 80072d1e <kernel_x86> stack_trace_trampoline(void*: NULL) + 0x000b 2 816b8bfc (+ 12) 800f2c96 <kernel_x86>:arch_debug_call_with_fault_handler + 0x001b 3 816b8c08 (+ 48) 80073215 <kernel_x86>:debug_call_with_fault_handler + 0x0052 4 816b8c38 (+ 80) 800741c6 <kernel_x86> kernel_debugger_loop(char const*: 0x1 "<???>", char const*: 0x8015b764 "^^k^", char*: 0x816b8cc8, int32: -2147007438) + 0x0226 5 816b8c88 (+ 64) 80074451 <kernel_x86> kernel_debugger_internal(char const*: 0x1 "<???>", char const*: 0x860446b0 "", char*: 0x816b8ce8, int32: -2147006943) + 0x0112 6 816b8cc8 (+ 32) 80074634 <kernel_x86>:panic + 0x0023 7 816b8ce8 (+ 80) 8006cbd5 <kernel_x86>:_mutex_lock + 0x00a7 8 816b8d38 (+ 512) 8101705f </boot/system/add-ons/kernel/network/stack> get_device_interface(const char*: 0x85b6d9ac "/dev/net/pegasus/0", false) + 0x002f 9 816b8f38 (+ 64) 81017c86 </boot/system/add-ons/kernel/network/stack> device_removed(net_device*: 0x85b6d9a8) + 0x0036 10 816b8f78 (+ 96) 81017e0e </boot/system/add-ons/kernel/network/stack> device_reader_thread(void*: 0x8638b968) + 0x010e 11 816b8fd8 (+ 32) 80065d0b <kernel_x86> _create_kernel_thread_kentry() + 0x0015 12 816b8ff8 (+2123657224) 800069578 <kernel_x86> thread_kthread_exit() + 0x0000 }}} This is with nightly gcc4hybrid r40527 running native on a dual core system. When the device is removed after the DHCP failed attemps, there is no KDL, but running ifconfig or clicking networkstatus replicant in Deskbar froze them. One can wonder why the pegasus device report a link when there is none yet... Anyway, device_removed() should not leads to a KDL. -- -- Ticket URL: <http://dev.haiku-os.org/ticket/7252#comment:3> Haiku <http://dev.haiku-os.org> Haiku - the operating system.