Apport failed to collect crash dump: PermissionError: [Errno 13] Permission denied: 'exe'

Bug #2019295 reported by jiangminghui
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
New
Undecided
Unassigned

Bug Description

ubuntu 20.04 can not collect app dump

ApportLog.txt shows:

```
ERROR: apport (pid 15077) Fri May 12 15:26:09 2023: Unhandled exception:
Traceback (most recent call last):
  File "/usr/share/apport/apport", line 666, in <module>
    exe_mtime = os.stat('exe', dir_fd=proc_pid_fd).st_mtime
PermissionError: [Errno 13] Permission denied: 'exe'
ERROR: apport (pid 15077) Fri May 12 15:26:09 2023: pid: 15077, uid: 0, gid: 0, euid: 0, egid: 0
ERROR: apport (pid 15077) Fri May 12 15:26:09 2023: environment: environ({'LC_CTYPE': 'C.UTF-8'})
```

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: apport 2.20.11-0ubuntu27.25
ProcVersionSignature: Ubuntu 5.13.0-30.33~20.04.1-generic 5.13.19
Uname: Linux 5.13.0-30-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.25
Architecture: amd64
CasperMD5CheckResult: skip
Date: Fri May 12 15:37:13 2023
InstallationDate: Installed on 2022-08-17 (268 days ago)
InstallationMedia: Ubuntu 20.04.4 LTS "Focal Fossa" - Release amd64 (20220223)
PackageArchitecture: all
SourcePackage: apport
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
jiangminghui (jiangminghui) wrote :
Revision history for this message
Benjamin Drung (bdrung) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

ApportLog.txt shows:

```
ERROR: apport (pid 15077) Fri May 12 15:26:09 2023: Unhandled exception:
Traceback (most recent call last):
  File "/usr/share/apport/apport", line 666, in <module>
    exe_mtime = os.stat('exe', dir_fd=proc_pid_fd).st_mtime
PermissionError: [Errno 13] Permission denied: 'exe'
ERROR: apport (pid 15077) Fri May 12 15:26:09 2023: pid: 15077, uid: 0, gid: 0, euid: 0, egid: 0
ERROR: apport (pid 15077) Fri May 12 15:26:09 2023: environment: environ({'LC_CTYPE': 'C.UTF-8'})
```

Do you know which application crashed?

Revision history for this message
Benjamin Drung (bdrung) wrote :

Investigation so far
====================

The crashing Python code line:

```
exe_mtime = os.stat('exe', dir_fd=proc_pid_fd).st_mtime
```

I search my system for processes where /proc/<pid>/exe could not be read by running `sudo ls /proc/[0-9]*/exe` and looking for error messages. I found one process:

```
$ sudo LANG=C stat /proc/6157/exe
  File: /proc/6157/exe -> /snap/snapd/19122/usr/lib/snapd/snapd
  Size: 0 Blocks: 0 IO Block: 1024 symbolic link
Device: 0,22 Inode: 68395 Links: 1
Access: (0777/lrwxrwxrwx) Uid: (1000000/ UNKNOWN) Gid: (1000000/ UNKNOWN)
Access: 2023-05-15 10:35:02.600000873 +0200
Modify: 2023-05-15 10:35:02.584000872 +0200
Change: 2023-05-15 10:35:02.584000872 +0200
 Birth: -
$ sudo LANG=C stat /snap/snapd/19122/usr/lib/snapd/snapd
stat: cannot statx '/snap/snapd/19122/usr/lib/snapd/snapd': No such file or directory
```

summary: - ubuntu 20.04 can not collect app dump
+ Apport failed to collect crash dump: PermissionError: [Errno 13]
+ Permission denied: 'exe'
description: updated
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.