GNOME Bugzilla – Bug 577831
Setting default location on non policykit system crashs clock applet
Last modified: 2009-08-11 18:44:12 UTC
Steps to reproduce: 1. On OpenSolaris PolicyKit is not available, thus compiling clock applet the source file set-timezone-dummy.c is used, you a version of clock applet compiled in this manner 2. Add this clock applet to your panel 3. If you don't have locations add some via Preferences, locations 4. Once locations added, browse over them, once mouse is located to the left of a non home location, a "Set" button displays, select this button for one of the locations. 5. Clock applet will then crash. Stack trace: Stack traces vary, as this is a race condition/thread issue, here's an example either way: current thread: t@1 [1] g_slice_alloc(0x10), at 0xfed9f907 [2] g_data_set_internal(0x82418b0, 0x2d6, 0xfebd32ac, 0x0, 0x0, 0xfee2a5d4, 0x80439d8, 0xfed6b90e), at 0xfed6b52b [3] g_datalist_id_set_data_full(0x82418b0, 0x2d6, 0xfebd32ac, 0x0), at 0xfed6b9f7 [4] g_object_set_qdata(0x82418a8, 0x2d6, 0xfebd32ac, 0xfea0057c), at 0xfec765c0 [5] mark_visited(0x82418a8), at 0xfea0059b [6] add_widget_to_closure(0x82418a8, 0x2, 0x8043aec, 0x8043ae8), at 0xfea006c7 [7] add_group_to_closure(0x86af4a0, 0x2, 0x8043aec, 0x8043ae8), at 0xfea00679 [8] add_widget_to_closure(0x8253b50, 0x2, 0x8043aec), at 0xfea00710 [9] compute_dimension(0x8253b50, 0x2, 0x8043b28, 0xfea01788), at 0xfea0149b [10] _gtk_size_group_compute_requisition(0x8253b50, 0x8043b88, 0x8043b58, 0xfeab5e4a), at 0xfea017b6 [11] gtk_widget_size_request(0x8253b50, 0x8043b88, 0x8043ba8, 0xfe8c785b), at 0xfeab5e8f [12] gtk_box_size_request(0x825a1d0, 0x825a1ec, 0x80c0588, 0xfec88cd2), at 0xfe8c7884 [13] g_cclosure_marshal_VOID__BOXED(0x80e4a70, 0x0, 0x2, 0x8228af0, 0x8043d68, 0xfe8c77ec, 0xd, 0xfec6f87c), at 0xfec88d41 [14] g_type_class_meta_marshal(0x80e4a70, 0x0, 0x2, 0x8228af0, 0x8043d68, 0x7c, 0x4000800d, 0xfec6f4fe), at 0xfec6f8b6 [15] g_closure_invoke(0x80e4a70, 0x0, 0x2, 0x8228af0, 0x8043d68, 0x825a1d0, 0x8043ce8, 0xfec863e9), at 0xfec6f5a1 [16] signal_emit_unlocked_R(0x80bc650, 0x0, 0x825a1d0, 0x0, 0x8228af0, 0x825a1d0, 0x8043e60, 0x8000000), at 0xfec86c97 [17] g_signal_emit_valist(0x825a1d0, 0xf, 0x0, 0x8043f68), at 0xfec85fc8 [18] g_signal_emit_by_name(0x825a1d0, 0xfebd331c, 0x825a1ec, 0xfea01405), at 0xfec86322 [19] do_size_request(0x825a1d0, 0xfec03f78, 0x8043f98, 0xfea01788), at 0xfea01439 [20] _gtk_size_group_compute_requisition(0x825a1d0, 0x8043ff8, 0x8043fc8, 0xfeab5e4a), at 0xfea017d2 [21] gtk_widget_size_request(0x825a1d0, 0x8043ff8, 0x8044018, 0xfe8c785b), at 0xfeab5e8f [22] gtk_box_size_request(0x825a178, 0x825a194, 0x80c0588, 0xfec88cd2), at 0xfe8c7884 [23] g_cclosure_marshal_VOID__BOXED(0x80e4a70, 0x0, 0x2, 0x826d678, 0x80441d8, 0xfe8c77ec, 0xc, 0xfec6f87c), at 0xfec88d41 [24] g_type_class_meta_marshal(0x80e4a70, 0x0, 0x2, 0x826d678, 0x80441d8, 0x7c, 0x4000800c, 0xfec6f4fe), at 0xfec6f8b6 [25] g_closure_invoke(0x80e4a70, 0x0, 0x2, 0x826d678, 0x80441d8, 0x825a178, 0x8044158, 0xfec863e9), at 0xfec6f5a1 Other information: Setting timezone is not supported on this system as PolicyKit is not available to determine if allowed or not. Thus in set-timezone-dummy.c:set_system_timezone_async(), an Error structure is created and this is passed to the referenced callback, which in this case is make_current_cb(). Just after calliing the callback(), the error strut is free'd, however make_current_cb() attempts to use this struct to display a warning dialog after which it frees the error structure anyway, this the race condition. Solution is to remove the g_error_free() call from set_system_timezone_async(), and allow make_current_cb() to free it instead.
Created attachment 131990 [details] [review] patch Attached patch removes g_error_free() from set-timezone-dummy.c:set_system_timezone_async(), svn diff generated against trunk.
Thanks!