Bug 572466 - [crash] nm-connection-editor crashes on changing polkit policy file
Summary: [crash] nm-connection-editor crashes on changing polkit policy file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: NetworkManager
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Dan Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 579559 604999 606561 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-03-11 09:58 UTC by Jirka Klimes
Modified: 2016-01-04 06:02 UTC (History)
5 users (show)

Fixed In Version: NetworkManager-0.8.1-1.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-07-27 02:34:29 UTC
Type: ---


Attachments (Terms of Use)
2 stack traces from the crashes (9.73 KB, text/plain)
2010-03-11 09:58 UTC, Jirka Klimes
no flags Details
patch fixing the crash (589 bytes, patch)
2010-03-11 13:10 UTC, Jirka Klimes
no flags Details | Diff

Description Jirka Klimes 2010-03-11 09:58:17 UTC
Created attachment 399303 [details]
2 stack traces from the crashes

Description of problem:
When nm-connection-editor is up and a change in PolicyKit action "org.freedesktop.network-manager-settings.system.modify" is made, the editor crashes.

Version-Release number of selected component (if applicable):
NetworkManager-gnome-0.7.998-2.git20100106.fc12.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Start nm-connection-editor
2. Click to select a connection
3. Click "Edit" button (editor window appears)
4. Close the editor window by "Cancel" button (or any other way, doesn't matter)
5. Now open /usr/share/polkit-1/actions/org.freedesktop.network-manager-settings.system.policy file
6. Change "<allow_active>auth_admin_keep</allow_active>" to
   "<allow_active>no</allow_active>"
   for
   org.freedesktop.network-manager-settings.system.modify action.
7. Save the file
8. Boom - nm-connection-editor crashes
  

Actual results:
Crash

Expected results:
Should not crash

Additional info:
The crash stack traces can differ. Two types are in the attachment.

Comment 1 Jirka Klimes 2010-03-11 13:10:30 UTC
Created attachment 399334 [details]
patch fixing the crash


Hmm, looks like that after closing the editor window, it is  destroyed.
However, there are signal handlers connected to ok_button, which takes editor as its data (and it is of course not valid after editor had been destroyed).

The patch disconnects signal handlers of ok_button and thus preventing the nasty things.

However, I'm not sure whether that is a clean way.
I've also tried (at first) gtk_object_destroy (ok_button), however it mysteriously causes disposing ok_button twice - little puzzled.

Comment 2 Dan Williams 2010-06-26 01:42:44 UTC
So looking at this, the problem is actually that editor->window doesn't ever get destroyed.  I had assumed that since we got the window widget from the GladeXML with:

widget = glade_xml_get_widget (xml, "<name>");

that glade would own a reference to the widget, and release that reference when we destroyed the GLadeXML object in the NMConnectionEditor's dispose() method.  But that's not the case.

It appears that we own the initial reference to top-level widgets like GtkWindows or GtkDialogs that we get from glade, so we need to make sure to release that reference when we clean up.  We don't need to care about the CEPolikitButton though, because that gets embedded into editor->window, which takes over the reference to the button when we call gtk_box_pack_end().  When we destroy editor->window in the NMConnectionEditor object's dispose(), that walks the widget hierarchy of the window and destroys all the widgets in the window.

So I think we just need to convert the gtk_widget_hide (editor->window); in dispose() into a gtk_widget_destroy() and we're done.  I've verified that change does indeed destroy the CEPolkitButton object.

Comment 3 Dan Williams 2010-06-26 01:46:10 UTC
Upstream fix is

ffc3e0d87c1365c926ed96eea3eb7f7bc3718488 (master)
c7f46a085a8d609fb82e9d3335df131123ea7512 (0.8.1)

this appears to have regressed from 0.7.x -> 0.8.x.

Comment 4 Dan Williams 2010-06-26 01:51:16 UTC
git master fix is actually:

70db445a85cbe436ca30e578887070fe3ea4ae97

Comment 5 Dan Williams 2010-06-28 19:37:39 UTC
*** Bug 606561 has been marked as a duplicate of this bug. ***

Comment 6 Dan Williams 2010-06-28 19:49:22 UTC
*** Bug 604999 has been marked as a duplicate of this bug. ***

Comment 7 Dan Williams 2010-06-28 22:55:25 UTC
*** Bug 579559 has been marked as a duplicate of this bug. ***

Comment 8 Fedora Update System 2010-07-22 16:36:26 UTC
NetworkManager-0.8.1-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/NetworkManager-0.8.1-1.fc13

Comment 9 Fedora Update System 2010-07-22 16:39:49 UTC
NetworkManager-0.8.1-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/NetworkManager-0.8.1-1.fc12

Comment 10 Fedora Update System 2010-07-23 02:43:47 UTC
NetworkManager-0.8.1-1.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update NetworkManager'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/NetworkManager-0.8.1-1.fc13

Comment 11 Fedora Update System 2010-07-27 02:34:15 UTC
NetworkManager-0.8.1-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2010-08-17 17:10:59 UTC
NetworkManager-0.8.1-4.git20100817.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/NetworkManager-0.8.1-4.git20100817.fc12

Comment 13 Fedora Update System 2010-09-01 01:43:30 UTC
NetworkManager-0.8.1-6.git20100831.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/NetworkManager-0.8.1-6.git20100831.fc12

Comment 14 Fedora Update System 2010-09-26 04:35:07 UTC
NetworkManager-0.8.1-6.git20100831.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.