NetBSD-Bugs archive

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

kern/41788: gdbscripts/lwps does not work correctly



>Number:         41788
>Category:       kern
>Synopsis:       gdbscripts/lwps does not work correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 26 20:10:01 +0000 2009
>Originator:     Mikolaj Golub
>Release:        CURRENT
>Organization:
>Environment:
NetBSD  5.99.15 NetBSD 5.99.15 (XEN3_DOMU) #0: Sun Jul 26 12:08:10 GMT 2009  
golub%ukbuild.datech.ltd.uk@localhost:/home/golub/nbsd/obj/sys/arch/amd64/compile/XEN3_DOMU
 amd64

>Description:
gdbscripts/lwps when traversing process' LWPs uses l_list while it should use 
l_sibling (proc's list of LWPs). As a result the output is wrong.

I use current but suppose 5.0 is affected too.
>How-To-Repeat:
Run lwps script in gdb and observe e.g. repeating lid == 1 for system process 
(pid == 0)

$ sudo gdb /netbsd.gdb 
(gdb) target kvm 
(gdb) source ~/nbsd/src/sys/gdbscripts/lwps 
(gdb) lwps 
             lwp   pid   lid     flag            wchan
... [skipped] ...
ffffa0003de45800     0    34      204 ffffa0003ddaff18 (nfsiod)
ffffa0003de45c00     0    33      204 ffffa0003ddafeb8 (nfsiod)
ffffa0003de40000     0    32      204 ffffa0003ddafe58 (nfsiod)
ffffa0003de40400     0    31      204 ffffa0003ddafdf8 (nfsiod)
ffffa0003dd8a000     0     1       84 ffffa0003dd9e8c8 (wait)
ffffa0003dd8a400     0     1       84 ffffa0003c990850 (select)
ffffa0003dd8ac00     0     1       84 ffffa000018645e0 (netio)
ffffa0003d98c800     0     1       84 ffffa0003d98c800 (nanoslp)
ffffa0003d98c000     0     1       84 ffffa0003d98c000 (nanoslp)
ffffa0003437dc00     0     1       84 ffffa0003437dc00 (nanoslp)
ffffa0003437d800     0     1       84 ffffa0003cd61588 (ttyraw)
ffffa0003437f000     0     1       84 ffffa0003437f000 (nanoslp)
ffffa0003dd8a800     0     1       84 ffffa0003cc9a4f8 (kqueue)
ffffa0003d98c400     0     1       84 ffffa0003c990850 (select)
ffffa0003437f400     0     1       84 ffffa0003cc9a478 (kqueue)
ffffa0003d98cc00     0    30      204 ffffa0003cc9a3e0 (physiod)
ffffa0003437d400     0    29      204 ffffa0003cc9a360 (vmem_rehash)
ffffa0003437d000     0    28      204 ffffa0003cc9a2e0 (aiodoned)
ffffa0003437ec00     0    27      204 ffffffff805c99e0 (syncer)
ffffa0003437e800     0    26      204 ffffffff80642a0c (pgdaemon)
ffffa00034375000     0    25      204 ffffffff805daff0 (crypto_wait)
ffffa0003437e400     0     1       84 ffffa0003d7a1b90 (wait)
ffffa0003437e000     0    24      204 ffffffff805caec0 (unpgc)
ffffa0003437f800     0    23      204 ffffffff80645490 (rdst)
ffffa0003437fc00     0    22      204 ffffffff80591450 (evtsq)

>Fix:
Index: lwps
===================================================================
RCS file: /cvsroot/src/sys/gdbscripts/lwps,v
retrieving revision 1.1
diff -u -r1.1 lwps
--- lwps        20 Feb 2008 20:56:35 -0000      1.1
+++ lwps        26 Jul 2009 19:43:11 -0000
@@ -19,7 +19,7 @@
                                if ($l->l_wmesg)
                                        printf " (%s)", (char *)$l->l_wmesg
                                end
-                               set $l = $l->l_list.le_next
+                               set $l = $l->l_sibling.le_next
                                printf "\n"
                                set $j++
                        end



Home | Main Index | Thread Index | Old Index