ctc-oss / fapolicy-analyzer

Tools to assist with the configuration and management of fapolicyd.
https://ctc-oss.github.io/fapolicy-analyzer
GNU General Public License v3.0
12 stars 5 forks source link

Application shutdown results in a segfault #692

Closed tparchambault closed 1 year ago

tparchambault commented 1 year ago

Simply exiting the application at first opportunity results in a segfault. Fwiw this has only been an observed symptom over the last two-three weeks.

The full user session in the CLI w/verbosity enabled. This is executing within the development environment.

(fapolicy-analyzer) [toma@fedora fapolicy-analyzer]$ python -m fapolicy_analyzer.ui -v
DEBUG:root:Verbosity enabled.
DEBUG:root:Xdg absolute path: /home/toma/.local/state/fapolicy-analyzer/FaCurrentSession.tmp
DEBUG:root:SessionManager::set_autosave_filename: /home/toma/.local/state/fapolicy-analyzer/FaCurrentSession.tmp
fapolicy-analyzer v0.5.0+84.gf65690e.dirty
DEBUG:fapolicy_analyzer.redux._internal.feature:system
DEBUG:root:_PostInitCaller.__call__((), {})
DEBUG:root:system_feature::finish::system = <class 'app.System'>
DEBUG:root:distroying widget from class SplashScreen
DEBUG:root:disposing of subscription for class SplashScreen
DEBUG:root:_PostInitCaller.__call__((), {})
DEBUG:root:FapdManager::__init__(False)
DEBUG:root:_PostInitCaller.__call__((), {'timer_duration': 5})
DEBUG:root:MainWindow::on_start((<Gtk.Window object at 0x7fb7a8e48d00 (GtkWindow at 0x55c22da8a540)>,))
DEBUG:root:_PostInitCaller.__call__((), {})
DEBUG:root:_PostInitCaller.__call__((), {})
DEBUG:root:SessionManager::detect_previous_session()
DEBUG:root:Search Pattern: /home/toma/.local/state/fapolicy-analyzer/FaCurrentSession.tmp_*.json
DEBUG:root:Glob search results: []
DEBUG:root:on_update_daemon_status(ServiceStatus.FALSE)
DEBUG:root:Starting the fapd monitoring thread
DEBUG:root:start_daemon_monitor(): ServiceStatus.FALSE
DEBUG:root:Spawning monitor thread...
DEBUG:root:_monitor_daemon() executing
DEBUG:root:Thread=<Thread(Thread-1, started daemon 140425349752384)>, Running=True
DEBUG:root:_update_fapd_status(ServiceStatus.FALSE)
DEBUG:root:SessionManager::cleanup()
DEBUG:root:SessionManager::__force_cleanup_autosave_sessions()
DEBUG:root:Search Pattern: /home/toma/.local/state/fapolicy-analyzer/FaCurrentSession.tmp_*.json
DEBUG:root:Glob search results: []
Segmentation fault (core dumped)
(fapolicy-analyzer) [toma@fedora fapolicy-analyzer]$

gdb backtrace:

(gdb) bt
#0  0x00007ffff7dda4bc in new_threadstate () at /lib64/libpython3.9.so.1.0
#1  0x00007ffff7cea5e0 in PyGILState_Ensure.cold () at /lib64/libpython3.9.so.1.0
#2  0x00007fffe926d56e in _pygi_invoke_closure_clear_py_data (invoke_closure=0x555555bbcd40) at gi/pygi-closure.c:539
#3  0x00007fffe926d602 in _pygi_invoke_closure_free (data=0x555555bbcd40) at gi/pygi-closure.c:645
#4  0x00007fffe3c328ea in _WebKitWebContextPrivate::~_WebKitWebContextPrivate() () at /lib64/libwebkit2gtk-4.0.so.37
#5  0x00007fffe3c2f7a1 in webkit_web_context_finalize(_GObject*) () at /lib64/libwebkit2gtk-4.0.so.37
#6  0x00007fffe90c6b18 in g_object_unref () at /lib64/libgobject-2.0.so.0
#7  0x00007ffff7acdae7 in __run_exit_handlers () at /lib64/libc.so.6
#8  0x00007ffff7acdc90 in on_exit () at /lib64/libc.so.6
#9  0x00007ffff7ab5b7c in __libc_start_main () at /lib64/libc.so.6
#10 0x000055555555509e in _start ()
(gdb) 

Fwiw running fapolicy-analyzer within a pdb session did catch the segfault or provided any more details.

jw3 commented 1 year ago

I have observed this as well.

dorschs57 commented 1 year ago

I've narrowed this down to the new help browser and when I register the function to handle the help scheme. When I comment that code out the segfault is gone. The fault happens even if you don't display the help because the scheme is registered as soon as the module is loaded. I'm guessing something isn't getting cleaned up right there. More digging to come...