Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Mar 2015 01:06:17 -0800
From:      Shrikanth Kamath <shrikanth07@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Glitch with textdump/ddb
Message-ID:  <CAEOAkMWZ-i1OWEQzX2H%2BNMkCFwGOdehRR65v2HHi-jXQrYyPrA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEOAkMWZ-i1OWEQzX2H%2BNMkCFwGOdehRR65v2HHi-jXQrYyPrA>