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 413921 - panel_run_dialog_screen_changed invalid read
panel_run_dialog_screen_changed invalid read
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: panel
2.18.x
Other Linux
: Normal major
: ---
Assigned To: Panel Maintainers
Panel Maintainers
: 420661 421712 421882 422017 426806 430904 440508 441085 442959 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-03-02 17:16 UTC by Sebastien Bacher
Modified: 2007-06-02 12:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
disconnect signal handler before freeing dialog (1.15 KB, patch)
2007-04-04 19:56 UTC, Ray Strode [halfline]
committed Details | Review

Description Sebastien Bacher 2007-03-02 17:16:32 UTC
While running gnome-panel from valgrind:

==8047== Invalid read of size 4
==8047==    at 0x8085387: panel_run_dialog_screen_changed (panel-run-dialog.c:1834)
==8047==    by 0x4801ED8: g_cclosure_marshal_VOID__OBJECT (gmarshal.c:636)
==8047==    by 0x47F562A: g_closure_invoke (gclosure.c:490)
==8047==    by 0x48060F2: signal_emit_unlocked_R (gsignal.c:2440)
==8047==    by 0x4807616: g_signal_emit_valist (gsignal.c:2199)
==8047==    by 0x48077D8: g_signal_emit (gsignal.c:2243)
==8047==    by 0x44D1233: do_screen_change (gtkwidget.c:5187)
==8047==    by 0x44D1376: gtk_widget_propagate_hierarchy_changed_recurse (gtkwidget.c:5211)
==8047==    by 0x42E855E: gtk_bin_forall (gtkbin.c:133)
==8047==    by 0x432781A: gtk_container_forall (gtkcontainer.c:1261)
==8047==    by 0x44D13AE: gtk_widget_propagate_hierarchy_changed_recurse (gtkwidget.c:5214)
==8047==    by 0x42EC19F: gtk_box_forall (gtkbox.c:670)
==8047==    by 0x432781A: gtk_container_forall (gtkcontainer.c:1261)
==8047==    by 0x44D13AE: gtk_widget_propagate_hierarchy_changed_recurse (gtkwidget.c:5214)
==8047==    by 0x42EC19F: gtk_box_forall (gtkbox.c:670)
==8047==    by 0x432781A: gtk_container_forall (gtkcontainer.c:1261)
==8047==    by 0x44D13AE: gtk_widget_propagate_hierarchy_changed_recurse (gtkwidget.c:5214)
==8047==    by 0x42EC19F: gtk_box_forall (gtkbox.c:670)
==8047==    by 0x432781A: gtk_container_forall (gtkcontainer.c:1261)
==8047==    by 0x44D13AE: gtk_widget_propagate_hierarchy_changed_recurse (gtkwidget.c:5214)
==8047==    by 0x44D4A7B: _gtk_widget_propagate_hierarchy_changed (gtkwidget.c:5251)
==8047==    by 0x44DDE18: gtk_widget_unparent (gtkwidget.c:2131)
==8047==    by 0x42E8784: gtk_bin_remove (gtkbin.c:112)
==8047==    by 0x4801ED8: g_cclosure_marshal_VOID__OBJECT (gmarshal.c:636)
==8047==    by 0x47F3E48: g_type_class_meta_marshal (gclosure.c:567)
==8047==    by 0x47F562A: g_closure_invoke (gclosure.c:490)
==8047==    by 0x4806589: signal_emit_unlocked_R (gsignal.c:2370)
==8047==    by 0x4807616: g_signal_emit_valist (gsignal.c:2199)
==8047==    by 0x48077D8: g_signal_emit (gsignal.c:2243)
==8047==    by 0x43280A8: gtk_container_remove (gtkcontainer.c:991)
==8047==    by 0x44D911C: gtk_widget_dispose (gtkwidget.c:6879)
==8047==    by 0x47F7CBF: g_object_run_dispose (gobject.c:573)
==8047==    by 0x43DDA6D: gtk_object_destroy (gtkobject.c:403)
==8047==    by 0x44D93F4: gtk_widget_destroy (gtkwidget.c:2168)
==8047==    by 0x42E855E: gtk_bin_forall (gtkbin.c:133)
==8047==    by 0x432763A: gtk_container_foreach (gtkcontainer.c:1288)
==8047==    by 0x4327F7F: gtk_container_destroy (gtkcontainer.c:825)
==8047==    by 0x44E85D0: gtk_window_destroy (gtkwindow.c:3954)
==8047==    by 0x48029C8: g_cclosure_marshal_VOID__VOID (gmarshal.c:77)
==8047==    by 0x47F3E48: g_type_class_meta_marshal (gclosure.c:567)
==8047==  Address 0x738B8DC is 100 bytes inside a block of size 112 free'd
==8047==    at 0x4020F9A: free (vg_replace_malloc.c:233)
==8047==    by 0x4859F90: g_free (gmem.c:187)
==8047==    by 0x8081C11: panel_run_dialog_destroy (panel-run-dialog.c:169)
==8047==    by 0x48029C8: g_cclosure_marshal_VOID__VOID (gmarshal.c:77)
==8047==    by 0x47F562A: g_closure_invoke (gclosure.c:490)
==8047==    by 0x48060F2: signal_emit_unlocked_R (gsignal.c:2440)
==8047==    by 0x4807616: g_signal_emit_valist (gsignal.c:2199)
==8047==    by 0x48077D8: g_signal_emit (gsignal.c:2243)
==8047==    by 0x43DDD60: gtk_object_dispose (gtkobject.c:418)
==8047==    by 0x44D9140: gtk_widget_dispose (gtkwidget.c:6887)
==8047==    by 0x44E54C5: gtk_window_dispose (gtkwindow.c:1794)
==8047==    by 0x47F7CBF: g_object_run_dispose (gobject.c:573)
==8047==    by 0x43DDA6D: gtk_object_destroy (gtkobject.c:403)
==8047==    by 0x44D93F4: gtk_widget_destroy (gtkwidget.c:2168)
==8047==    by 0x8082474: panel_run_dialog_execute (panel-run-dialog.c:438)
==8047==    by 0x80824E6: panel_run_dialog_response (panel-run-dialog.c:458)
==8047==    by 0x4802718: g_cclosure_marshal_VOID(i_xx_t) (gmarshal.c:216)
==8047==    by 0x47F562A: g_closure_invoke (gclosure.c:490)
==8047==    by 0x48060F2: signal_emit_unlocked_R (gsignal.c:2440)
==8047==    by 0x4807616: g_signal_emit_valist (gsignal.c:2199)
==8047==    by 0x48077D8: g_signal_emit (gsignal.c:2243)
==8047==    by 0x4339179: gtk_dialog_response (gtkdialog.c:835)
==8047==    by 0x43391D4: action_widget_activated (gtkdialog.c:534)
==8047==    by 0x48029C8: g_cclosure_marshal_VOID__VOID (gmarshal.c:77)
==8047==    by 0x47F562A: g_closure_invoke (gclosure.c:490)
==8047==    by 0x48060F2: signal_emit_unlocked_R (gsignal.c:2440)
==8047==    by 0x4807616: g_signal_emit_valist (gsignal.c:2199)
==8047==    by 0x48077D8: g_signal_emit (gsignal.c:2243)
==8047==    by 0x42ED152: gtk_button_clicked (gtkbutton.c:889)
==8047==    by 0x42EEBC4: gtk_button_finish_activate (gtkbutton.c:1557)
==8047==    by 0x42EEC8B: gtk_button_key_release (gtkbutton.c:1414)
==8047==    by 0x43BD5FF: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:84)
==8047==    by 0x47F3E48: g_type_class_meta_marshal (gclosure.c:567)
==8047==    by 0x47F562A: g_closure_invoke (gclosure.c:490)
==8047==    by 0x4806742: signal_emit_unlocked_R (gsignal.c:2478)
==8047==    by 0x48073DE: g_signal_emit_valist (gsignal.c:2209)
==8047==    by 0x48077D8: g_signal_emit (gsignal.c:2243)
==8047==    by 0x44D1A77: gtk_widget_event_internal (gtkwidget.c:3915)
==8047==    by 0x43B6939: gtk_propagate_event (gtkmain.c:2324)
==8047==    by 0x43B7B26: gtk_main_do_event (gtkmain.c:1592)
Comment 1 Vincent Untz 2007-03-05 23:09:32 UTC
It's probably only a matter of changing:

	g_signal_connect_swapped (dialog->run_dialog, "destroy",
				  G_CALLBACK (panel_run_dialog_destroy), dialog);

