Subject: Re: Generating a crash dump...
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: John Hawkinson <jhawk@mit.edu>
List: current-users
Date: 05/26/2000 14:45:16
OK, this is starting to get irksome ;-)

| > dumping dev 0,1 offset 199177
| > dump pciide0:0:0: bad state 1 in _wdc_ata_bio_start
| > panic: _wdc_ata_bio_start: bad state
| 
| This should have worked, but it seems the IDE controller was not in
| a stable state, so it aborted. It look like this case should be easy
| to deal with, if we know we are doing a core dump (so that we can
| just reset the driver state without worying). Is there a way (global
| variable or something) to know if we're doing a core dump ?

I'm not sure how architecturally clean this is -- what's the
nature of this state and why is it not reset under normal
circumstances? [i.e. why wouldn't it always be right to reset it?]

Some parts of the kernel seem to check if "panicstr" is non-null, as
the first thing that panic() does is set it. e.g. vfs_shutdown() skips
vfs_unmountall() in that case, etc. I suppose this is legit given:

sys/kern/subr_prf.c:
141 /*
142  * globals
143  */
144 
145 struct  tty *constty;   /* pointer to console "window" tty */
146 extern  int log_open;   /* subr_log: is /dev/klog open? */
147 const   char *panicstr; /* arg to first call to panic (used as a flag
148                            to indicate that panic has already been called).

Personally, I keep seeing these state problems consistently whenever
I try to dump. For instance, "sync" from ddb output is attached below.
It sure seems out of hand -- three panics above and beyond the reason
why lost in the first place, so quadruple panics are the norm
if anything goes wrong.

I presume it's not necessary to PR this since it's an easy fix? ;-)

--jhawk

syncing disks... panic: lockmgr: no context
Begin traceback...
_lockmgr(c01a9dcb,c070b000,c070b000,10,0) at _lockmgr+0x64
_lockmgr(c070b018,10001,c04d6880) at _lockmgr+0x64
_vfs_busy(c070b000,10,c04d6880) at _vfs_busy+0xa6
_sys_sync(c04ccc40,0,0,100,0) at _sys_sync+0x25
_vfs_shutdown(0,cd5e8c58,c018d4cf,100,0) at _vfs_shutdown+0x41
_cpu_reboot(100,0,cd5e8d00,c018cfd0,1) at _cpu_reboot+0x3b
_db_sync_cmd(1,0,c03e4945,cd5e8c88,1) at _db_sync_cmd+0xf
_db_command(c046c6d8,c046c4f8,c018d1d0) at _db_command+0x1ec
_db_command_loop(c02fe658) at _db_command_loop+0x82
_db_trap(1,0,1,e000ffce,c06fb00a) at _db_trap+0x100
_kdb_trap(1,0,cd5e8db8) at _kdb_trap+0xc0
_trap() at _trap+0x168
--- trap (number 1) ---
_cpu_Debugger(c06f9200,cd5e8e34,c03e7ce0,c06f9200,cd5e8e40) at _cpu_Debugger+0x4
_internal_command(c06f9200,cd5e8e40,f420,1,c04baffc) at _internal_command+0x150
_wskbd_translate(c04bacd8,2,1,c06fa500,c04baffc) at _wskbd_translate+0xd8
_wskbd_input(c06f9200,2,1,1,2) at _wskbd_input+0x53
_pckbd_input(c06fa500,1) at _pckbd_input+0x4e
_pckbcintr(c06da580) at _pckbcintr+0xdb
_Xintr1() at _Xintr1+0x6c
--- interrupt ---
_idle(0,c01e50bc,c06d5714,0,cd5e8f94) at _idle+0x21
bpendtsleep(c04d6f98,28,c01e50b2,0) at bpendtsleep
_sched_sync(0) at _sched_sync+0x1e1
Bad frame pointer: 0xc0556ed8
End traceback...

dumping to dev 0,1 offset 396196
dump pciide0:0:0: bad state 1 in _wdc_ata_bio_start
panic: _wdc_ata_bio_start: bad state
Begin traceback...
__wdc_ata_bio_start(c031e7f7,c031e7c9,c06dc214,0,0) at __wdc_ata_bio_start+0x86
__wdc_ata_bio_start(c06dc2a0,c06ed000,c06dc2a0,c06ed000,c06dc2a0) at __wdc_ata_bio_start+0x86
_wdc_ata_bio_start(c06dc2a0,c06ed000,c06ed01c,c06dc2a0,cd5e87cc) at _wdc_ata_bio_start+0x5c
_wdcstart(c06dc2a0,c06e30bc,c06dc2e4,cd5e87e8,c031e710) at _wdcstart+0x90
_wdc_exec_xfer(c06dc2a0,c06ed000,c031df70,c06e3000,1) at _wdc_exec_xfer+0x8a
_wdc_ata_bio(c06dc2e4,c06e30bc,2,cd5e8980,c031dd90) at _wdc_ata_bio+0x78
_wddump(1,5115b8,cd5e8948,200,8081d) at _wddump+0x1a4
_cpu_dump(100,c01a9dcb,100,c01ba1c1,c01b9c37) at _cpu_dump+0x101
_dumpsys(0,cd5e8ba8,c01b9d52,100,0) at _dumpsys+0xed
_cpu_reboot(100,0,c070b018,10001,0) at _cpu_reboot+0x63
_panic(c01a9dcb,c070b000,c070b000,10,0) at _panic+0xfe
_lockmgr(c070b018,10001,c04d6880) at _lockmgr+0x64
_vfs_busy(c070b000,10,c04d6880) at _vfs_busy+0xa6
_sys_sync(c04ccc40,0,0,100,0) at _sys_sync+0x25
_vfs_shutdown(0,cd5e8c58,c018d4cf,100,0) at _vfs_shutdown+0x41
_cpu_reboot(100,0,cd5e8d00,c018cfd0,1) at _cpu_reboot+0x3b
_db_sync_cmd(1,0,c03e4945,cd5e8c88,1) at _db_sync_cmd+0xf
_db_command(c046c6d8,c046c4f8,c018d1d0) at _db_command+0x1ec
_db_command_loop(c02fe658) at _db_command_loop+0x82
_db_trap(1,0,1,e000ffce,c06fb00a) at _db_trap+0x100
_kdb_trap(1,0,cd5e8db8) at _kdb_trap+0xc0
_trap() at _trap+0x168
--- trap (number 1) ---
_cpu_Debugger(c06f9200,cd5e8e34,c03e7ce0,c06f9200,cd5e8e40) at _cpu_Debugger+0x4
_internal_command(c06f9200,cd5e8e40,f420,1,c04baffc) at _internal_command+0x150
_wskbd_translate(c04bacd8,2,1,c06fa500,c04baffc) at _wskbd_translate+0xd8
_wskbd_input(c06f9200,2,1,1,2) at _wskbd_input+0x53
_pckbd_input(c06fa500,1) at _pckbd_input+0x4e
_pckbcintr(c06da580) at _pckbcintr+0xdb
_Xintr1() at _Xintr1+0x6c
--- interrupt ---
_idle(0,c01e50bc,c06d5714,0,cd5e8f94) at _idle+0x21
bpendtsleep(c04d6f98,28,c01e50b2,0) at bpendtsleep
_sched_sync(0) at _sched_sync+0x1e1
Bad frame pointer: 0xc0556ed8
End traceback...

dumping to dev 0,1 offset 396196
dump device not ready


panic: wdc_exec_command: polled command not done

Begin traceback...
_wdc_exec_command(c0171a34,c06e3000,c031e7f7,cd5e86fc,cd5e86fc) at _wdc_exec_command+0xca
_wdc_exec_command(c06dc2e4,cd5e86dc) at _wdc_exec_command+0xca
_wd_flushcache(c06e3000,10,cd5e8718,c01b0161,c06e3000) at _wd_flushcache+0x4d
_wd_shutdown(c06e3000) at _wd_shutdown+0xd
_doshutdownhooks(0,cd5e8740,c01b9d52,104,0) at _doshutdownhooks+0x25
_cpu_reboot(104,0,c06e30bc,0,c06dc2a0) at _cpu_reboot+0x68
_panic(c031e7f7,c031e7c9,c06dc214,0,0) at _panic+0xfe
__wdc_ata_bio_start(c06dc2a0,c06ed000,c06dc2a0,c06ed000,c06dc2a0) at __wdc_ata_bio_start+0x86
_wdc_ata_bio_start(c06dc2a0,c06ed000,c06ed01c,c06dc2a0,cd5e87cc) at _wdc_ata_bio_start+0x5c
_wdcstart(c06dc2a0,c06e30bc,c06dc2e4,cd5e87e8,c031e710) at _wdcstart+0x90
_wdc_exec_xfer(c06dc2a0,c06ed000,c031df70,c06e3000,1) at _wdc_exec_xfer+0x8a
_wdc_ata_bio(c06dc2e4,c06e30bc,2,cd5e8980,c031dd90) at _wdc_ata_bio+0x78
_wddump(1,5115b8,cd5e8948,200,8081d) at _wddump+0x1a4
_cpu_dump(100,c01a9dcb,100,c01ba1c1,c01b9c37) at _cpu_dump+0x101
_dumpsys(0,cd5e8ba8,c01b9d52,100,0) at _dumpsys+0xed
_cpu_reboot(100,0,c070b018,10001,0) at _cpu_reboot+0x63
_panic(c01a9dcb,c070b000,c070b000,10,0) at _panic+0xfe
_lockmgr(c070b018,10001,c04d6880) at _lockmgr+0x64
_vfs_busy(c070b000,10,c04d6880) at _vfs_busy+0xa6
_sys_sync(c04ccc40,0,0,100,0) at _sys_sync+0x25
_vfs_shutdown(0,cd5e8c58,c018d4cf,100,0) at _vfs_shutdown+0x41
_cpu_reboot(100,0,cd5e8d00,c018cfd0,1) at _cpu_reboot+0x3b
_db_sync_cmd(1,0,c03e4945,cd5e8c88,1) at _db_sync_cmd+0xf
_db_command(c046c6d8,c046c4f8,c018d1d0) at _db_command+0x1ec
_db_command_loop(c02fe658) at _db_command_loop+0x82
_db_trap(1,0,1,e000ffce,c06fb00a) at _db_trap+0x100
_kdb_trap(1,0,cd5e8db8) at _kdb_trap+0xc0
_trap() at _trap+0x168
--- trap (number 1) ---
_cpu_Debugger(c06f9200,cd5e8e34,c03e7ce0,c06f9200,cd5e8e40) at _cpu_Debugger+0x4
_internal_command(c06f9200,cd5e8e40,f420,1,c04baffc) at _internal_command+0x150
_wskbd_translate(c04bacd8,2,1,c06fa500,c04baffc) at _wskbd_translate+0xd8
_wskbd_input(c06f9200,2,1,1,2) at _wskbd_input+0x53
_pckbd_input(c06fa500,1) at _pckbd_input+0x4e
_pckbcintr(c06da580) at _pckbcintr+0xdb
_Xintr1() at _Xintr1+0x6c
--- interrupt ---
_idle(0,c01e50bc,c06d5714,0,cd5e8f94) at _idle+0x21
bpendtsleep(c04d6f98,28,c01e50b2,0) at bpendtsleep
_sched_sync(0) at _sched_sync+0x1e1
Bad frame pointer: 0xc0556ed8
End traceback...

dumping to dev 0,1 offset 396196
dump device not ready


rebooting...