[apparmor] backtrace from logparser.py prefetch_next_log_line

Christian Boltz apparmor at cboltz.de
Sat Sep 13 20:25:42 UTC 2014


Hello,

while playing around with aa-logprof, I got the following backtrace.

# python3 aa-logprof
Reading log entries from /var/log/messages.
Updating AppArmor profiles in /etc/apparmor.d.
Traceback (most recent call last):
  File "aa-logprof", line 52, in <module>
    apparmor.do_logprof_pass(logmark)
  File "/home/cb/apparmor/HEAD-CLEAN/utils/apparmor/aa.py", line 2275, in do_logprof_pass
    log = log_reader.read_log(logmark)
  File "/home/cb/apparmor/HEAD-CLEAN/utils/apparmor/logparser.py", line 339, in read_log
    line = self.get_next_log_entry()
  File "/home/cb/apparmor/HEAD-CLEAN/utils/apparmor/logparser.py", line 71, in get_next_log_entry
    self.prefetch_next_log_entry()
  File "/home/cb/apparmor/HEAD-CLEAN/utils/apparmor/logparser.py", line 64, in prefetch_next_log_entry
    self.next_log_entry = self.LOG.readline()
  File "/usr/lib64/python3.4/codecs.py", line 695, in readline
    return self.reader.readline(size)
  File "/usr/lib64/python3.4/codecs.py", line 548, in readline
    data = self.read(readsize, firstline=True)
  File "/usr/lib64/python3.4/codecs.py", line 494, in read
    newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 123: invalid start byte


Maybe it would be a good idea not to assume any encoding and use raw
bytes instead? (Patches welcome ;-)

You can use   aa-logprof -f testfile   (attached) to reproduce this bug.


Regards,

Christian Boltz
-- 
Yes, I know how much devs hate writing documentation... I was a dev.
[Carlos E. R. in opensuse-factory]
-------------- next part --------------
2014-07-12T19:44:19.023487+02:00 geeko org.gtk.Private.GoaVolumeMonitor[9603]: g_dbus_connection_real_closed: Remote peer vanished with error: Fehler beim Empfang der Nachricht: Die Verbindung wurde vom Kommunikationspartner zurückgesetzt (g-io-error-quark, 0). Exiting.


More information about the AppArmor mailing list