core dump file empty inside container

Bug #1982555 reported by Benjamin Drung
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Apport
Fix Released
Medium
Unassigned
apport (Ubuntu)
Fix Released
Medium
Unassigned
Bionic
New
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

Apport will write an empty core dump file inside of containers.

[Test plan]

Run following testcase script inside a LXC container:

```
rm -f /var/lib/apport/coredump/*
ulimit -c 1000000
sleep 86400 &
killall -3 sleep
```

Apport will write a core dump into /var/lib/apport/coredump, but this core dump is empty:

```
$ stat /var/lib/apport/coredump/core._usr_bin_sleep.*
  File: /var/lib/apport/coredump/core._usr_bin_sleep.0.44f483a1-e487-44b3-88d1-805d1026f31d.9059.34839819
  Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd00h/64768d Inode: 120848663 Links: 1
Access: (0400/-r--------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2022-07-22 07:54:48.838682067 +0000
Modify: 2022-07-22 07:54:48.838682067 +0000
Change: 2022-07-22 07:54:48.838682067 +0000
 Birth: 2022-07-22 07:54:48.838682067 +0000
```

This file should not be empty.

[Where problems could occur]

The apport binary is called by the kernel when a process crashes. Worst case scenarios include breaking the apport binary and no problem report is generated any more (or apport uses too much resources). Users will see problems reports inside the container which cause additional load or disk usage. The fix is accompanied by a test case.

[Other Info]

The autopkgtest for armhf are run inside a LXC container and the test case test_core_dump_packaged_sigquit triggers this bug.

Due to the huge amount of broken autopkgtest tests, the diff for the SRUs are bigger than desired. The individual commits in https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/apport/ are probably easier to review.

* jammy SRU: https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/apport/log/?h=1fa042cc27714c407494b3d6dfd0730bb984f3eb
* focal SRU: https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/apport/log/?h=eaa92037c7dfba621719c6f81fd75f6a09e90881

