Description of problem: nm-system-settings segfault when quitting cleanly Version-Release number of selected component (if applicable): NetworkManager-0.7.0-10.el5 How reproducible: always Steps to Reproduce: 1. service messagebus stop Actual results: nm-system-settings: disconnected from the system bus, exiting. nm-system-setti[31328]: segfault at 0000000000000000 rip 0000000000000000 rsp 00007fff4ac2b668 error 14 Expected results: should not crash
Created attachment 405216 [details] patch based on upstream code commit f90d079858c12c92f3d1bca433d8b2314cd2df36 Author: Dan Williams <dcbw> Date: Tue Feb 17 10:42:25 2009 -0500 system-settings: fix shutdown issues Shutdown on SIGTERM, and don't segfault when quitting cleanly. Can't send signals on an object that's being disposed of, so don't do that. Fix a memory leak of the Hal manager's priv->devices on shutdown, not that it matters. Additionally, updated system-settings/plugins/ifcfg-rh/plugin.c * don't segfault on NULL errors
NetworkManager 0.7 on EL5 bundles gfilemonitor, and a rather ancient copy. The glocalfilemonitor class does not define cancel option. A simple workaround would be to update "gfilemonitor.c:g_file_monitor_cancel", to check if cancel function has been defined, and if yes, to execute it as shown below gboolean g_file_monitor_cancel (GFileMonitor* monitor) { GFileMonitorClass *klass; ... klass = G_FILE_MONITOR_GET_CLASS (monitor); if (klass && klass->cancel) return (* klass->cancel) (monitor); else return FALSE; } Additional note: gfilemonitor on EL5 uses inotify helper with gfilemonitor.c, whereas upstream has a separate class ginotifyfilemonitor.c. I did try updating gfilemonitor.c to use _ih_sub_cancel, after defining g_local_file_monitor_cancel, which oddly failed.
Thanks for the analysis; this seems pretty safe to fix for 5.6. QE: reproducer is in first comment.
QE: easy reproducer steps: 1) service NetworkManager stop 2) killall -TERM nm-system-settings 3) /usr/sbin/nm-system-settings --debug --plugins=ifcfg-rh 4) service messagebus stop If the bug still exists, you'll see: *** (nm-system-settings:XXXXX): WARNING **: disconnected from the system bus, exiting Segmentation fault. If the bug is fixed, you should no longer see the segfault message.
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=2893169
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Prior to this update, stopping the messagebus service (either manually, or during a routine system shutdown) may have caused certain NetworkManager components to terminate unexpectedly with a segmentation fault. With this update, the underlying source code has been modified to target this issue, and NetworkManager components now exit with 0 return code when the messagebus service is stopped.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-1023.html