Glitch with textdump/ddb

Shrikanth Kamath shrikanth07 at gmail.com
Wed Mar 4 09:06:18 UTC 2015


I observed this with FreeBSD 10.1-RELEASE #0 running in VMware fusion,
the boolean 'text dump' supplied to the function 'doadump' is some
random value off the stack and not necessarily TRUE or FALSE.
I am enabling a ddb script via the ddb utility, where my ddb script is
ddb script kdb.enter.panic="textdump set; capture on; show pcpu; ps;
call doadump"

As per the man page to text dump, one is supposed to "call doadump" to
trigger a text dump/minidump.
So triggering panic via sysctl debug.kdb.panic=1, captures what is
asked for in the above script. But if you observe the value of 'text
dump' boolean in this snippet in kern_shutdown.c it is some random
value and not the boolean TRUE or FALSE.

int
doadump(boolean_t textdump)
{
...
#ifdef DDB
       if (textdump && textdump_pending) {
                coredump = FALSE;
                textdump_dumpsys(&dumper);
        }
#endif
...
}


But if I change the script to
ddb script kdb.enter.panic="textdump set; capture on; show pcpu; ps;
call doadump(1)"

The value supplied to call doadump when the machine enters debugger
on panic is now set to '1'.

Should this be the right way to capture information when using text
dumps? I guess the man page for textdump specifies just "call
doadump". The problem may not manifest as long the random value picked
off the stack is non zero.

--
Shrikanth R K


More information about the freebsd-hackers mailing list