NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lockup: softnet_lock held across usb xfr (usmsc0/PR#49065 again)



The following reply was made to PR kern/49065; it has been noted by GNATS.

From: kardel%netbsd.org@localhost
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: lockup: softnet_lock held across usb xfr (usmsc0/PR#49065 again)
Date: Sun, 21 Dec 2014 13:01:18 +0100 (CET)

 >Submitter-Id:	net
 >Originator:	Frank Kardel
 >Organization:
 	
 >Confidential:	no
 >Synopsis:	lockup: softnet_lock held across usb xfr (usmsc0/PR#49065 again)
 >Severity:	serious
 >Priority:	high
 >Category:	kern
 >Class:		sw-bug
 >Release:	NetBSD 7.99.3
 	
 	
 >Environment:
 	
 	
 System: NetBSD rpiahz 7.99.3 NetBSD 7.99.3 (RPISENSOR) #: Wed Dec 17 00:35:23 CET 2014  kardel@Andromeda:/usr/srccur/src/sys/arch/evbarm/compile/obj.evbarm/RPISENSOR evbarm
 Architecture: earmv6hf
 Machine: evbarm
 >Description:
 	run mdnsd
 	ifconfig tun1 create
 	ifconfig tun1 10.201.1.2 10.201.1.1 netmask 0xffffffff
 	ifconfig tun1 10.201.1.2 10.201.1.1 netmask 0xffffffff
 	ifconfig tun1 10.201.1.2 10.201.1.1 netmask 0xffffffff
 	> LOCKUP - see status below
 	the mcast operations done by mdnsd keep the softnet_lock
 	while doing an usb xfr to usmsc0. This xfr does not terminate
 	and all network related code locks up in consequence.
 	This is the same pattern as in PR#49065.
 
 >How-To-Repeat:
 rpiahz# [insure mdnsd is running]
 rpiahz# ifconfig tun1 create
 rpiahz# ifconfig tun1 10.201.1.2 10.201.1.1 netmask 0xffffffff
 rpiahz# ifconfig tun1 10.201.1.2 10.201.1.1 netmask 0xffffffff
 rpiahz# ifconfig tun1 10.201.1.2 10.201.1.1 netmask 0xffffffff
 ~Stopped in pid 0.2 (system) at  netbsd:cpu_Debugger+0x4:        bx      r14
 db> ps
 PID    LID S CPU     FLAGS       STRUCT LWP *               NAME WAIT
 680      1 3   0         0           d9c87960           ifconfig tstile
 2295     1 3   0         0           db9dc060              mdnsd usbxfer
 3242     1 3   0        80           db9dc8a0                 sh wait
 105      1 3   0        80           db9dd660              login wait
 96       1 3   0        80           d6da5400               cron nanoslp
 3187     1 3   0        80           d6da56c0              inetd kqueue
 2454     1 3   0        80           d9c86360               qmgr kqueue
 2382     1 3   0        80           db9dc5e0             pickup kqueue
 2973     1 3   0        80           d9c868e0             master kqueue
 2199     1 3   0        80           d9c87120               sshd select
 2284     1 3   0        80           d9c876a0               ntpd netio
 1883     1 3   0        80           d9c873e0               ntpd pause
 1525     1 3   0        80           d9c86e60            devpubd devmon
 1233     1 3   0        80           db4ce340               perl select
 633      4 3   0         0           db4ce8c0              named tstile
 633      3 3   0        80           db4ceb80              named parked
 633      2 3   0        80           db4cee40              named parked
 633      1 3   0        80           db4cf100              named sigwait
 606      1 3   0        80           db4cf3c0            syslogd kqueue
 506      1 3   0        80           db4cf680              vtund select
 388      1 3   0         0           db4cfc00             routed tstile
 1        1 3   0        80           dbaf5640               init wait
 0       48 3   0       200           db4ce080           onewire0 owidle
 0       47 3   0       200           db4ce600          cryptoret crypto_w
 0       46 3   0       200           dbe742e0            physiod physiod
 0       45 3   0       280           db9dd920          VCHIQka-0 lnxcmplt
 0       44 3   0       200           db9ddbe0           aiodoned aiodoned
 0       43 3   0       200           dbaf4040            ioflush syncer
 0       42 3   0       200           dbaf5bc0           pgdaemon pgdaemon
 0       41 3   0       280           dbaf4300            vcaudio data
 0       40 3   0       280           dbaf45c0           VCHIQs-0 semacv
 0       39 3   0       280           dbaf4880           VCHIQr-0 semacv
 0       38 3   0       280           dbe74020            VCHIQ-0 semacv
 0       35 3   0       200           dbaf5900               usb0 usbevt
 0       33 3   0       200           dbaf5380              unpgc unpgc
 0       32 3   0       200           dbaf50c0        vmem_rehash vmem_rehash
 0       31 3   0       200           dbaf4e00            vcmbox0 vcmbox0
 0       30 3   0       200           dbaf4b40             sdmmc0 mmctaskq
 0       21 3   0       200           dbe745a0         usbtask-dr usbtsk
 0       20 3   0       200           dbe74860         usbtask-hc usbtsk
 0       19 3   0       200           dbe74b20               dwc2 dwc2
 0       18 3   0       200           dbe74de0               iic1 iicintr
 0       17 3   0       200           dbe750a0               iic0 iicintr
 0       16 3   0       200           dbe75360             sysmon smtaskq
 0       15 3   0       200           dbe75620         pmfsuspend pmfsuspend
 0       14 3   0       200           dbe758e0           pmfevent pmfevent
 0       13 3   0       200           dbe75ba0         sopendfree sopendfr
 0       12 3   0       200           dbf24000           nfssilly nfssilly
 0       11 3   0       200           dbf242c0            cachegc cachegc
 0       10 3   0       200           dbf24580              vrele vrele
 0        9 3   0       200           dbf24840             vdrain vdrain
 0        8 3   0       200           dbf24b00          modunload mod_unld
 0        7 3   0       200           dbf24dc0            xcall/0 xcall
 0        6 1   0       200           dbf25080          softser/0
 0        5 3   0       200           dbf25340          softclk/0 tstile
 0        4 1   0       200           dbf25600          softbio/0
 0        3 3   0       200           dbf258c0          softnet/0 tstile
 0    >   2 7   0       201           dbf25b80             idle/0
 0        1 3   0       200           c046abe0            swapper uvm
 db> bt/t 0t680
 trace: pid 680 lid 1 at 0xd9635ce4
 0xd9635ce4: netbsd:mi_switch+0xc
 0xd9635d14: netbsd:sleepq_block+0xa4
 0xd9635d5c: netbsd:turnstile_block+0x304
 0xd9635da4: netbsd:mutex_enter+0x1a4
 0xd9635dcc: netbsd:soclose+0x20
 0xd9635de4: netbsd:soo_close+0x20
 0xd9635e24: netbsd:closef+0x6c
 0xd9635e6c: netbsd:fd_free+0x174
 0xd9635ee4: netbsd:exit1+0x100
 0xd9635f04: netbsd:sys_exit+0x3c
 0xd9635f74: netbsd:syscall+0x8c
 0xd9635fac: netbsd:swi_handler+0x9c
 db> ps/w
 PID   LID          COMMAND     EMUL  PRI WAIT-MSG    WAIT-CHANNEL
 680      1         ifconfig   netbsd   43 tstile       dbfaffc0
 2295     1            mdnsd   netbsd   43 usbxfer      dbae7bcc
 3242     1               sh   netbsd   43 wait         dba9f358
 105      1            login   netbsd   33 wait         dba9fc18
 96       1             cron   netbsd   43 nanoslp      d6da5400
 3187     1            inetd   netbsd   31 kqueue       d9b0f854
 2454     1             qmgr   netbsd   39 kqueue       dbf120dc
 2382     1           pickup   netbsd   43 kqueue       d9b0fa34
 2973     1           master   netbsd   43 kqueue       d9b0f8a4
 2199     1             sshd   netbsd   32 select       dbf14008
 2284     1             ntpd   netbsd  191 netio        db2d8238
 1883     1             ntpd   netbsd  191 pause        d9c873e0
 1525     1          devpubd   netbsd   37 devmon       c0552df8
 1233     1             perl   netbsd   43 select       dbf14008
 633      4            named   netbsd   43 tstile       dbfaffc0
 633      3            named   netbsd   43 parked       9b1ae560
 633      2            named   netbsd   43 parked       9b1b1560
 633      1            named   netbsd   39 sigwait      db4cf274
 606      1          syslogd   netbsd   43 kqueue       dbf133ec
 506      1            vtund   netbsd   44 select       dbf14008
 388      1           routed   netbsd   43 tstile       dbfaffc0
 1        1             init   netbsd   41 wait         dba9fdd8
 0       48           system   netbsd   96 owidle       db4ce080
 0       47           system   netbsd   96 crypto_w     e88327c8
 0       46           system   netbsd  123 physiod      db91765c
 0       45           system   netbsd   96 lnxcmplt     dbaa11e0
 0       44           system   netbsd  125 aiodoned     dbfa01b4
 0       43           system   netbsd  124 syncer       dbaf4040
 0       42           system   netbsd  126 pgdaemon     c056f948
 0       41           system   netbsd  123 data         dbaa109c
 0       40           system   netbsd   96 semacv       c0571224
 0       39           system   netbsd   96 semacv       c057120c
 0       38           system   netbsd   96 semacv       c05711f4
 0       35           system   netbsd   96 usbevt       dbdf6570
 0       33           system   netbsd   96 unpgc        c056efe8
 0       32           system   netbsd  125 vmem_rehash  dbfa0754
 0       31           system   netbsd   43 vcmbox0      dbfa0934
 0       30           system   netbsd   96 mmctaskq     dbe9e834
 0       21           system   netbsd   96 usbtsk       c056f0ec
 0       20           system   netbsd   96 usbtsk       c056f0cc
 0       19           system   netbsd  123 dwc2         dbfa0d54
 0       18           system   netbsd   96 iicintr      dbfa1158
 0       17           system   netbsd   96 iicintr      dbfa12d8
 0       16           system   netbsd   96 smtaskq      c056d358
 0       15           system   netbsd   43 pmfsuspend   dbfa1a74
 0       14           system   netbsd   43 pmfevent     dbfa1ad4
 0       13           system   netbsd   96 sopendfr     c056efac
 0       12           system   netbsd   43 nfssilly     dbfa1d14
 0       11           system   netbsd  125 cachegc      dbf242c0
 0       10           system   netbsd  125 vrele        c054d300
 0        9           system   netbsd  125 vdrain       c054d2c0
 0        8           system   netbsd  125 mod_unld     c05531c0
 0        7           system   netbsd  127 xcall        c04441b8
 0        6           system   netbsd  223              0
 0        5           system   netbsd  220 tstile       dbfaffc0
 0        4           system   netbsd  221              0
 0        3           system   netbsd  222 tstile       dbfaffc0
 0    >   2           system   netbsd    0              0
 0        1           system   netbsd  125 uvm          c046abe0
 db> show lock dbfaffc0
 lock address : 0x00000000dbfaffc0 type     :     sleep/adaptive
 initialized  : 0x00000000c0147660
 shared holds :                  0 exclusive:                  1
 shares wanted:                  0 exclusive:                  5
 current cpu  :                  0 last held:                  0
 current lwp  : 0x00000000dbf25b80 last held: 0x00000000db9dc060
 last locked* : 0x00000000c02ac36c unlocked : 0x00000000c02abdf8
 owner field  : 0x00000000db9dc060 wait/spin:                1/0
 
 Turnstile chain at 0xc054bf40.
 => Turnstile at 0xdbf23f48 (wrq=0xdbf23f58, rdq=0xdbf23f60).
 => 0 waiting readers:
 => 5 waiting writers: 0xdbf258c0 0xdbf25340 0xdb4ce8c0 0xdb4cfc00 0xd9c87960
 db> bt/t 0t2295
 trace: pid 2295 lid 1 at 0xdb5e1b04
 0xdb5e1b04: netbsd:mi_switch+0xc
 0xdb5e1b34: netbsd:sleepq_block+0xa4
 0xdb5e1b6c: netbsd:cv_wait+0x114
 0xdb5e1ba4: netbsd:usbd_transfer+0x6b0
 0xdb5e1bec: netbsd:usbd_do_request_flags_pipe+0x21c
 0xdb5e1c14: netbsd:usbd_do_request+0x38
 0xdb5e1c44: netbsd:smsc_write_reg+0x60
 0xdb5e1c6c: netbsd:smsc_setmulti+0xfc
 0xdb5e1c9c: netbsd:smsc_ioctl+0x110
 0xdb5e1d44: netbsd:if_mcast_op+0x50
 0xdb5e1d9c: netbsd:in6_delmulti+0x144
 0xdb5e1db4: netbsd:in6_leavegroup+0x20
 0xdb5e1dcc: netbsd:ip6_freemoptions+0x3c
 0xdb5e1dec: netbsd:in6_pcbdetach+0xc8
 0xdb5e1e0c: netbsd:udp6_detach_wrapper+0x3c
 0xdb5e1e34: netbsd:soclose+0xf4
 0xdb5e1e4c: netbsd:soo_close+0x20
 0xdb5e1e8c: netbsd:closef+0x6c
 0xdb5e1eec: netbsd:fd_close+0x234
 0xdb5e1f04: netbsd:sys_close+0x2c
 0xdb5e1f74: netbsd:syscall+
 db> x/x softnet_lock
 softnet_lock:    dbfaffc0
 db> bt/a 0xdbf258c0                                            
 trace: pid 0 lid 3 at 0xdbf1fe74
 0xdbf1fe74: netbsd:mi_switch+0xc
 0xdbf1fea4: netbsd:sleepq_block+0xa4
 0xdbf1feec: netbsd:turnstile_block+0x304
 0xdbf1ff34: netbsd:mutex_enter+0x1a4
 0xdbf1ff64: netbsd:route_intr+0x30
 0xdbf1ffac: netbsd:softint_dispatch+0xe4
 Bad frame pointer: 0xd9635a6c
 db> bt/a 0xdbf25340                                            
 trace: pid 0 lid 5 at 0xdbf1be5c
 0xdbf1be5c: netbsd:mi_switch+0xc
 0xdbf1be8c: netbsd:sleepq_block+0xa4
 0xdbf1bed4: netbsd:turnstile_block+0x304
 0xdbf1bf1c: netbsd:mutex_enter+0x1a4
 0xdbf1bf34: netbsd:tcp_slowtimo+0x18
 0xdbf1bf64: netbsd:callout_softclock+0x188
 0xdbf1bfac: netbsd:softint_dispatch+0xe4
 Bad frame pointer: 0xdb583c64
 db> bt/a 0xdb4ce8c0
 trace: pid 633 lid 4 at 0xdaa8fc5c
 0xdaa8fc5c: netbsd:mi_switch+0xc
 0xdaa8fc8c: netbsd:sleepq_block+0xa4
 0xdaa8fcd4: netbsd:turnstile_block+0x304
 0xdaa8fd1c: netbsd:mutex_enter+0x1a4
 0xdaa8fd3c: netbsd:filt_soread+0x30
 0xdaa8fed4: netbsd:kevent1+0x534
 0xdaa8ff04: netbsd:sys___kevent50+0x48
 0xdaa8ff74: netbsd:syscall+0x8c
 0xdaa8ffac: netbsd:swi_handler+0x9c
 db> bt/a 0xdb4cfc00
 trace: pid 388 lid 1 at 0xdb583c34
 0xdb583c34: netbsd:mi_switch+0xc
 0xdb583c64: netbsd:sleepq_block+0xa4
 0xdb583cac: netbsd:turnstile_block+0x304
 0xdb583cf4: netbsd:mutex_enter+0x1a4
 0xdb583d1c: netbsd:sopoll+0x24
 0xdb583da4: netbsd:sel_do_scan+0x2f8
 0xdb583eb4: netbsd:selcommon.part.2+0x130
 0xdb583f04: netbsd:sys___select50+0x84
 0xdb583f74: netbsd:syscall+0x8c
 0xdb583fac: netbsd:swi_handler+0x9c
 db> bt/a 0xd9c87960
 trace: pid 680 lid 1 at 0xd9635ce4
 0xd9635ce4: netbsd:mi_switch+0xc
 0xd9635d14: netbsd:sleepq_block+0xa4
 0xd9635d5c: netbsd:turnstile_block+0x304
 0xd9635da4: netbsd:mutex_enter+0x1a4
 0xd9635dcc: netbsd:soclose+0x20
 0xd9635de4: netbsd:soo_close+0x20
 0xd9635e24: netbsd:closef+0x6c
 0xd9635e6c: netbsd:fd_free+0x174
 0xd9635ee4: netbsd:exit1+0x100
 0xd9635f04: netbsd:sys_exit+0x3c
 0xd9635f74: netbsd:syscall+0x8c
 0xd9635fac: netbsd:swi_handler+0x9c
 >Fix:
 	avoid locking softnet_lock across usb operations
 


Home | Main Index | Thread Index | Old Index