to use g_signal_connect_after(). What's happening here is that we're accessing the structure that was free in the destroy signal handler, when destroying the dialog content. Freeing the structure after the destroying of the dialog content should be enough.
Comment 2 Vincent Untz 2007-03-05 23:24:49 UTC
Doesn't work :-)
Hrm. I see how to fix this, but my solution involves quite some rewriting (which is needed), and that's not okay for 2.18.0...
Comment 3 Sebastien Bacher 2007-03-20 10:16:04 UTC
Ubuntu bug https://launchpad.net/bugs/90444 is a crasher which looks like the same bug and already has some duplicates
Comment 4 Sebastien Bacher 2007-03-26 08:54:02 UTC
*** Bug 420661 has been marked as a duplicate of this bug. ***
Comment 5 Sebastien Bacher 2007-03-26 12:38:46 UTC
*** Bug 421712 has been marked as a duplicate of this bug. ***
Comment 6 Sebastien Bacher 2007-03-26 12:39:03 UTC
*** Bug 421882 has been marked as a duplicate of this bug. ***
Comment 7 Sebastien Bacher 2007-03-26 12:39:14 UTC
*** Bug 422017 has been marked as a duplicate of this bug. ***
Comment 8 Sebastien Bacher 2007-03-26 13:43:07 UTC
Debug backtrace for the crash:

