After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 678872 - gnome-settings-daemon crashes when trying to g_object_ref() the GnomeRROutput data
gnome-settings-daemon crashes when trying to g_object_ref() the GnomeRROutput...
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: wacom
3.5.x
Other Linux
: Normal critical
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks: 668547
 
 
Reported: 2012-06-26 12:00 UTC by Olivier Fourdan
Modified: 2012-06-27 09:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (5.48 KB, patch)
2012-06-26 12:07 UTC, Olivier Fourdan
none Details | Review
wacom: fix crash when trying to reference RR output (4.71 KB, patch)
2012-06-26 15:00 UTC, Bastien Nocera
none Details | Review
Updated patch (4.66 KB, patch)
2012-06-26 15:10 UTC, Olivier Fourdan
committed Details | Review
Additional patch (799 bytes, patch)
2012-06-27 09:45 UTC, Olivier Fourdan
committed Details | Review

Description Olivier Fourdan 2012-06-26 12:00:39 UTC
git commit 6d08e962 (bug 677032) introduced a crash when trying to use g_object_ref/unref() on GnomeRROutput data which is not GObject.
Comment 1 Olivier Fourdan 2012-06-26 12:07:37 UTC
Created attachment 217278 [details] [review]
Proposed patch

The list returned by gnome_rr_screen_list_outputs() is the GnomeRRScreen own list so its items are valid as long as the GnomeRRScreen exists.

The proposed patch here uses the same logic as previous git commit d1329ec0 by passing the GnomeRRScreen value to subroutines that may need it or GnomeRROutput.
Comment 2 Bastien Nocera 2012-06-26 15:00:08 UTC
Created attachment 217301 [details] [review]
wacom: fix crash when trying to reference RR output

with g_object_ref() as GnomeRROutput is not an GObject.

gnome_rr_screen_list_outputs() gives access to the RR screen
output list, the memory is freed along with the GnomeRRScreen
object.
Comment 3 Olivier Fourdan 2012-06-26 15:10:23 UTC
Created attachment 217302 [details] [review]
Updated patch

Even less intrusive (or more conservative), but we create a GnomeRRScreen even though we may not need it.
Comment 4 Olivier Fourdan 2012-06-26 15:27:37 UTC
Patch committed
Comment 5 Olivier Fourdan 2012-06-27 09:44:19 UTC
Reopening, there's another g_object_ref() on GnomeRROutput remaining in find_builtin_output() from commit d1329ec0 / bug #678872
Comment 6 Olivier Fourdan 2012-06-27 09:45:26 UTC
Created attachment 217369 [details] [review]
Additional patch
Comment 7 Olivier Fourdan 2012-06-27 09:46:37 UTC
That code path is triggered only with screen tablet, that's why I missed it yesterday.