ktrace and KTR_DROP
Marc Olzheim
marcolz at stack.nl
Fri Jul 1 14:53:38 GMT 2005
On Fri, Jul 01, 2005 at 04:40:21PM +0200, Marc Olzheim wrote:
> On Fri, Jul 01, 2005 at 01:21:04PM +0000, Peter Edwards wrote:
> > The following patch is making my debugging a much more productive
> > experience.
>
> login: panic: ktrace: no trace vnode
> cpuid = 1
> KDB: stack backtrace:
> kdb_backtrace(100,c6c0b000,c65e08d4,c5d4ae80,c6c0b000) at 0xc053efa9 = kdb_backtrace+0x29
> panic(c06bec25,8,2,c717e180,ec519cd8) at 0xc0529174 = panic+0x114
> ktr_getrequest(1,0,c6c0b000,c65e08d4,ec519d30) at 0xc051aa7b = ktr_getrequest+0xf3
> ktrsyscall(bd,2,ec519d04) at 0xc051ad7f = ktrsyscall+0x3b
> syscall(2f,2f,2f,280ee000,0) at 0xc0680329 = syscall+0x155
> Xint0x80_syscall() at 0xc066fcff = Xint0x80_syscall+0x1f
> --- syscall (189, FreeBSD ELF32, fstat), eip = 0x280cea23, esp = 0xbfbfe9f0, ebp = 0xbfbfea8c ---
> boot() called on cpu#0
> Uptime: 17m39s
> Dumping 3967 MB
> 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 256 272 288 304 320 336 352 368 384 400 416 432 448 464 480 496 512 528 544 560 576 592 608 624 640 656 672 688 704 720 736 752 768 784 800 816 832 848 864 880 896 912 928 944 960 976 992 1008 1024 1040 1056 1072 1088 1104 1120 1136 1152 1168 1184 1200 1216 ...
This was with the sysctl set to 1 of course.
(kgdb) fra 3
#3 0xc051aa7b in ktr_getrequest (type=1)
at /usr/src/sys/kern/kern_ktrace.c:249
249 KASSERT(p->p_tracevp != NULL, ("ktrace: no trace vnode"));
(kgdb) l
244 req->ktr_header.ktr_type = type;
245 if (p->p_traceflag & KTRFAC_DROP) {
246 req->ktr_header.ktr_type |= KTR_DROP;
247 p->p_traceflag &= ~KTRFAC_DROP;
248 }
249 KASSERT(p->p_tracevp != NULL, ("ktrace: no trace vnode"));
250 KASSERT(p->p_tracecred != NULL, ("ktrace: no trace cred"));
251 req->ktr_vp = p->p_tracevp;
252 VREF(p->p_tracevp);
253 req->ktr_cred = crhold(p->p_tracecred);
(kgdb) info locals
req = (struct ktr_request *) 0xc5d4ae80
td = (struct thread *) 0xc6c0b000
p = (struct proc *) 0xc65e08d4
pm = -966915884
(kgdb) info registers
eax 0x0 0
ecx 0x0 0
edx 0x0 0
ebx 0xc65e08d4 -966915884
esp 0xec519cb0 0xec519cb0
ebp 0xec519cc0 0xec519cc0
esi 0xc5d4ae80 -975917440
edi 0xc6c0b000 -960450560
eip 0xc051aa7b 0xc051aa7b
eflags 0x0 0
cs 0x0 0
ss 0x0 0
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
(kgdb) p *p
$1 = {p_list = {le_next = 0xc728f710, le_prev = 0xc6bcc1c4}, p_ksegrps = {
tqh_first = 0xc5fc3e00, tqh_last = 0xc5fc3e04}, p_threads = {
tqh_first = 0xc6c0b000, tqh_last = 0xc6c0b008}, p_suspended = {
tqh_first = 0x0, tqh_last = 0xc65e08ec}, p_ucred = 0xc6354e80,
p_fd = 0xc6ebbb00, p_fdtol = 0x0, p_stats = 0xc65d9000,
p_limit = 0xc5d0d000, p_unused1 = 0x0, p_sigacts = 0xc6bfb000,
p_flag = 16386, p_sflag = 1, p_state = PRS_NORMAL, p_pid = 5780, p_hash = {
le_next = 0x0, le_prev = 0xc563aa50}, p_pglist = {le_next = 0xc7240388,
le_prev = 0xc65fa3dc}, p_pptr = 0xc65fa388, p_sibling = {le_next = 0x0,
le_prev = 0xc65fa3f0}, p_children = {lh_first = 0x0}, p_mtx = {
mtx_object = {lo_class = 0xc06fca7c, lo_name = 0xc06c0315 "process lock",
lo_type = 0xc06c0315 "process lock", lo_flags = 4390912, lo_list = {
tqe_next = 0x0, tqe_prev = 0x0}, lo_witness = 0x0}, mtx_lock = 4,
mtx_recurse = 0}, p_oppid = 0, p_vmspace = 0xc6a46a8c, p_swtime = 20,
p_realtimer = {it_interval = {tv_sec = 0, tv_usec = 0}, it_value = {
tv_sec = 0, tv_usec = 0}}, p_runtime = {sec = 0,
frac = 12428108932415044484}, p_uu = 0, p_su = 0, p_iu = 0, p_uticks = 0,
p_sticks = 40187, p_iticks = 0, p_profthreads = 0, p_maxthrwaits = 0,
p_traceflag = 0, p_tracevp = 0x0, p_tracecred = 0x0, p_textvp = 0xc69e6b58,
p_siglist = {__bits = {0, 0, 0, 0}}, p_lock = 0 '\0', p_sigiolst = {
slh_first = 0x0}, p_sigparent = 20, p_sig = 0, p_code = 0, p_stops = 0,
p_stype = 0, p_step = 0 '\0', p_pfsflags = 0 '\0', p_nlminfo = 0x0,
p_aioinfo = 0x0, p_singlethread = 0x0, p_suspcount = 0, p_xthread = 0x0,
p_boundary_count = 0, p_magic = 3203398350,
p_comm = "patgen", '\0' <repeats 13 times>, p_pgrp = 0xc7658200,
p_sysent = 0xc07153c0, p_args = 0xc711eb80,
p_cpulimit = 9223372036854775807, p_nice = 0 '\0', p_xstat = 0, p_klist = {
kl_lock = 0xc65e0940, kl_list = {slh_first = 0x0}}, p_numthreads = 1,
p_numksegrps = 1, p_md = {md_ldt = 0x0}, p_itcallout = {c_links = {sle = {
sle_next = 0x0}, tqe = {tqe_next = 0x0, tqe_prev = 0x0}}, c_time = 0,
c_arg = 0x0, c_func = 0, c_flags = 8}, p_unused2 = 0x0, p_acflag = 0,
p_ru = 0x0, p_peers = 0x0, p_leader = 0xc65e08d4, p_emuldata = 0x0,
p_label = 0x0, p_sched = 0xc65e0a98}
(kgdb)
If you need any more info, just ask.
Marc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20050701/0281cb3e/attachment.bin
More information about the freebsd-arch
mailing list