.

Thread 1 (process 19312)

  • #0 strerror_r
    from /lib/tls/i686/cmov/libc.so.6
  • #1 panel_run_dialog_screen_changed
    at panel-run-dialog.c line 1837
  • #2 IA__g_cclosure_marshal_VOID__OBJECT
    at gmarshal.c line 636
  • #3 IA__g_closure_invoke
    at gclosure.c line 490
  • #4 signal_emit_unlocked_R
    at gsignal.c line 2440
  • #5 IA__g_signal_emit_valist
    at gsignal.c line 2199
  • #6 IA__g_signal_emit
    at gsignal.c line 2243
  • #7 IA__gtk_widget_class_list_style_properties
    at gtkwidget.c line 7472
  • #8 _gtk_widget_get_aux_info
    at gtkwidget.c line 7170
  • #9 gtk_bin_forall
    at gtkbin.c line 132
  • #10 ??
    at gtkcontainer.c line 1256
  • #11 ??
  • #12 ??
  • #13 gtk_reset_shapes_recurse
    at gtkwidget.c line 7327
  • #14 _gtk_widget_get_aux_info
    at gtkwidget.c line 7180
  • #15 gtk_box_forall
    at gtkbox.c line 669
  • #16 ??
    at gtkcontainer.c line 1256
  • #17 ??
  • #18 ??
  • #19 gtk_reset_shapes_recurse
    at gtkwidget.c line 7327
  • #20 _gtk_widget_get_aux_info
    at gtkwidget.c line 7180
  • #21 gtk_box_forall
    at gtkbox.c line 669
  • #22 ??
    at gtkcontainer.c line 1256
  • #23 ??
  • #24 ??
  • #25 gtk_reset_shapes_recurse
    at gtkwidget.c line 7327
  • #26 _gtk_widget_get_aux_info
    at gtkwidget.c line 7180
  • #27 gtk_box_forall
    at gtkbox.c line 669
  • #28 ??
    at gtkcontainer.c line 1256
  • #29 ??
  • #30 ??
  • #31 gtk_reset_shapes_recurse
    at gtkwidget.c line 7327
  • #32 _gtk_widget_get_aux_info
    at gtkwidget.c line 7180
  • #33 IA__gtk_widget_get_colormap
    at gtkwidget.c line 6360
  • #34 IA__gtk_widget_child_notify
    at /usr/include/glib-2.0/gobject/gobjectnotifyqueue.c line 101
  • #35 gtk_bin_remove
    at gtkbin.c line 108
  • #36 IA__g_cclosure_marshal_VOID__OBJECT
    at gmarshal.c line 636
  • #37 g_type_class_meta_marshal
    at gclosure.c line 567
  • #38 IA__g_closure_invoke
    at gclosure.c line 490
  • #39 signal_emit_unlocked_R
    at gsignal.c line 2370
  • #40 IA__g_signal_emit_valist
    at gsignal.c line 2199
  • #41 IA__g_signal_emit
    at gsignal.c line 2243
  • #42 IA__gtk_container_add
    at gtkcontainer.c line 944
  • #43 IA__gtk_widget_set_parent
    at gtkwidget.c line 4690
  • #44 IA__g_object_run_dispose
    at gobject.c line 573
  • #45 IA__gtk_object_sink
    at gtkobject.c line 495
  • #46 IA__gtk_widget_hide
    at gtkwidget.c line 2308
  • #47 gtk_bin_forall
    at gtkbin.c line 132
  • #48 ??
    at gtkcontainer.c line 1283
  • #49 ??
  • #50 ??

Comment 9 Marcus Grando 2007-03-27 11:19:55 UTC
Here too...

# uname -a
FreeBSD marcus 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Tue Mar 27 06:39:37 BRT 2007     root@marcus:/usr/obj/usr/src/sys/MARCUS  i386

(gdb) bt full
  • #0 strlen
    from /lib/libc.so.7
  • #1 IA__g_strdup
    at gstrfuncs.c line 90
  • #2 panel_run_dialog_screen_changed
    at panel-run-dialog.c line 1837
  • #3 IA__g_cclosure_marshal_VOID__OBJECT
    at gmarshal.c line 636
  • #4 IA__g_closure_invoke
    at gclosure.c line 490

Comment 10 Marcus Grando 2007-03-29 17:05:36 UTC
(In reply to comment #2)
> Doesn't work :-)
> Hrm. I see how to fix this, but my solution involves quite some rewriting
> (which is needed), and that's not okay for 2.18.0...
> 

What's status of this? I think that's critical, since that's always possible to reproduce with <Alt>+<F2>.

Regards
Comment 11 Ray Strode [halfline] 2007-04-04 19:56:22 UTC
Created attachment 85823 [details] [review]
disconnect signal handler before freeing dialog
Comment 12 Vincent Untz 2007-04-10 14:26:04 UTC
*** Bug 426806 has been marked as a duplicate of this bug. ***
Comment 13 Vincent Untz 2007-04-10 18:37:44 UTC
Thanks Ray!
Comment 14 palfrey 2007-04-26 16:38:57 UTC
*** Bug 430904 has been marked as a duplicate of this bug. ***
Comment 15 Pedro Villavicencio 2007-05-22 19:26:18 UTC
*** Bug 440508 has been marked as a duplicate of this bug. ***
Comment 16 Pedro Villavicencio 2007-05-25 03:17:25 UTC
*** Bug 441085 has been marked as a duplicate of this bug. ***
Comment 17 Christian Kirbach 2007-06-02 12:00:21 UTC
*** Bug 442959 has been marked as a duplicate of this bug. ***