The problem is that the /usr/lib/NetworkManager/nm-dhcp-client.action profile is stored in apparmor.d/sbin.dhclient (which contains multiple profiles). If I move it to a separate file, aa-logprof doesn't crash.
Now I "just" need to find out what is wrong - but that's easier with a reproducer available :-)
(Maybe the perfect answer is a total rewrite of serialize_profile_from_old_profile() which has more than one known bug, but that isn't something that will happen soon.)
Thanks, I was able to reproduce the crash with your profiles and a hand-tuned log line even with the latest bzr trunk:
# python3 aa-logprof -d lp1528139/ apparmor. d/ -f <(echo '[ 2590.544373] audit: type=1400 audit(145068854 2.244:3848) : apparmor="ALLOWED" operation="open" profile= "/usr/lib/ NetworkManager/ nm-dhcp- client. action" name="/crash/me" pid=7983 comm="foo" requested_mask="r" denied_mask="r" fsuid=0 ouid=0')
-> (A)llow
-> (V)iew Changes
-> enjoy the crash
The problem is that the /usr/lib/ NetworkManager/ nm-dhcp- client. action profile is stored in apparmor. d/sbin. dhclient (which contains multiple profiles). If I move it to a separate file, aa-logprof doesn't crash.
Now I "just" need to find out what is wrong - but that's easier with a reproducer available :-) profile_ from_old_ profile( ) which has more than one known bug, but that isn't something that will happen soon.)
(Maybe the perfect answer is a total rewrite of serialize_