Core file not created on SIGQUIT

Bug #1153662 reported by Graeme Hewson on 2013-03-11
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Undecided
Unassigned

Bug Description

If apport "ignores" a signal and doesn't create a report in /var/crash, it still creates a core file in the current directory if the user has set the ulimit/rlimit size for core files to greater than the default of 0. However, it doesn't do this for SIGQUIT.

The attached patch fixes this. It also fixes a bug where the core limit was erroneously being multiplied by 1024 (the limit passed to write_user_coredump() is in bytes, not KB).

Related branches

Graeme Hewson (ghewson) wrote :
Martin Pitt (pitti) wrote :
affects: apport → apport (Ubuntu)
Changed in apport (Ubuntu):
status: New → Fix Committed
Martin Pitt (pitti) wrote :

We do need to multiply the kernel's ulimit (which is in blocks) by 1024, but indeed the old place was bad as it contradicted the comments. I moved it in http://bazaar.launchpad.net/~apport-hackers/apport/trunk/revision/2610 . Thanks!

The attachment "apport.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Graeme Hewson (ghewson) wrote :

The specified core limit ends up getting multiplied by 1024*1024, though. Testing with your patch applied, ulimit 10 should be small enough to prevent this core file being written, but it is written:

$ shopt -o posix
posix off
$ ulimit -c 10
$ sleep 99
^\Quit (core dumped)
$ ls -l core; rm core
-rw-r----- 1 ghewson ghewson 372736 Mar 14 18:06 core
$ cat /var/log/apport.log
ERROR: apport (pid 10975) Thu Mar 14 18:06:05 2013: called for pid 10972, signal 3, core limit 10240
ERROR: apport (pid 10975) Thu Mar 14 18:06:05 2013: writing core dump to /tmp/core (limit: 10485760)

---

10485760 = 10 * 1024 * 1024

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.9.2-0ubuntu1

---------------
apport (2.9.2-0ubuntu1) raring; urgency=low

  * New upstream release:
    - report.py, add_package_info(): Add "[origin: unknown]" tag to
      Package/Dependencies fields for non-distro package whose origin cannot
      be determined. (LP: #1148116)
    - Adjust kernel_crashdump to the format kdump-tools produces. Thanks Louis
      Bouchard.
    - Write core dumps on SIGQUIT if ulimit allows. Thanks Graeme Hewson.
      (LP: #1153662)
  * debian/apport.upstart: Also check for kdump-tools-style kernel crash
    reports for calling kernel_crashdump. Thanks Louis Bouchard.
 -- Martin Pitt <email address hidden> Tue, 19 Mar 2013 11:48:27 +0100

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

Other bug subscribers