autopkgtest regression in test_add_proc_info

Bug #1853383 reported by dann frazier on 2019-11-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Undecided
Unassigned
Xenial
Undecided
Unassigned
Bionic
Undecided
Unassigned
Disco
Undecided
Unassigned
Eoan
Undecided
Unassigned

Bug Description

The security uploads for apport (2.20.11-0ubuntu8.2 for eoan, 2.20.10-0ubuntu27.2 for disco, and 2.20.9-0ubuntu7.8 for bionic - and maybe those for older releases as well) have caused the test_add_proc_info test to start failing[1]. The pattern changed after the subsequent uploads to fix a regression, but it still fails[2].

[1]
======================================================================
ERROR: test_add_proc_info (__main__.T)
add_proc_info().
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./test_report.py", line 100, in test_add_proc_info
    pr.add_proc_info(extraenv=['PWD'])
  File "/usr/lib/python3/dist-packages/apport/report.py", line 550, in add_proc_info
    self.add_proc_environ(pid, extraenv)
  File "/usr/lib/python3/dist-packages/apport/report.py", line 619, in add_proc_environ
    env = _read_file('environ', dir_fd=proc_pid_fd).replace('\n', '\\n')
  File "/usr/lib/python3/dist-packages/apport/report.py", line 73, in _read_file
    with open(path, 'rb', opener=lambda path, mode: os.open(path, mode, dir_fd=dir_fd)) as fd:
  File "/usr/lib/python3/dist-packages/apport/report.py", line 73, in <lambda>
    with open(path, 'rb', opener=lambda path, mode: os.open(path, mode, dir_fd=dir_fd)) as fd:
TypeError: argument should be integer or None, not list

[2]
======================================================================
ERROR: test_add_proc_info (__main__.T)
add_proc_info().
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./test_report.py", line 210, in test_add_proc_info
    self.assertRaises(ValueError, pr.add_proc_info, p.pid)
  File "/usr/lib/python3.7/unittest/case.py", line 743, in assertRaises
    return context.handle('assertRaises', args, kwargs)
  File "/usr/lib/python3.7/unittest/case.py", line 178, in handle
    callable_obj(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/apport/report.py", line 544, in add_proc_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/1899'

Related branches

dann frazier (dannf) on 2019-11-21
description: updated
description: updated
Michael Hudson-Doyle (mwhudson) wrote :

I think this got fixed in ubuntu11, but there are more test failures yet, see bug 1854237

Balint Reczey (rbalint) on 2019-11-29
tags: added: update-excuse update-excuse-eoan
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.20.11-0ubuntu17

---------------
apport (2.20.11-0ubuntu17) focal; urgency=medium

  [ Brian Murray ]
  * Add in a source package hook symlinks for linux-signed-5.4,
    linux-signed-oem-5.4, linux-oem-5.4, and linux-5.4. (LP: #1861446)
  * Remove obsolete package hook for Nexus 7 devices.

  [ Tiago Stürmer Daitx ]
  * Fix Python 2/3 support. (LP: #1853383)

 -- Brian Murray <email address hidden> Fri, 21 Feb 2020 13:16:54 -0800

Changed in apport (Ubuntu):
status: New → Fix Released
tags: added: id-5e54067a6e5bea5dc7fe43a3
tags: added: id-5e5406d81dc5c5831b42574e
Mathew Hodson (mhodson) on 2020-03-21
Changed in apport (Ubuntu Disco):
status: New → Won't Fix
Brian Murray (brian-murray) wrote :

The tests are passing now for Xenial and Bionic.

Changed in apport (Ubuntu Eoan):
status: New → Won't Fix
Changed in apport (Ubuntu Bionic):
status: New → Fix Released
Changed in apport (Ubuntu Xenial):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers