Debugging the ZDB debugger.

K. Macy kmacy at freebsd.org
Fri Nov 21 01:55:39 UTC 2014


On Thu, Nov 20, 2014 at 5:50 PM, Zaphod Beeblebrox <zbeeble at gmail.com> wrote:
> So ... I have several zfs filesystems with errors that may or may not be
> real.  I've talked about this in the mailing lists before, and I was
> endeavoring to chase this all down with zdb ... to see what was real.
>
> zdb -dd vr2/tmp      <--- works
>
> zdb -ddd vr2/tmp     <--- crashes
>
> zdb -dddd vr2/tmp     <--- also crashes.
>



> When I run "gdb -c zdb.core zdb" I get a whole bunch of:
>
> [New Thread 803406c00 (LWP 101333/zdb)]
> [New Thread 803406800 (LWP 101332/zdb)]
> [New Thread 803406400 (LWP 100598/zdb)]
>
> (probably 30 or so) and then:
>
> (gdb) bt
> #0  0x00000000004098a9 in ?? ()
> #1  0x0000000000406222 in ?? ()
> #2  0x000000000040528f in ?? ()
> #3  0x0000000800632000 in ?? ()
> #4  0x0000000000000000 in ?? ()


Executables typically get stripped on install. Try the one in your
build directory:


Breakpoint 5, dump_uint8 (os=0x8069ae800, object=8, data=0x0, size=0)
    at /usr/home/kmacy/devel/freebsd-vm-merge/cddl/usr.sbin/zdb/../../../cddl/contrib/opensolaris/cmd/zdb/zdb.c:384
384     }
(gdb) bt
#0  dump_uint8 (os=0x8069ae800, object=8, data=0x0, size=0)
    at /usr/home/kmacy/devel/freebsd-vm-merge/cddl/usr.sbin/zdb/../../../cddl/contrib/opensolaris/cmd/zdb/zdb.c:384
#1  0x000000000040c81f in dump_object (os=0x8069ae800, object=8,
verbosity=6, print_header=0x7fffffe57814)
    at /usr/home/kmacy/devel/freebsd-vm-merge/cddl/usr.sbin/zdb/../../../cddl/contrib/opensolaris/cmd/zdb/zdb.c:1838
#2  0x000000000040a169 in dump_dir (os=0x8069ae800)
    at /usr/home/kmacy/devel/freebsd-vm-merge/cddl/usr.sbin/zdb/../../../cddl/contrib/opensolaris/cmd/zdb/zdb.c:1965
#3  0x0000000000407186 in main (argc=0, argv=<value optimized out>)
    at /usr/home/kmacy/devel/freebsd-vm-merge/cddl/usr.sbin/zdb/../../../cddl/contrib/opensolaris/cmd/zdb/zdb.c:3700
(gdb)

> Seeing this, I went to the /usr/src/cddl/usr.sbin/zdb directory and tried
> recompiling ... but it already puts -g in there --- so ...
>
> What do I need to do to debug the debugger?
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"


More information about the freebsd-hackers mailing list