AssertionError: cannot parse ProcMaps line: Error: [Errno 3] No such process: 'maps'

Bug #2114171 reported by Benjamin Drung
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Apport
Fix Released
High
Unassigned
apport (Ubuntu)
Fix Released
High
Unassigned
Jammy
New
Undecided
Unassigned
Noble
New
Undecided
Unassigned

Bug Description

[ Original report ]

```
Traceback (most recent call last):
  File "/usr/share/apport/whoopsie-upload-all", line 246, in <module>
    main()
  File "/usr/share/apport/whoopsie-upload-all", line 228, in main
    stamps = collect_info()
             ^^^^^^^^^^^^^^
  File "/usr/share/apport/whoopsie-upload-all", line 162, in collect_info
    res = process_report(r)
          ^^^^^^^^^^^^^^^^^
  File "/usr/share/apport/whoopsie-upload-all", line 112, in process_report
    r.add_gdb_info()
  File "/usr/lib/python3/dist-packages/apport/report.py", line 1022, in add_gdb_info
    addr_signature = self.crash_signature_addresses()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/apport/report.py", line 1761, in crash_signature_addresses
    offset = self._address_to_offset(addr)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/apport/report.py", line 1969, in _address_to_offset
    self._build_proc_maps_cache()
  File "/usr/lib/python3/dist-packages/apport/report.py", line 2005, in _build_proc_maps_cache
    assert m, "cannot parse ProcMaps line: " + line
           ^
AssertionError: cannot parse ProcMaps line: Error: [Errno 3] No such process: 'maps'
```

The Ubuntu Error Tracker has been receiving reports about a problem regarding apport. This problem was most recently seen with package version 2.32.0-0ubuntu5.1, the problem page at https://errors.ubuntu.com/problem/472e8b056e334653c0eab820f0d83e22949fcbee contains more details, including versions of packages affected, stacktrace or traceback, and individual crash reports.
If you do not have access to the Ubuntu Error Tracker and are a software developer, you can request it at http://forms.canonical.com/reports/.

[ Impact ]

* This error report is the equivalent for this bug in Noble: https://errors.ubuntu.com/problem/472e8b056e334653c0eab820f0d83e22949fcbee
* AssertionError: cannot parse ProcMaps line: Error: [Errno 3] No such process: 'maps'

```
Traceback (most recent call last):
  File "/usr/share/apport/whoopsie-upload-all", line 246, in <module>
    main()
  File "/usr/share/apport/whoopsie-upload-all", line 228, in main
    stamps = collect_info()
             ^^^^^^^^^^^^^^
  File "/usr/share/apport/whoopsie-upload-all", line 162, in collect_info
    res = process_report(r)
          ^^^^^^^^^^^^^^^^^
  File "/usr/share/apport/whoopsie-upload-all", line 112, in process_report
    r.add_gdb_info()
  File "/usr/lib/python3/dist-packages/apport/report.py", line 1022, in add_gdb_info
    addr_signature = self.crash_signature_addresses()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/apport/report.py", line 1761, in crash_signature_addresses
    offset = self._address_to_offset(addr)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/apport/report.py", line 1969, in _address_to_offset
    self._build_proc_maps_cache()
  File "/usr/lib/python3/dist-packages/apport/report.py", line 2005, in _build_proc_maps_cache
    assert m, "cannot parse ProcMaps line: " + line
           ^
AssertionError: cannot parse ProcMaps line: Error: [Errno 3] No such process: 'maps'
```

* The upload fixes the bug as https://github.com/canonical/apport/pull/540 adds a fix to catch all error cases as the function _read_maps reads /proc/pid/maps but will return a string starting with Error: in case of an OSError.

[ Test Plan ]

 * This crash can be reproduced by having apport try to process a crash dump for a process that has already exited:

```
FAKE_PID_DIR=$(mktemp -d)
FAKE_PID=99999

mkdir -p "$FAKE_PID_DIR/fd"

mount --bind '$FAKE_PID_DIR' /proc/$FAKE_PID 2>/dev/null || true
apport -p $FAKE_PID 2>&1 || true
```

 * https://github.com/canonical/apport/pull/540 also introduced a unit test for this.

[ Where problems could occur ]

 * We are adding an error case to the error handler so a syntax error might lead to incorrect error message or failure to build.

 * Since apport is primarily for crash reports, user experience is unlikely to be affected much.

Revision history for this message
Benjamin Drung (bdrung) wrote :
Changed in apport (Ubuntu):
importance: Undecided → High
status: New → In Progress
Changed in apport:
milestone: none → 2.34.0
importance: Undecided → High
status: New → In Progress
Revision history for this message
Benjamin Drung (bdrung) wrote :
Changed in apport:
status: In Progress → Fix Committed
Revision history for this message
Benjamin Drung (bdrung) wrote :
description: updated
description: updated
description: updated
Benjamin Drung (bdrung)
Changed in apport:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
apport (2.33.1-0ubuntu1) questing; urgency=medium

  * New upstream release
    - report:
      + check for errors in ProcMaps in crash_signature_addresses (LP: #2114171)
      + Handle FileNotFoundError when determining ExecutableTimestamp
        (LP: #2098792)
    - apport: Do not hide FileNotFoundError during crash handling
    - test: use true from GNU coreutils (LP: #2111595)

 -- Benjamin Drung <email address hidden> Fri, 04 Jul 2025 21:40:18 +0200

Changed in apport (Ubuntu):
status: In Progress → 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.