Date: Sat, 26 Apr 2003 01:48:54 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: current@freebsd.org Cc: gibbs@freebsd.org Subject: lots of malloc(M_WAITOK)'s in interrupt context from camisr Message-ID: <20030426013438.W38897@gamplex.bde.org>
next in thread | raw e-mail | index | archive | help
AFter unbreaking the check for interrupt context in malloc(): %%% Index: /sysc/kern/kern_malloc.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_malloc.c,v retrieving revision 1.121 diff -u -2 -r1.121 kern_malloc.c --- /sysc/kern/kern_malloc.c 26 Mar 2003 20:44:29 -0000 1.121 +++ /sysc/kern/kern_malloc.c 25 Apr 2003 15:26:51 -0000 @@ -217,6 +217,11 @@ #endif if (flags & M_WAITOK) - KASSERT(curthread->td_intr_nesting_level == 0, - ("malloc(M_WAITOK) in interrupt context")); + KASSERT(curthread->td_ithd == NULL && + curthread->td_intr_nesting_level == 0, + ("malloc(M_WAITOK) in interrupt context")); + if (flags & M_WAITOK) + if (curthread->td_ithd != NULL || + curthread->td_intr_nesting_level != 0) + Debugger("malloc(M_WAITOK) in interrupt context"); if (size <= KMEM_ZMAX) { if (size & KMEM_ZMASK) %%% I get lots of "malloc(M_WAITOK) in interrupt context"'s reported for camisr (from the non-KASSERT code in the above since the KASSERT would just panic once): %%% Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(d0,c0340080,502,6800,40) at malloc+0x3c allocdev(c03414e0,c2192820,c0332f80,df16dca8,c01b4bc0) at allocdev+0x4d makedev(68,0,c2192820,0,c6140400) at makedev+0x65 make_dev(c0332f80,0,0,5,180) at make_dev+0x110 xpt_periph_init(c6140400,c6346800,c6344800,df16dd00,c0131139) at xpt_periph_init+0x1d xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(2c,c0343f60,102,1,c61152c0) at malloc+0x3c sysctl_add_oid(c61152c0,c035d2a8,ffffffff,df16d73c,80000001) at sysctl_add_oid+0x7c cdregister(c6343800,df16d8d8,3,1,0) at cdregister+0x1a7 cam_periph_alloc(c0132e50,c0132a88,c0132b20,c0133bd0,c032829a,0,c60e10c0,c0132d30,80,df16d8d8) at cam_periph_alloc+0x1ef cdasync(0,80,df16db38,df16d8d8,df16d8d8) at cdasync+0x6f xptsetasyncfunc(c6344800,c60e16f0,df16db80,c012d7f6,c6344800) at xptsetasyncfunc+0x64 xptdefdevicefunc(c6344800,df16dbfc,c6341380,df16dbfc,c012d91c) at xptdefdevicefunc+0x15 xptdevicetraverse(c6341300,0,c012d944,df16dbfc,df16dbb4) at xptdevicetraverse+0x2a xptdeftargetfunc(c6341300,df16dbfc,c6341240,df16dbfc,c012d8f4) at xptdeftargetfunc+0x26 xpttargettraverse(c6341400,0,c012d91c,df16dbfc,df16dbe8) at xpttargettraverse+0x2b xptdefbusfunc(c6341400,df16dbfc) at xptdefbusfunc+0x26 xptbustraverse(0,c012d8f4,df16dbfc,2,c012d9d8) at xptbustraverse+0x2b xpt_for_all_devices(c012d9d8,c60e16f0) at xpt_for_all_devices+0x29 xpt_action(df16dc54,df16dc54,c60e1680,5,c60e1680) at xpt_action+0x667 cdinit(c6140400,c6346800,c6344800,df16dd00,c0131139) at cdinit+0x52 xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(2,c0343f60,2,df16d73c,2c) at malloc+0x3c sysctl_add_oid(c61152c0,c035d2a8,ffffffff,df16d73c,80000001) at sysctl_add_oid+0xaf cdregister(c6343800,df16d8d8,3,1,0) at cdregister+0x1a7 cam_periph_alloc(c0132e50,c0132a88,c0132b20,c0133bd0,c032829a,0,c60e10c0,c0132d30,80,df16d8d8) at cam_periph_alloc+0x1ef cdasync(0,80,df16db38,df16d8d8,df16d8d8) at cdasync+0x6f xptsetasyncfunc(c6344800,c60e16f0,df16db80,c012d7f6,c6344800) at xptsetasyncfunc+0x64 xptdefdevicefunc(c6344800,df16dbfc,c6341380,df16dbfc,c012d91c) at xptdefdevicefunc+0x15 xptdevicetraverse(c6341300,0,c012d944,df16dbfc,df16dbb4) at xptdevicetraverse+0x2a xptdeftargetfunc(c6341300,df16dbfc,c6341240,df16dbfc,c012d8f4) at xptdeftargetfunc+0x26 xpttargettraverse(c6341400,0,c012d91c,df16dbfc,df16dbe8) at xpttargettraverse+0x2b xptdefbusfunc(c6341400,df16dbfc) at xptdefbusfunc+0x26 xptbustraverse(0,c012d8f4,df16dbfc,2,c012d9d8) at xptbustraverse+0x2b xpt_for_all_devices(c012d9d8,c60e16f0) at xpt_for_all_devices+0x29 xpt_action(df16dc54,df16dc54,c60e1680,5,c60e1680) at xpt_action+0x667 cdinit(c6140400,c6346800,c6344800,df16dd00,c0131139) at cdinit+0x52 xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(4,c0343f60,2,1,c61152c0) at malloc+0x3c sysctl_add_oid(c61152c0,c035d2a8,ffffffff,df16d73c,80000001) at sysctl_add_oid+0xf2 cdregister(c6343800,df16d8d8,3,1,0) at cdregister+0x1a7 cam_periph_alloc(c0132e50,c0132a88,c0132b20,c0133bd0,c032829a,0,c60e10c0,c0132d30,80,df16d8d8) at cam_periph_alloc+0x1ef cdasync(0,80,df16db38,df16d8d8,df16d8d8) at cdasync+0x6f xptsetasyncfunc(c6344800,c60e16f0,df16db80,c012d7f6,c6344800) at xptsetasyncfunc+0x64 xptdefdevicefunc(c6344800,df16dbfc,c6341380,df16dbfc,c012d91c) at xptdefdevicefunc+0x15 xptdevicetraverse(c6341300,0,c012d944,df16dbfc,df16dbb4) at xptdevicetraverse+0x2a xptdeftargetfunc(c6341300,df16dbfc,c6341240,df16dbfc,c012d8f4) at xptdeftargetfunc+0x26 xpttargettraverse(c6341400,0,c012d91c,df16dbfc,df16dbe8) at xpttargettraverse+0x2b xptdefbusfunc(c6341400,df16dbfc) at xptdefbusfunc+0x26 xptbustraverse(0,c012d8f4,df16dbfc,2,c012d9d8) at xptbustraverse+0x2b xpt_for_all_devices(c012d9d8,c60e16f0) at xpt_for_all_devices+0x29 xpt_action(df16dc54,df16dc54,c60e1680,5,c60e1680) at xpt_action+0x667 cdinit(c6140400,c6346800,c6344800,df16dd00,c0131139) at cdinit+0x52 xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(e,c0343f60,2,df16d78c,1) at malloc+0x3c sysctl_add_oid(c61152c0,c035d2a8,ffffffff,df16d73c,80000001) at sysctl_add_oid+0x12e cdregister(c6343800,df16d8d8,3,1,0) at cdregister+0x1a7 cam_periph_alloc(c0132e50,c0132a88,c0132b20,c0133bd0,c032829a,0,c60e10c0,c0132d30,80,df16d8d8) at cam_periph_alloc+0x1ef cdasync(0,80,df16db38,df16d8d8,df16d8d8) at cdasync+0x6f xptsetasyncfunc(c6344800,c60e16f0,df16db80,c012d7f6,c6344800) at xptsetasyncfunc+0x64 xptdefdevicefunc(c6344800,df16dbfc,c6341380,df16dbfc,c012d91c) at xptdefdevicefunc+0x15 xptdevicetraverse(c6341300,0,c012d944,df16dbfc,df16dbb4) at xptdevicetraverse+0x2a xptdeftargetfunc(c6341300,df16dbfc,c6341240,df16dbfc,c012d8f4) at xptdeftargetfunc+0x26 xpttargettraverse(c6341400,0,c012d91c,df16dbfc,df16dbe8) at xpttargettraverse+0x2b xptdefbusfunc(c6341400,df16dbfc) at xptdefbusfunc+0x26 xptbustraverse(0,c012d8f4,df16dbfc,2,c012d9d8) at xptbustraverse+0x2b xpt_for_all_devices(c012d9d8,c60e16f0) at xpt_for_all_devices+0x29 xpt_action(df16dc54,df16dc54,c60e1680,5,c60e1680) at xpt_action+0x667 cdinit(c6140400,c6346800,c6344800,df16dd00,c0131139) at cdinit+0x52 xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(c,c0343f60,2,c60e11b0,2) at malloc+0x3c sysctl_ctx_entry_add(c61152c0,c63413c0) at sysctl_ctx_entry_add+0x2a sysctl_add_oid(c61152c0,c035d2a8,ffffffff,df16d73c,80000001) at sysctl_add_oid+0x153 cdregister(c6343800,df16d8d8,3,1,0) at cdregister+0x1a7 cam_periph_alloc(c0132e50,c0132a88,c0132b20,c0133bd0,c032829a,0,c60e10c0,c0132d30,80,df16d8d8) at cam_periph_alloc+0x1ef cdasync(0,80,df16db38,df16d8d8,df16d8d8) at cdasync+0x6f xptsetasyncfunc(c6344800,c60e16f0,df16db80,c012d7f6,c6344800) at xptsetasyncfunc+0x64 xptdefdevicefunc(c6344800,df16dbfc,c6341380,df16dbfc,c012d91c) at xptdefdevicefunc+0x15 xptdevicetraverse(c6341300,0,c012d944,df16dbfc,df16dbb4) at xptdevicetraverse+0x2a xptdeftargetfunc(c6341300,df16dbfc,c6341240,df16dbfc,c012d8f4) at xptdeftargetfunc+0x26 xpttargettraverse(c6341400,0,c012d91c,df16dbfc,df16dbe8) at xpttargettraverse+0x2b xptdefbusfunc(c6341400,df16dbfc) at xptdefbusfunc+0x26 xptbustraverse(0,c012d8f4,df16dbfc,2,c012d9d8) at xptbustraverse+0x2b xpt_for_all_devices(c012d9d8,c60e16f0) at xpt_for_all_devices+0x29 xpt_action(df16dc54,df16dc54,c60e1680,5,c60e1680) at xpt_action+0x667 cdinit(c6140400,c6346800,c6344800,df16dd00,c0131139) at cdinit+0x52 xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(2c,c0343f60,102,df16d78c,df16d78c) at malloc+0x3c sysctl_add_oid(c61152c0,c60e12d0,ffffffff,c030f5b9,c0000002,c61152b8,0,c0132df0,c03295ed,c030f5ca) at sysctl_add_oid+0x7c cdregister(c6343800,df16d8d8,3,1,0) at cdregister+0x2ba cam_periph_alloc(c0132e50,c0132a88,c0132b20,c0133bd0,c032829a,0,c60e10c0,c0132d30,80,df16d8d8) at cam_periph_alloc+0x1ef cdasync(0,80,df16db38,df16d8d8,df16d8d8) at cdasync+0x6f xptsetasyncfunc(c6344800,c60e16f0,df16db80,c012d7f6,c6344800) at xptsetasyncfunc+0x64 xptdefdevicefunc(c6344800,df16dbfc,c6341380,df16dbfc,c012d91c) at xptdefdevicefunc+0x15 xptdevicetraverse(c6341300,0,c012d944,df16dbfc,df16dbb4) at xptdevicetraverse+0x2a xptdeftargetfunc(c6341300,df16dbfc,c6341240,df16dbfc,c012d8f4) at xptdeftargetfunc+0x26 xpttargettraverse(c6341400,0,c012d91c,df16dbfc,df16dbe8) at xpttargettraverse+0x2b xptdefbusfunc(c6341400,df16dbfc) at xptdefbusfunc+0x26 xptbustraverse(0,c012d8f4,df16dbfc,2,c012d9d8) at xptbustraverse+0x2b xpt_for_all_devices(c012d9d8,c60e16f0) at xpt_for_all_devices+0x29 xpt_action(df16dc54,df16dc54,c60e1680,5,c60e1680) at xpt_action+0x667 cdinit(c6140400,c6346800,c6344800,df16dd00,c0131139) at cdinit+0x52 xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(11,c0343f60,2,c030f5b9,2c) at malloc+0x3c sysctl_add_oid(c61152c0,c60e12d0,ffffffff,c030f5b9,c0000002,c61152b8,0,c0132df0,c03295ed,c030f5ca) at sysctl_add_oid+0xaf cdregister(c6343800,df16d8d8,3,1,0) at cdregister+0x2ba cam_periph_alloc(c0132e50,c0132a88,c0132b20,c0133bd0,c032829a,0,c60e10c0,c0132d30,80,df16d8d8) at cam_periph_alloc+0x1ef cdasync(0,80,df16db38,df16d8d8,df16d8d8) at cdasync+0x6f xptsetasyncfunc(c6344800,c60e16f0,df16db80,c012d7f6,c6344800) at xptsetasyncfunc+0x64 xptdefdevicefunc(c6344800,df16dbfc,c6341380,df16dbfc,c012d91c) at xptdefdevicefunc+0x15 xptdevicetraverse(c6341300,0,c012d944,df16dbfc,df16dbb4) at xptdevicetraverse+0x2a xptdeftargetfunc(c6341300,df16dbfc,c6341240,df16dbfc,c012d8f4) at xptdeftargetfunc+0x26 xpttargettraverse(c6341400,0,c012d91c,df16dbfc,df16dbe8) at xpttargettraverse+0x2b xptdefbusfunc(c6341400,df16dbfc) at xptdefbusfunc+0x26 xptbustraverse(0,c012d8f4,df16dbfc,2,c012d9d8) at xptbustraverse+0x2b xpt_for_all_devices(c012d9d8,c60e16f0) at xpt_for_all_devices+0x29 xpt_action(df16dc54,df16dc54,c60e1680,5,c60e1680) at xpt_action+0x667 cdinit(c6140400,c6346800,c6344800,df16dd00,c0131139) at cdinit+0x52 xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(11,c0343f60,2,c030f5ca,10) at malloc+0x3c sysctl_add_oid(c61152c0,c60e12d0,ffffffff,c030f5b9,c0000002,c61152b8,0,c0132df0,c03295ed,c030f5ca) at sysctl_add_oid+0x12e cdregister(c6343800,df16d8d8,3,1,0) at cdregister+0x2ba cam_periph_alloc(c0132e50,c0132a88,c0132b20,c0133bd0,c032829a,0,c60e10c0,c0132d30,80,df16d8d8) at cam_periph_alloc+0x1ef cdasync(0,80,df16db38,df16d8d8,df16d8d8) at cdasync+0x6f xptsetasyncfunc(c6344800,c60e16f0,df16db80,c012d7f6,c6344800) at xptsetasyncfunc+0x64 xptdefdevicefunc(c6344800,df16dbfc,c6341380,df16dbfc,c012d91c) at xptdefdevicefunc+0x15 xptdevicetraverse(c6341300,0,c012d944,df16dbfc,df16dbb4) at xptdevicetraverse+0x2a xptdeftargetfunc(c6341300,df16dbfc,c6341240,df16dbfc,c012d8f4) at xptdeftargetfunc+0x26 xpttargettraverse(c6341400,0,c012d91c,df16dbfc,df16dbe8) at xpttargettraverse+0x2b xptdefbusfunc(c6341400,df16dbfc) at xptdefbusfunc+0x26 xptbustraverse(0,c012d8f4,df16dbfc,2,c012d9d8) at xptbustraverse+0x2b xpt_for_all_devices(c012d9d8,c60e16f0) at xpt_for_all_devices+0x29 xpt_action(df16dc54,df16dc54,c60e1680,5,c60e1680) at xpt_action+0x667 cdinit(c6140400,c6346800,c6344800,df16dd00,c0131139) at cdinit+0x52 xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(c,c0343f60,2,c2193820,11) at malloc+0x3c sysctl_ctx_entry_add(c61152c0,c63414c0) at sysctl_ctx_entry_add+0x2a sysctl_add_oid(c61152c0,c60e12d0,ffffffff,c030f5b9,c0000002,c61152b8,0,c0132df0,c03295ed,c030f5ca) at sysctl_add_oid+0x153 cdregister(c6343800,df16d8d8,3,1,0) at cdregister+0x2ba cam_periph_alloc(c0132e50,c0132a88,c0132b20,c0133bd0,c032829a,0,c60e10c0,c0132d30,80,df16d8d8) at cam_periph_alloc+0x1ef cdasync(0,80,df16db38,df16d8d8,df16d8d8) at cdasync+0x6f xptsetasyncfunc(c6344800,c60e16f0,df16db80,c012d7f6,c6344800) at xptsetasyncfunc+0x64 xptdefdevicefunc(c6344800,df16dbfc,c6341380,df16dbfc,c012d91c) at xptdefdevicefunc+0x15 xptdevicetraverse(c6341300,0,c012d944,df16dbfc,df16dbb4) at xptdevicetraverse+0x2a xptdeftargetfunc(c6341300,df16dbfc,c6341240,df16dbfc,c012d8f4) at xptdeftargetfunc+0x26 xpttargettraverse(c6341400,0,c012d91c,df16dbfc,df16dbe8) at xpttargettraverse+0x2b xptdefbusfunc(c6341400,df16dbfc) at xptdefbusfunc+0x26 xptbustraverse(0,c012d8f4,df16dbfc,2,c012d9d8) at xptbustraverse+0x2b xpt_for_all_devices(c012d9d8,c60e16f0) at xpt_for_all_devices+0x29 xpt_action(df16dc54,df16dc54,c60e1680,5,c60e1680) at xpt_action+0x667 cdinit(c6140400,c6346800,c6344800,df16dd00,c0131139) at cdinit+0x52 xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(d0,c0340080,502,f00,16) at malloc+0x3c allocdev(c032829a,df16d78c,c0334600,df16d6f4,c01b4bc0) at allocdev+0x4d makedev(f,0,df16d78c,df16d78c,df16d73c) at makedev+0x65 make_dev(c0334600,0,0,5,1a0) at make_dev+0x110 cdregister(c6343800,df16d8d8,3,1,0) at cdregister+0x305 cam_periph_alloc(c0132e50,c0132a88,c0132b20,c0133bd0,c032829a,0,c60e10c0,c0132d30,80,df16d8d8) at cam_periph_alloc+0x1ef cdasync(0,80,df16db38,df16d8d8,df16d8d8) at cdasync+0x6f xptsetasyncfunc(c6344800,c60e16f0,df16db80,c012d7f6,c6344800) at xptsetasyncfunc+0x64 xptdefdevicefunc(c6344800,df16dbfc,c6341380,df16dbfc,c012d91c) at xptdefdevicefunc+0x15 xptdevicetraverse(c6341300,0,c012d944,df16dbfc,df16dbb4) at xptdevicetraverse+0x2a xptdeftargetfunc(c6341300,df16dbfc,c6341240,df16dbfc,c012d8f4) at xptdeftargetfunc+0x26 xpttargettraverse(c6341400,0,c012d91c,df16dbfc,df16dbe8) at xpttargettraverse+0x2b xptdefbusfunc(c6341400,df16dbfc) at xptdefbusfunc+0x26 xptbustraverse(0,c012d8f4,df16dbfc,2,c012d9d8) at xptbustraverse+0x2b xpt_for_all_devices(c012d9d8,c60e16f0) at xpt_for_all_devices+0x29 xpt_action(df16dc54,df16dc54,c60e1680,5,c60e1680) at xpt_action+0x667 cdinit(c6140400,c6346800,c6344800,df16dd00,c0131139) at cdinit+0x52 xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(14,c03452e0,102,df16d78c,df16d78c) at malloc+0x3c eventhandler_register(0,c030f499,c01329b0,c6115000,3e8) at eventhandler_register+0x1bb cdregister(c6343800,df16d8d8,3,1,0) at cdregister+0x331 cam_periph_alloc(c0132e50,c0132a88,c0132b20,c0133bd0,c032829a,0,c60e10c0,c0132d30,80,df16d8d8) at cam_periph_alloc+0x1ef cdasync(0,80,df16db38,df16d8d8,df16d8d8) at cdasync+0x6f xptsetasyncfunc(c6344800,c60e16f0,df16db80,c012d7f6,c6344800) at xptsetasyncfunc+0x64 xptdefdevicefunc(c6344800,df16dbfc,c6341380,df16dbfc,c012d91c) at xptdefdevicefunc+0x15 xptdevicetraverse(c6341300,0,c012d944,df16dbfc,df16dbb4) at xptdevicetraverse+0x2a xptdeftargetfunc(c6341300,df16dbfc,c6341240,df16dbfc,c012d8f4) at xptdeftargetfunc+0x26 xpttargettraverse(c6341400,0,c012d91c,df16dbfc,df16dbe8) at xpttargettraverse+0x2b xptdefbusfunc(c6341400,df16dbfc) at xptdefbusfunc+0x26 xptbustraverse(0,c012d8f4,df16dbfc,2,c012d9d8) at xptbustraverse+0x2b xpt_for_all_devices(c012d9d8,c60e16f0) at xpt_for_all_devices+0x29 xpt_action(df16dc54,df16dc54,c60e1680,5,c60e1680) at xpt_action+0x667 cdinit(c6140400,c6346800,c6344800,df16dd00,c0131139) at cdinit+0x52 xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(63,c03452e0,2,1,3) at malloc+0x3c eventhandler_register(0,c030fd7d,c0137e0c,0,2710,c0137da8,0,5dc) at eventhandler_register+0x9e dainit(c6140400,c6346800,c6344800,df16dd00,c0131139) at dainit+0xaf xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(14,c03452e0,102,1,3) at malloc+0x3c eventhandler_register(0,c030fd7d,c0137e0c,0,2710,c0137da8,0,5dc) at eventhandler_register+0x1bb dainit(c6140400,c6346800,c6344800,df16dd00,c0131139) at dainit+0xaf xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- db> c Debugger("malloc(M_WAITOK) in interrupt context") Stopped at Debugger+0x45: xchgl %ebx,in_Debugger.0 db> t Debugger(c031a340) at Debugger+0x45 malloc(d0,c0340080,502,1f00,33) at malloc+0x3c allocdev(c633b690,c6346c00,c0334c80,df16d7b8,c01b4bc0) at allocdev+0x4d makedev(1f,0,c6346c00,df16d8d8,c6343500) at makedev+0x65 make_dev(c0334c80,0,0,5,180) at make_dev+0x110 passregister(c6343500,df16d8d8,3,1,0) at passregister+0xd8 cam_periph_alloc(c0138154,c0138010,c0138078,c0138390,c030b1c3) at cam_periph_alloc+0x1ef passasync(0,80,df16db38,df16d8d8,df16d8d8) at passasync+0x47 xptsetasyncfunc(c6344800,c60e12a0,df16db80,c012d7f6,c6344800) at xptsetasyncfunc+0x64 xptdefdevicefunc(c6344800,df16dbfc,c6341380,df16dbfc,c012d91c) at xptdefdevicefunc+0x15 xptdevicetraverse(c6341300,0,c012d944,df16dbfc,df16dbb4) at xptdevicetraverse+0x2a xptdeftargetfunc(c6341300,df16dbfc,c6341240,df16dbfc,c012d8f4) at xptdeftargetfunc+0x26 xpttargettraverse(c6341400,0,c012d91c,df16dbfc,df16dbe8) at xpttargettraverse+0x2b xptdefbusfunc(c6341400,df16dbfc) at xptdefbusfunc+0x26 xptbustraverse(0,c012d8f4,df16dbfc,2,c012d9d8) at xptbustraverse+0x2b xpt_for_all_devices(c012d9d8,c60e12a0) at xpt_for_all_devices+0x29 xpt_action(df16dc54,df16dc54,c60e1390,5,c60e1390) at xpt_action+0x667 passinit(c6140400,c6346800,c6344800,df16dd00,c0131139) at passinit+0x52 xpt_finishconfig(c21a8f00,c6140400) at xpt_finishconfig+0x65 camisr(c035d220) at camisr+0x1ed ithread_loop(c21a8e00,df16dd48) at ithread_loop+0x174 fork_exit(c01c0fdc,c21a8e00,df16dd48) at fork_exit+0xa9 fork_trampoline() at fork_trampoline+0x1a --- trap 0x1, eip = 0, esp = 0xdf16dd7c, ebp = 0 --- %%% The only SCSI hardware on the machine is an ATAPI cd atached using atapicam (and atapicd too). The mallocs are actually in sysctl support code and other subsystems that camisr wanders off into, so the fix isn't just to use M_NOWAIT. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030426013438.W38897>