Generate core dumps for packaged programs as well

Bug #92029 reported by Kevin Christopher
4
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
High
Martin Pitt

Bug Description

Binary package hint: apport

apport drops cores generated by SIGABRT entirely - the core is not preserved.

The comment in the code - that SIGABRT might not capture some pieces of information - is not sufficient to justify dropping the ENTIRE core.

Significant app that uses SIGABRT and expects cores: any VMware product, which fork then send themselves a SIGABRT to generate a core.

Other behaviors would be nice but are doable via package-hooks; problem is, apport drops the core before it even makes it that far.

Here's an (untested) patch that describes the minimum change that needs to happen (yes, for Feisty):

--- bin/apport.bak 2007-03-13 13:36:46.000000000 -0700
+++ bin/apport 2007-03-13 13:37:37.000000000 -0700
@@ -211,10 +211,10 @@
     if coredump and coredump != '-' and os.environ.get('REMOVE_CORE', False):
         atexit.register(cleanup, coredump)

- # ignore SIGQUIT (it's usually deliberately generated by users) and SIGABRT- # (we currently have no way of extracting abort() messages or mono's stderr- # for stack traces).
- if signum == str(signal.SIGQUIT) or signum == str(signal.SIGABRT):
+ # ignore SIGQUIT (it's usually deliberately generated by users).
+ # For SIGABRT, we currently have no way of extracting abort()
+ # messages or mono's stderr for stack traces.
+ if signum == str(signal.SIGQUIT):
         sys.exit(0)

     error_log('called for pid %s, signal %s' % (pid, signum))

Revision history for this message
Martin Pitt (pitti) wrote :

For packaged programs, feisty's apport does not *ever* save core dumps, because /proc/sys/kernel/core_pattern now points to a pipe instead of a file.

Apport does generate core files for unpackaged programs if ulimits permit. I'll move the check for SIGABRT down after the core file creation, so that SIGABRT will generate cores for those programs.

Changed in apport:
assignee: nobody → pitti
importance: Undecided → Low
status: Unconfirmed → In Progress
Martin Pitt (pitti)
Changed in apport:
status: In Progress → Fix Committed
Revision history for this message
Kevin Christopher (kevinc) wrote :

Apologies for not distinguishing between cores and crash reports with embedded cores.

Let me step back. If a process dies with SIGABRT, I'm looking for either (1) the core file in a well-known location or (2) apport invoking a package-hook and we can get at the core through that. As I understand, your patch enables (1); to get (2), we need both this patch and to install via a package that provides a package-hook. Will your patch also allow SIGABRT-generated reports to reach (2)? (VMware is at (1) now, but would like to reach (2)).

From apport sources, it looks like (1) would be CWD/core or CWD/core.PID (depending on the core_uses_pid setting).

Revision history for this message
Martin Pitt (pitti) wrote :

 apport (0.67) feisty; urgency=low
 .
   * debian/local/setup-apport-retracer: Add apt sources for restricted,
     universe, and multiverse, too.
   * po/de.po: Update from Rosetta.
   * apport/report.py: Remove undefined call to error_log() in
     _command_output(), replace it with raising proper exceptions.
   * bin/apport-retrace: Fix 'numer' typo. (LP: #91680)
   * test-apport: Check that non-packaged executables generate a core dump on
     SIGABRT, too (test case for bug #92029).
   * bin/apport: Move check for ignoring SIGABRT below the core dump file
     writing for non-packaged binaries. (LP: #92029)
   * gtk/apport-gtk.glade:
     - Remove titles from the progress windows to comply with Gnome HIG and not
       repeat the text content.
     - Improve wording a bit.
     - LP: #92114
   * gtk/apport-gtk{,.glade}: Fix signal handler name of the Cancel button in
     the upload progress dialog, so that it actually works. (LP: #92115)

Changed in apport:
status: Fix Committed → Fix Released
Revision history for this message
Kevin Christopher (kevinc) wrote :

Thanks for fixing the initial drop.

I see the 0.67 sources. Sufficient for non-packaged installation. But, when shipped as a packaged .deb, a SIGABRT core will be dropped unconditionally, without having a chance to reach any error-reporting tool. (Oddly enough, this is an incentive to NOT package...).

Is there a reason to drop SIGABRT reports even from packaged installations? Should such a reason be package-specific? (Or is more work in progress? :-) )

Revision history for this message
Martin Pitt (pitti) wrote :

> Will your patch also allow SIGABRT-generated reports to reach (2)?

Not according to my initial intentions, due to the principle of /proc/sys/kernel/core_pattern. (Also, VMWare works fine for me without throwing core dumps around, FWIW).

However, thinking about it again apport *could* write core dumps for packaged programs as well if ulimits permit. Since we default to ulimit -c 0, this would not change the default behaviour, and it would make the behaviour more consistent as well.

> Is there a reason to drop SIGABRT reports even from packaged installations? Should such a reason be package-specific? (Or is more work in progress? :-) )

The primary reason is that SIGABRT is mainly used on assertion failures in C and Mono. Since we currently do not have a possibility to get the assertion message, crash reports are useless. Our Gnome and Mono maintainers thus asked me to ignore ABRT in apport. There are, however, ideas how to get assertion messages, and there is a spec for Mono (https://wiki.ubuntu.com/ApportMonoCrashes).

Revision history for this message
Martin Pitt (pitti) wrote :

Reopening for this idea.

Changed in apport:
status: Fix Released → In Progress
Revision history for this message
Kevin Christopher (kevinc) wrote :

Allowing cores for packaged programs if ulimit permits is sufficient for our needs.

We actually adjust ulimit early in the process because we want customers to optionally submit cores for debugging. (Glad to hear VMware software doesn't dump core for you ;-) - I wish our betas were that robust!).

>The primary reason is that SIGABRT is mainly used on assertion failures in C and Mono.

Sounds like a package-specific suppression override later in the process - like 87430. Fine that they don't want cores - but it becomes problematic if that blocks our cores.

Thanks for the Mono link - I'm learning interesting new ways to hook apport!

And many thanks for the quick communication!

Martin Pitt (pitti)
Changed in apport:
importance: Low → High
Martin Pitt (pitti)
Changed in apport:
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

 apport (0.69) feisty; urgency=low
 .
   * apport-chroot: Add command 'installdeb' to conveniently install a bunch of
     .debs into a chroot.
   * apport-chroot: Fix 'login' and 'upgrade' commands to not require
     specifying a chroot map when giving a chroot tarball path as argument.
   * test-apport: Check that core dumps are written for packaged programs as
     well, if ulimits want them. (Test for #92029)
   * bin/apport: Call write_user_coredump() for packaged program crashes and
     SIGABRT as well. (LP: #92029)

Changed in apport:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.