diagnosing freezes (DRI?)

Mikolaj Golub to.my.trociny at gmail.com
Sat Apr 11 13:38:32 UTC 2009


On Sat, 11 Apr 2009 11:15:59 +0100 xorquewasp at googlemail.com wrote:

 x> On 2009-04-11 02:30:40, Paul B. Mahol wrote:
 >> 
 >> If it locks under X11 then use debug.debugger_on_panic=0 sysctl.
 >> Not doing this will increase drasticaly chances of locking whole system
 >> and not providing any debug data.

 x> I don't seem to have that sysctl.

You will see this sysctl only if you build your kernel with ddb(4) support.

If you are interested in providing useful information about your freezes,
please read the following:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug.html

You need to build your kernel with options described in

http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug-online-ddb.html

and 

http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug-deadlocks.html

As you run X, you need to have debug.debugger_on_panic=0 set (as Paul has
suggested). Otherwise ddb would enter on panic but you wouldn't be able to
access it due to X. After panic you will be able to get useful information
from generated core dump using kgdb.

Another option is to set debug.debugger_on_panic=1 but also set some ddb
script that will run when the kernel debugger is entered as a result of a
panic. This script will enable output capture, dump some useful debugging info
to capture buffer, and then force a kernel dump to be written out followed by
a reboot. E.g. running something like this will do the trick:

ddb script 'kdb.enter.panic=capture on; show pcpu; show allpcpu; bt; ps; show locks; show alllocks; show lockedvnods; alltrace; call doadump; reset'

After reboot you can extract captured information from the capture buffer
information using the command:

ddb capture -M /var/crash/vmcore.X print > ddb.out

You need to increase the value of debug.ddb.capture.bufsize sysctl variable to
make sure all ddb output will be captured.

You can read more about this in ddb(4), ddb(8), textdump(4).

-- 
Mikolaj Golub


More information about the freebsd-hackers mailing list