[pkg-apparmor] Bug#805145: /usr/sbin/aa-status: aa-status --enabled hangs on upgrade until kill
Patrick Winnertz
winnie at debian.org
Sun Nov 15 09:28:28 UTC 2015
Package: apparmor
Version: 2.10-2+b1
Severity: important
File: /usr/sbin/aa-status
Dear Maintainer,
upgrading packages which includes apparmor profiles and execute aa-status during the upgrade process leads to indefinitely running aa-status process.
Only a kill -9 on the process helps to finish the the update.
A similiar behaviour is achieved when running aa-status manually and killing it with CTRL-C. The resulting crash log is attached to this report.
Greetings
Patrick
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages apparmor depends on:
ii debconf [debconf-2.0] 1.5.58
ii libapparmor-perl 2.10-2+b1
ii libc6 2.19-22
ii lsb-base 9.20150917
ii python3 3.4.3-7
apparmor recommends no packages.
Versions of packages apparmor suggests:
ii apparmor-docs 2.10-2
ii apparmor-profiles 2.10-2
ii apparmor-profiles-extra 1.6
ii apparmor-utils 2.10-2+b1
-- debconf information:
apparmor/homedirs:
-------------- next part --------------
KeyboardInterrupt
Python 3.4.3+: /usr/bin/python3
Sun Nov 15 10:14:14 2015
A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.
/usr/sbin/aa-status in <module>()
210 '--help' : print_usage,
211 '-h' : print_usage
212 }
213
214 if cmd in commands:
215 commands[cmd]()
216 sys.exit(0)
217 else:
218 sys.stderr.write("Error: Invalid command.\n")
219 print_usage()
commands = {'--complaining': <function cmd_complaining>, '--enabled': <function cmd_enabled>, '--enforced': <function cmd_enforced>, '--help': <function print_usage>, '--profiled': <function cmd_profiled>, '--verbose': <function cmd_verbose>, '-h': <function print_usage>, '-v': <function cmd_verbose>}
cmd = '--enabled'
/usr/sbin/aa-status in cmd_enabled()
26 # just let normal python exceptions happen (LP: #1480492)
27 pass
28
29 def cmd_enabled():
30 '''Returns error code if AppArmor is not enabled'''
31 if get_profiles() == {}:
32 sys.exit(2)
33
34 def cmd_profiled():
35 '''Prints the number of loaded profiles'''
global get_profiles = <function get_profiles>
/usr/sbin/aa-status in get_profiles()
106 errormsg("You do not have enough privilege to read the profile set.")
107 else:
108 errormsg("Could not open %s: %s" % (apparmor_profiles, os.strerror(e.errno)))
109 sys.exit(4)
110
111 for p in f.readlines():
112 match = re.search("^([^\(]+)\s+\((\w+)\)$", p)
113 profiles[match.group(1)] = match.group(2)
114
115 f.close()
p undefined
f = <_io.TextIOWrapper name='/sys/kernel/security/apparmor/profiles' mode='r' encoding='UTF-8'>
f.readlines = <built-in method readlines of _io.TextIOWrapper object>
/usr/lib/python3.4/codecs.py in decode(self=<encodings.utf_8.IncrementalDecoder object>, input=b'/usr/bin/python2.7//null-5ec//null-5ed//null-5...5ef//null-667//null-668//null-574fe (complain)\n', final=False)
311 def _buffer_decode(self, input, errors, final):
312 # Overwrite this method in subclasses: It must decode input
313 # and return an (output, length consumed) tuple
314 raise NotImplementedError
315
316 def decode(self, input, final=False):
317 # decode input (taking the buffer into account)
318 data = self.buffer + input
319 (result, consumed) = self._buffer_decode(data, self.errors, final)
320 # keep undecoded input until the next call
global decode = <built-in function decode>
self = <encodings.utf_8.IncrementalDecoder object>
input = b'/usr/bin/python2.7//null-5ec//null-5ed//null-5...5ef//null-667//null-668//null-574fe (complain)\n'
final = False
KeyboardInterrupt:
__cause__ = None
__class__ = <class 'KeyboardInterrupt'>
__context__ = None
__delattr__ = <method-wrapper '__delattr__' of KeyboardInterrupt object>
__dict__ = {}
__dir__ = <built-in method __dir__ of KeyboardInterrupt object>
__doc__ = 'Program interrupted by user.'
__eq__ = <method-wrapper '__eq__' of KeyboardInterrupt object>
__format__ = <built-in method __format__ of KeyboardInterrupt object>
__ge__ = <method-wrapper '__ge__' of KeyboardInterrupt object>
__getattribute__ = <method-wrapper '__getattribute__' of KeyboardInterrupt object>
__gt__ = <method-wrapper '__gt__' of KeyboardInterrupt object>
__hash__ = <method-wrapper '__hash__' of KeyboardInterrupt object>
__init__ = <method-wrapper '__init__' of KeyboardInterrupt object>
__le__ = <method-wrapper '__le__' of KeyboardInterrupt object>
__lt__ = <method-wrapper '__lt__' of KeyboardInterrupt object>
__ne__ = <method-wrapper '__ne__' of KeyboardInterrupt object>
__new__ = <built-in method __new__ of type object>
__reduce__ = <built-in method __reduce__ of KeyboardInterrupt object>
__reduce_ex__ = <built-in method __reduce_ex__ of KeyboardInterrupt object>
__repr__ = <method-wrapper '__repr__' of KeyboardInterrupt object>
__setattr__ = <method-wrapper '__setattr__' of KeyboardInterrupt object>
__setstate__ = <built-in method __setstate__ of KeyboardInterrupt object>
__sizeof__ = <built-in method __sizeof__ of KeyboardInterrupt object>
__str__ = <method-wrapper '__str__' of KeyboardInterrupt object>
__subclasshook__ = <built-in method __subclasshook__ of type object>
__suppress_context__ = False
__traceback__ = <traceback object>
args = ()
with_traceback = <built-in method with_traceback of KeyboardInterrupt object>
The above is a description of an error in a Python program. Here is
the original traceback:
Traceback (most recent call last):
File "/usr/sbin/aa-status", line 215, in <module>
commands[cmd]()
File "/usr/sbin/aa-status", line 31, in cmd_enabled
if get_profiles() == {}:
File "/usr/sbin/aa-status", line 111, in get_profiles
for p in f.readlines():
File "/usr/lib/python3.4/codecs.py", line 316, in decode
def decode(self, input, final=False):
KeyboardInterrupt
Please consider reporting a bug at https://bugs.launchpad.net/apparmor/
and attach this file.
More information about the pkg-apparmor-team
mailing list