Benjamin Drung (bdrung)
Changed in apport:
importance: Undecided → Medium
status: New → Triaged
Changed in apport (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Benjamin Drung (bdrung) wrote :
Changed in apport:
milestone: none → 2.23.0
status: Triaged → Fix Committed
Revision history for this message
Benjamin Drung (bdrung) wrote :

Since the SRUs for jammy and focal included several fixes, I put my comment in this bug report only (which is the one with the highest bug number).

For the SRU I cherry-picked the important fixes from apport 2.21.0 and 2.22.0 and all needed commits to make the autopkgtest succeed on all architectures. This results in 84 commits for jammy and 74 commits for focal. You can see the individual commits in https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/apport/log/?h=ubuntu/jammy and https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/apport/log/?h=ubuntu/focal

Attached are debdiffs which excludes the changes to the test directory.

I verified that autopkgtest succeeds on all architectures with apport 2.20.11-0ubuntu82.2ppa8 and 2.20.11-0ubuntu27.25~ppa1 in https://launchpad.net/~bdrung/+archive/ubuntu/ppa (the version numbers differ, but the package content is identical to what is uploaded as SRU).

Revision history for this message
Benjamin Drung (bdrung) wrote :
tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apport (Ubuntu Focal):
status: New → Confirmed
Changed in apport (Ubuntu Jammy):
status: New → Confirmed
Revision history for this message
Benjamin Drung (bdrung) wrote :

Re-uploaded the SRUs to mention bug #1964828 in debian/changelog.

Revision history for this message
Benjamin Drung (bdrung) wrote :
Revision history for this message
Benjamin Drung (bdrung) wrote :
Benjamin Drung (bdrung)
Changed in apport:
status: Fix Committed → Fix Released
Benjamin Drung (bdrung)
description: updated
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
apport (2.23.0-0ubuntu1) kinetic; urgency=medium

  * New upstream release:
    - apport-gtk:
      - Gracefully handle import failure of gi (LP: #1980561)
      - Catch AssertionError when importing Gdk (LP: #1980238)
    - data/apport:
      - Fix PermissionError for setuid programs inside container (LP: #1982487)
      - Fix reading from stdin inside containers (LP: #1982555)
    - apport-kde:
      - Fix inverse order of choices (LP: #1967965)
      - Import apport before usage (LP: #1980553)
      - Drop old workaround for bug in SIP destructor (LP: #1980553)
    - apport-unpack: Fix ValueError: ['separator'] has no binary content
      (LP: #1889443)
    - Fix _run_hook getting called with ui=None (LP: #1983481)
  * Refresh patches and drop backported patches
  * Fix pydocstyle and pylint complains in patches

 -- Benjamin Drung <email address hidden> Mon, 22 Aug 2022 22:31:55 +0200

Changed in apport (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Proposed package upload rejected

An upload of apport to jammy-proposed has been rejected from the upload queue for the following reason: "contains bugfixes without bug references or test cases, does not meet SRU policy".

Benjamin Drung (bdrung)
description: updated
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Benjamin, or anyone else affected,

Accepted apport into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apport/2.20.11-0ubuntu82.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in apport (Ubuntu Jammy):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Benjamin, or anyone else affected,

Accepted apport into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apport/2.20.11-0ubuntu27.25 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in apport (Ubuntu Focal):
status: Confirmed → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Benjamin Drung (bdrung) wrote :

I ran the test case in a jammy LXC container (on jammy host) and /var/lib/apport/coredump/core._usr_bin_sleep.* was created correctly.

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Benjamin Drung (bdrung) wrote :

I ran the test case in a focal LXC container (on jammy host) and /var/lib/apport/coredump/core._usr_bin_sleep.* was created correctly.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for apport has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.20.11-0ubuntu27.25

---------------
apport (2.20.11-0ubuntu27.25) focal; urgency=medium

  * Point Vcs-* URIs to git
  * whoopsie-upload-all: Catch FileNotFoundError during process_report
    (LP: #1867204)
  * Grab a slice of JournalErrors around the crash time (LP: #1962454)
  * data/apport:
    - Initialize error log as first step (LP: #1989467)
    - Fix PermissionError for setuid programs inside container (LP: #1982487)
    - Fix reading from stdin inside containers (LP: #1982555)
  * Fix autopkgtest test case failures (LP: #1989467):
    - Mark autopkgtest with isolation-container restriction
    - Fix failure if kernel module isofs is not installed
    - Do not check recommended dependencies
    - Skip UI test if kernel thread is not found
    - Fix race in test_crash_system_slice
    - Fix check for not running test executable
    - Use shadow in *_different_binary_source
    - Mock kernel package version in UI test
    - Fix test_kerneloops_nodetails if kernel is not installed
    - Drop broken test_crash_setuid_drop_and_kill
    - Expect linux-signed on arm64/s390x as well
    - Skip SegvAnalysis for non x86 architectures
    - Use unlimited core ulimit for SIGQUIT test
    - Fix race with progress window in GTK UI tests
    - Use sleep instead of yes for tests
    - Fix test_add_gdb_info_script on armhf
    - Fix wrong Ubuntu archive URI on ports
    - Fix KeyError in test_install_packages_unversioned
    - Depend on python3-systemd for container tests
    - Depend on psmisc for killall binary
    - Replace missing oxideqt-codecs
    - Drop broken test_install_packages_from_launchpad
    - Fix test_install_packages_permanent_sandbox* for s390x

 -- Benjamin Drung <email address hidden> Thu, 15 Sep 2022 14:43:39 +0200

Changed in apport (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.20.11-0ubuntu82.2

---------------
apport (2.20.11-0ubuntu82.2) jammy; urgency=medium

  * Point Vcs-* URIs to git
  * Grab a slice of JournalErrors around the crash time (LP: #1962454)
  * data/apport:
    - Initialize error log as first step (LP: #1989467)
    - Fix PermissionError for setuid programs inside container (LP: #1982487)
    - Fix reading from stdin inside containers (LP: #1982555)
  * Fix autopkgtest test case failures (LP: #1989467):
    - Mark autopkgtest with isolation-container restriction
    - Fix failure if kernel module isofs is not installed
    - Do not check recommended dependencies
    - Skip UI test if kernel thread is not found
    - Fix race in test_crash_system_slice
    - Fix check for not running test executable
    - Use shadow in *_different_binary_source
    - Mock kernel package version in UI test
    - Fix test_kerneloops_nodetails if kernel is not installed
    - Drop broken test_crash_setuid_drop_and_kill
    - Expect linux-signed on arm64/s390x as well
    - Skip SegvAnalysis for non x86 architectures
    - Use unlimited core ulimit for SIGQUIT test
    - Fix race with progress window in GTK UI tests
    - Use sleep instead of yes for tests
    - Fix test_add_gdb_info_script on armhf
    - Fix wrong Ubuntu archive URI on ports
    - Fix KeyError in test_install_packages_unversioned
    - Depend on python3-systemd for container tests
    - Depend on psmisc for killall binary
    - Replace missing oxideqt-codecs
    - Drop broken test_install_packages_from_launchpad
    - Fix test_install_packages_permanent_sandbox* for s390x

 -- Benjamin Drung <email address hidden> Wed, 14 Sep 2022 18:28:26 +0200

Changed in apport (Ubuntu Jammy):
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.