apport for perl. (automated problem reporting for perl programs)

Robert Collins robertc at robertcollins.net
Thu Dec 7 22:52:35 GMT 2006


For those not aware of the automated crash reporting mechanism, this is
something first introduced in edgy, and being improved in feisty. In
edgy, when a packaged binary crashes - SEGSIGV etc - a kernel hook calls
back into user space, and we write a crashdump file to /var/crash/,
which has the command line, open files, a mini-coredump and so on. A UI
program watches that directory, and we notify the user that a program
crash has occured, and give them some assistance to file a bug in
launchpad. The bugreport, because it has exact package versions and the
coredump is able to be analysed in great detail by developers, which
makes fixing the root cause much easier.

In Feisty, we've already(*) setup a hook such that python programs
*also* have an analogous behaviour occur - when an unhandled exception
hits the top of a thread, a crashdump file is created. This enabled
better analysis of faults in python programs - just by having this
enabled on my laptop, I've gotten great results - I've caught bugs in
unattended-upgrades(which runs from cron!), update-manager, apport-gui,
and the hwdb-gui.

The key thing here is to grab the backtrace within the VM based language
from within the language, when the VM is still active. We have a number
of languages that simply watching for SEGSIGV's is not enough:
 lisp
 perl
 ruby
 java
 shell
 ...

And for any of these, if we can implement a crash-dumping tweak to it
such that we generate these *by default* for all programs on Ubuntu, we
will increase the quality of bug reports.

I think the approach we used for python is quite tasteful: in site.py we
hook into the *default* top level exception handler. This is tasteful
because there is no extremely minimal execution overhead for python
scripts - theres no extra execution, and we're not wrapping the program
logic or doing other such things.

I recently had the chance to talk with a couple of serious perl-heads
(Adam Kennedy and Kirrily Robert) about implementing a perl hook to let
perl programs that die or croak generate crash dumps in /var/crash/.

I was advised that we should run our plans past the perl-5-porters list,
so that the perl community is pre-warned about what changes we're
planning to make - unlike python the features we need to do this do not
appear to exist today and we may need to carry a patch to the VM to
enable the hooking mechanism...

    There is no site.pl today, nor is there a place to install
    a default exception handler.

So, I'm hoping that this problem sounds interesting enough that someone
here who is perl fluent will take up the baton of 'apport for perl', and
drive this forward.

Also, if you are an afficiondo of another language which is not
currently able to be hooked like we hooked python, or which is able to
be hooked, but we dont hook today, please do step up and help get that
language apport enabled. Martin Pitt is the primary developer of apport,
and I'm very interested in apport as a mechanism to get better bug
reports - I'm sure either of us will happily give advice on howto
integrate $Language most effectively with apport.

Cheers,
Rob

(*) I think the python upload to finally enable this is still
pending :(. Patch is in
https://launchpad.net/distros/ubuntu/+source/python2.4/+bug/70957, just
apply the patch to site.py to /usr/lib/python2.4/site.py to enable it by
hand :).

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20061208/1a1d0958/attachment.pgp 


More information about the ubuntu-devel mailing list