[Bug 2112466] Re: /usr/share/apport/apport:FileNotFoundError:/usr/share/apport/apport at 600:get_pid_info on /proc/<pid>

Anshul Singh 2112466 at bugs.launchpad.net
Fri Jun 20 11:30:45 UTC 2025


** Description changed:

  [Original Report]
  
  ```
  Traceback (most recent call last):
    File "/usr/share/apport/apport", line 600, in <module>
      get_pid_info(pid)
    File "/usr/share/apport/apport", line 97, in get_pid_info
      proc_pid_fd = os.open('/proc/%s' % pid, os.O_RDONLY | os.O_PATH | os.O_DIRECTORY)
  FileNotFoundError: [Errno 2] No such file or directory: '/proc/10754'
  ```
  
  The Ubuntu Error Tracker has been receiving reports about a problem regarding apport.  This problem was most recently seen with package version 2.20.11-0ubuntu82.7, the problem page at https://errors.ubuntu.com/problem/43f924069e9e0d6cdb25ce58213a1f3dfa6e966e 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 ]
  
-  * Print a proper error message if /proc/<pid> is gone instead of the
+  * This is #2 on https://errors.ubuntu.com/?package=apport&period=day
+ 
+  * Print a proper error message if /proc/<pid> is gone instead of the
  current error:
  
   ```
   Traceback (most recent call last):
     File "/usr/share/apport/apport", line 600, in <module>
       get_pid_info(pid)
     File "/usr/share/apport/apport", line 97, in get_pid_info
       proc_pid_fd = os.open('/proc/%s' % pid, os.O_RDONLY | os.O_PATH | os.O_DIRECTORY)
   FileNotFoundError: [Errno 2] No such file or directory: '/proc/10754'
   ```
  
-  * The upload fixes the bug as
+  * The upload fixes the bug as
  https://github.com/canonical/apport/commit/fcbb93816aa367f2bd35c029ca8ecc0d83992722
  introduced proper error logging for this exception
  
  [ Test Plan ]
  
   * This crash can be reproduced by testing with a fake pid or killing a
  pid being tracked by apport
  
   * Commit fcbb93816aa367f2bd35c029ca8ecc0d83992722 also introduced a
  unit test for this bug fix so that it can be tested with a fake pid
  
  [ Where problems could occur ]
  
   * The only code change is a try catch exception for this case and a
  unit test, one of the sources of problems could be a possible syntax
  error which leads to an ftbfs for apport
  
   * Since apport is primarily for crash reports, user experience is
  unlikely to be affected much

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/2112466

Title:
  /usr/share/apport/apport:FileNotFoundError:/usr/share/apport/apport at 600:get_pid_info
  on /proc/<pid>

Status in apport package in Ubuntu:
  Fix Released
Status in apport source package in Jammy:
  New

Bug description:
  [Original Report]

  ```
  Traceback (most recent call last):
    File "/usr/share/apport/apport", line 600, in <module>
      get_pid_info(pid)
    File "/usr/share/apport/apport", line 97, in get_pid_info
      proc_pid_fd = os.open('/proc/%s' % pid, os.O_RDONLY | os.O_PATH | os.O_DIRECTORY)
  FileNotFoundError: [Errno 2] No such file or directory: '/proc/10754'
  ```

  The Ubuntu Error Tracker has been receiving reports about a problem regarding apport.  This problem was most recently seen with package version 2.20.11-0ubuntu82.7, the problem page at https://errors.ubuntu.com/problem/43f924069e9e0d6cdb25ce58213a1f3dfa6e966e 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 is #2 on https://errors.ubuntu.com/?package=apport&period=day

   * Print a proper error message if /proc/<pid> is gone instead of the
  current error:

   ```
   Traceback (most recent call last):
     File "/usr/share/apport/apport", line 600, in <module>
       get_pid_info(pid)
     File "/usr/share/apport/apport", line 97, in get_pid_info
       proc_pid_fd = os.open('/proc/%s' % pid, os.O_RDONLY | os.O_PATH | os.O_DIRECTORY)
   FileNotFoundError: [Errno 2] No such file or directory: '/proc/10754'
   ```

   * The upload fixes the bug as
  https://github.com/canonical/apport/commit/fcbb93816aa367f2bd35c029ca8ecc0d83992722
  introduced proper error logging for this exception

  [ Test Plan ]

   * This crash can be reproduced by testing with a fake pid or killing
  a pid being tracked by apport

   * Commit fcbb93816aa367f2bd35c029ca8ecc0d83992722 also introduced a
  unit test for this bug fix so that it can be tested with a fake pid

  [ Where problems could occur ]

   * The only code change is a try catch exception for this case and a
  unit test, one of the sources of problems could be a possible syntax
  error which leads to an ftbfs for apport

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2112466/+subscriptions




More information about the foundations-bugs mailing list