bpython: crash after a few seconds related to apparmor

Bug #1941709 reported by Simon Chopin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bpython (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Something goes wrong in the import completion code, as it tries to open an apparmor-related sysfs file. The crash appears a few seconds after launching bpython. Seems fixed upstream.

LANG=C bpython
bpython version 0.21 on top of Python 3.9.6 /usr/bin/python3
>>>
Traceback (most recent call last):
  File "/usr/bin/bpython", line 33, in <module>
    sys.exit(load_entry_point('bpython==0.21', 'console_scripts', 'bpython')())
  File "/usr/lib/python3/dist-packages/bpython/curtsies.py", line 201, in main
    exit_value = repl.mainloop(True, paste)
  File "/usr/lib/python3/dist-packages/bpython/curtsies.py", line 115, in mainloop
    while self.module_gatherer.find_coroutine():
  File "/usr/lib/python3/dist-packages/bpython/importcompletion.py", line 226, in find_coroutine
    next(self.find_iterator)
  File "/usr/lib/python3/dist-packages/bpython/importcompletion.py", line 217, in find_all_modules
    for module in self.find_modules(p):
  File "/usr/lib/python3/dist-packages/bpython/importcompletion.py", line 202, in find_modules
    for subname in self.find_modules(path_real):
  File "/usr/lib/python3/dist-packages/bpython/importcompletion.py", line 202, in find_modules
    for subname in self.find_modules(path_real):
  File "/usr/lib/python3/dist-packages/bpython/importcompletion.py", line 202, in find_modules
    for subname in self.find_modules(path_real):
  [Previous line repeated 12 more times]
  File "/usr/lib/python3/dist-packages/bpython/importcompletion.py", line 199, in find_modules
    stat = path_real.stat()
  File "/usr/lib/python3.9/pathlib.py", line 1222, in stat
    return self._accessor.stat(self)
FileNotFoundError: [Errno 2] No such file or directory: '/sys/kernel/security/apparmor/apparmorfs:[15545]'

Revision history for this message
Simon Chopin (schopin) wrote :
Simon Chopin (schopin)
tags: added: patch patch-accepted-upstream
Mathew Hodson (mhodson)
Changed in bpython (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Brian Murray (brian-murray) wrote :

I sponsored this after running update-maintainer.

 $ dput bpython_0.21-3ubuntu1_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /tmp/pkgs/impish/bpython_0.21-3ubuntu1_source.changes: Valid signature from 1E918B66765B3E31
Checking signature on .dsc
gpg: /tmp/pkgs/impish/bpython_0.21-3ubuntu1.dsc: Valid signature from 1E918B66765B3E31
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading bpython_0.21-3ubuntu1.dsc: done.
  Uploading bpython_0.21-3ubuntu1.debian.tar.xz: done.
  Uploading bpython_0.21-3ubuntu1_source.buildinfo: done.
  Uploading bpython_0.21-3ubuntu1_source.changes: done.
Successfully uploaded packages.

Changed in bpython (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bpython - 0.21-3ubuntu1

---------------
bpython (0.21-3ubuntu1) impish; urgency=medium

  * d/p/0001-Handle-OSError-from-stat.patch: cherry-picked from upstream
    to fix crash. LP: #1941709

 -- Simon Chopin <email address hidden> Thu, 26 Aug 2021 09:57:00 +0200

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