Opened 9 years ago

Closed 5 years ago

Last modified 5 years ago

#7039 closed bug (fixed)

[Network stack] Panic: _mutex_lock (): double lock

Reported by: diver Owned by: axeld
Priority: normal Milestone: R1
Component: Network & Internet/Stack Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

This is hrev39980, gcc4hybrid.

Running tcpdump in the first Terminal tab and ifconfig del /dev/net/... in another one crashes network stack.
Same thing with running tcpdump and disabling interface in Network preflet.

Attachments (2)

stack_crash.png (46.2 KB) - added by diver 9 years ago.
0001-Change-the-monitor_lock-to-be-a-recursive_lock-fixin.patch (4.0 KB) - added by jackburton 5 years ago.

Download all attachments as: .zip

Change History (10)

Changed 9 years ago by diver

Attachment: stack_crash.png added

comment:1 Changed 9 years ago by diver

Summary: [Network stack] crashes after ifconfig del + tcpdump[Network stack] Panic: _mutex_lock (): double lock

comment:2 Changed 5 years ago by diver

Still here in hrev47314.

comment:3 Changed 5 years ago by jackburton

I'm trying under vbox but cannot reproduce. The processes in both terminals are unkillable, though. The virtual NIC is connected using "NAT".

Last edited 5 years ago by jackburton (previous) (diff)

comment:4 Changed 5 years ago by diver

Still crashes for me in hrev47724. NAT mode as well.

comment:5 Changed 5 years ago by jackburton

Has a Patch: set

comment:6 Changed 5 years ago by jackburton

The problem is that notify_device_monitor acquires the monitor lock (a mutex), then indirectly calls unregister_device_monitor, which acquires the lock again. I changed the mutex_to a recursive_lock, and the problem goes away. Please someone review the patch.

comment:7 Changed 5 years ago by axeld

Patch looks good. The only thing that is forbidden is to remove other handlers during notify.

comment:8 Changed 5 years ago by jackburton

Resolution: fixed
Status: newclosed

Applied in hrev47876. Thank you Axel for the review!

Last edited 5 years ago by jackburton (previous) (diff)
Note: See TracTickets for help on using tickets.