On Sat, Jul 31, 2010 at 05:20:19PM +0100, Richard W.M. Jones wrote:
This is a slightly unsatisfactory patch which allows coredumps to be
captured when they occur inside the appliance. You can capture
coredumps by doing:
export LIBGUESTFS_COREDUMP=/sysroot/core.%t.%p.%e
or equivalently:
g.set_coredump ("/sysroot/core.%t.%p.%e")
or variations thereof, see the manual page.
Actually it strikes me that this API is wrong. It should be
something like:
set-coredump-file eg. set-coredump-file /core.%t.%p.%e
- Coredump to a mounted guest filesystem. This would add the
/sysroot/ prefix automatically. The %-patterns would be
some limited subset of what the kernel supports.
set-coredump-device eg. set-coredump-device /dev/sdb
- Coredump to a capture device. This would be implemented at
first using a coredump-to-pipe, but we could later change
the implemention to coredump directly to a device if we got
a patch into the kernel to support it.
clear-coredump
- Clear the coredump file/device. Equivalent to setting it to
NULL right now.
This interface is more extensible and future-proof. We can extend it
by adding more set-coredump-* methods. It's future-proof because it
doesn't depend so closely on the current kernel implementation.
The environment variable would have to be changed as well.
- - - -
The ideal future enhancement would be to get a stack trace without
needing the coredump + gdb step.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw