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 592348 - gnome-about-me crashed with SIGSEGV in e_contact_set()
gnome-about-me crashed with SIGSEGV in e_contact_set()
Status: RESOLVED OBSOLETE
Product: gnome-control-center
Classification: Core
Component: [obsolete] about-me
git master
Other Linux
: Normal critical
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
: 599990 603833 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-08-19 15:43 UTC by Pedro Villavicencio
Modified: 2011-01-21 12:06 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
a patch (918 bytes, patch)
2009-10-06 04:23 UTC, Matthias Clasen
none Details | Review
A better patch that doesn't use a boolean variable (1.06 KB, patch)
2009-10-30 04:10 UTC, Jeff Cai
needs-work Details | Review
fix use after free when closing window (1.80 KB, patch)
2010-03-17 12:19 UTC, Michal Schmidt
needs-work Details | Review
fix use after free when closing window [v2] (1.80 KB, patch)
2010-03-17 17:52 UTC, Michal Schmidt
committed Details | Review
do not pass the "me" pointer around all the time (8.93 KB, patch)
2010-03-17 17:54 UTC, Michal Schmidt
committed Details | Review

Description Pedro Villavicencio 2009-08-19 15:43:29 UTC
this report has been filed here:

https://bugs.edge.launchpad.net/ubuntu/+source/gnome-control-center/+bug/414538

".

Thread 1 (process 3616)

  • #0 e_contact_set
    at e-contact.c line 1637
  • #1 about_me_focus_out
    at gnome-about-me.c line 321
  • #2 _gtk_marshal_BOOLEAN__BOXED
    at /build/buildd/gtk+2.0-2.17.7/gtk/gtkmarshalers.c line 84
  • #3 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.21.4/gobject/gclosure.c line 767
  • #4 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.21.4/gobject/gsignal.c line 3247
  • #5 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.21.4/gobject/gsignal.c line 2990
  • #6 IA__g_signal_emit
    at /build/buildd/glib2.0-2.21.4/gobject/gsignal.c line 3037
  • #7 gtk_widget_event_internal
    at /build/buildd/gtk+2.0-2.17.7/gtk/gtkwidget.c line 4786
  • #8 do_focus_change
    at /build/buildd/gtk+2.0-2.17.7/gtk/gtkwindow.c line 5254
  • #9 gtk_window_real_set_focus
    at /build/buildd/gtk+2.0-2.17.7/gtk/gtkwindow.c line 5456
  • #10 IA__g_cclosure_marshal_VOID__OBJECT
    at /build/buildd/glib2.0-2.21.4/gobject/gmarshal.c line 636
  • #11 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.21.4/gobject/gclosure.c line 878
  • #12 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.21.4/gobject/gclosure.c line 767
  • #13 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.21.4/gobject/gsignal.c line 3285
  • #14 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.21.4/gobject/gsignal.c line 2980
  • #15 IA__g_signal_emit
    at /build/buildd/glib2.0-2.21.4/gobject/gsignal.c line 3037
  • #16 _gtk_window_internal_set_focus
    at /build/buildd/gtk+2.0-2.17.7/gtk/gtkwindow.c line 1603
  • #17 IA__gtk_window_set_focus
    at /build/buildd/gtk+2.0-2.17.7/gtk/gtkwindow.c line 1591
  • #18 gtk_window_dispose
    at /build/buildd/gtk+2.0-2.17.7/gtk/gtkwindow.c line 2148
  • #19 IA__g_object_run_dispose
    at /build/buildd/glib2.0-2.21.4/gobject/gobject.c line 789
  • #20 IA__gtk_object_destroy
    at /build/buildd/gtk+2.0-2.17.7/gtk/gtkobject.c line 406
  • #21 IA__gtk_main_do_event
    at /build/buildd/gtk+2.0-2.17.7/gtk/gtkmain.c line 1549
  • #22 gdk_event_dispatch
    at /build/buildd/gtk+2.0-2.17.7/gdk/x11/gdkevents-x11.c line 2379
  • #23 IA__g_main_context_dispatch
    at /build/buildd/glib2.0-2.21.4/glib/gmain.c line 1960
  • #24 g_main_context_iterate
    at /build/buildd/glib2.0-2.21.4/glib/gmain.c line 2591
  • #25 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.21.4/glib/gmain.c line 2799
  • #26 IA__gtk_main
    at /build/buildd/gtk+2.0-2.17.7/gtk/gtkmain.c line 1205
  • #27 main
    at gnome-about-me.c line 1118

Comment 1 Jens Granseuer 2009-08-19 16:20:58 UTC
1) Launchpad doesn't let me look at that bug.

2) Please copy *full* info when upstreaming bugs.

3) Crashed when doing what?
Comment 2 Pedro Villavicencio 2009-08-20 16:40:39 UTC
I'm asking for detailed steps on how to reproduce the crash, will come back shortly. You can look the bug now, I've already make it public.
Comment 3 Robert Ancell 2009-10-02 02:50:35 UTC
To reproduce:
1. Open GNOME about me
2. Click to move cursor inside a text entry
3. Close window using X button on title bar

Crashes.  Doesn't crash if the "close" button is pressed.

It appears that objects are destroyed before the UI causing a focus-out event to access invalid memory.
Comment 4 Matthias Clasen 2009-10-06 04:23:40 UTC
Created attachment 144871 [details] [review]
a patch
Comment 5 Jens Granseuer 2009-10-23 16:40:36 UTC
Committed a slightly different fix.

commit b5c741ee95c346d298d21d4cab8d9717d2335c4d
Author: Jens Granseuer <...>
Date:   Fri Oct 23 18:35:47 2009 +0200

    [about-me] Fix crash when closing the window using the window button
    
    Make sure the focus-out handler doesn't try to take action after the
    application resources have already been destroyed (bug #592348).
Comment 6 Jeff Cai 2009-10-30 04:10:25 UTC
Created attachment 146549 [details] [review]
A better patch that doesn't use a boolean variable
Comment 7 Jeff Cai 2009-10-30 04:11:30 UTC
*** Bug 599990 has been marked as a duplicate of this bug. ***
Comment 8 Jens Granseuer 2009-10-30 18:26:23 UTC
Review of attachment 146549 [details] [review]:

As I said, I didn't commit Matthias' patch as is, and the current code doesn't use the boolean.

I'll readily admit that your solution is much cleaner. The patch, however, looks broken. There is at least one instance (l.893 in current trunk, there may be others) in the code where about_me_destroy is called after you have connected to the "destroy" signal, so AFAICS in effect about_me_destroy would be called twice and cause a double-free.
Comment 9 Jens Granseuer 2009-10-30 18:26:24 UTC
Review of attachment 146549 [details] [review]:

As I said, I didn't commit Matthias' patch as is, and the current code doesn't use the boolean.

I'll readily admit that your solution is much cleaner. The patch, however, looks broken. There is at least one instance (l.893 in current trunk, there may be others) in the code where about_me_destroy is called after you have connected to the "destroy" signal, so AFAICS in effect about_me_destroy would be called twice and cause a double-free.
Comment 10 Jens Granseuer 2009-12-05 12:26:14 UTC
*** Bug 603833 has been marked as a duplicate of this bug. ***
Comment 11 Sebastien Bacher 2010-03-02 22:09:59 UTC
The fix doesn't work, the issue is still there in 2.29.90, see https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/508087 for example

"#0  0x0039ff0f in e_contact_set (contact=0x9e07fa8, 
    field_id=E_CONTACT_ADDRESS_WORK, value=0x9eb8e48) at e-contact.c:1637
	__t = <value optimized out>
	__r = <value optimized out>
	__PRETTY_FUNCTION__ = "e_contact_set"
  • #1 about_me_focus_out
    at gnome-about-me.c line 321
  • #2 _gtk_marshal_BOOLEAN__BOXED
    at /build/buildd/gtk+2.0-2.19.3/gtk/gtkmarshalers.c line 84
  • #3 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #4 ??
    from /usr/lib/libgobject-2.0.so.0
  • #5 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #6 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #7 gtk_widget_event_internal
    at /build/buildd/gtk+2.0-2.19.3/gtk/gtkwidget.c line 4941
  • #8 do_focus_change
    at /build/buildd/gtk+2.0-2.19.3/gtk/gtkwindow.c line 5289
  • #9 gtk_window_real_set_focus
    at /build/buildd/gtk+2.0-2.19.3/gtk/gtkwindow.c line 5498
  • #10 g_cclosure_marshal_VOID__OBJECT
    from /usr/lib/libgobject-2.0.so.0
  • #11 ??
    from /usr/lib/libgobject-2.0.so.0
  • #12 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #13 ??
    from /usr/lib/libgobject-2.0.so.0
  • #14 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #15 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #16 _gtk_window_internal_set_focus
    at /build/buildd/gtk+2.0-2.19.3/gtk/gtkwindow.c line 1625
  • #17 IA__gtk_window_set_focus
    at /build/buildd/gtk+2.0-2.19.3/gtk/gtkwindow.c line 1613
  • #18 gtk_window_dispose
    at /build/buildd/gtk+2.0-2.19.3/gtk/gtkwindow.c line 2170
  • #19 g_object_run_dispose
    from /usr/lib/libgobject-2.0.so.0
  • #20 IA__gtk_object_destroy
    at /build/buildd/gtk+2.0-2.19.3/gtk/gtkobject.c line 406
  • #21 IA__gtk_main_do_event
    at /build/buildd/gtk+2.0-2.19.3/gtk/gtkmain.c line 1563
  • #22 gdk_event_dispatch
    at /build/buildd/gtk+2.0-2.19.3/gdk/x11/gdkevents-x11.c line 2364
  • #23 g_main_context_dispatch
    from /lib/libglib-2.0.so.0
  • #24 ??
    from /lib/libglib-2.0.so.0
  • #25 g_main_loop_run
    from /lib/libglib-2.0.so.0
  • #26 IA__gtk_main
    at /build/buildd/gtk+2.0-2.19.3/gtk/gtkmain.c line 1219
  • #27 main
    at gnome-about-me.c line 1082

Comment 12 Sebastien Bacher 2010-03-02 22:14:44 UTC
valgrind log on current 2.29 tarball

"==18177== Invalid write of size 4
==18177==    at 0x805472C: about_me_focus_out (gnome-about-me.c:332)
==18177==    by 0x4220257: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:84)
==18177==    by 0x4CAE151: g_closure_invoke (gclosure.c:767)
==18177==    by 0x4CC584C: signal_emit_unlocked_R (gsignal.c:3243)
==18177==    by 0x4CC6E22: g_signal_emit_valist (gsignal.c:2986)
==18177==    by 0x4CC7705: g_signal_emit (gsignal.c:3033)
==18177==    by 0x436449D: gtk_widget_event_internal (gtkwidget.c:4949)
==18177==    by 0x4377A83: do_focus_change (gtkwindow.c:6726)
==18177==    by 0x4384AC8: gtk_window_real_set_focus (gtkwindow.c:7094)
==18177==    by 0x4CBC56B: g_cclosure_marshal_VOID__OBJECT (gmarshal.c:636)
==18177==    by 0x4CAC7D8: g_type_class_meta_marshal (gclosure.c:878)
==18177==    by 0x4CAE151: g_closure_invoke (gclosure.c:767)
==18177==  Address 0x585cca4 is 100 bytes inside a block of size 104 free'd
==18177==    at 0x4024B3A: free (vg_replace_malloc.c:366)
==18177==    by 0x4D36725: g_free (gmem.c:190)
==18177==    by 0x805363F: about_me_destroy (gnome-about-me.c:186)
==18177==    by 0x805541D: about_me_button_clicked_cb (gnome-about-me.c:816)
==18177==    by 0x4CBD07B: g_cclosure_marshal_VOID(intXX_t) (gmarshal.c:216)
==18177==    by 0x4CAE151: g_closure_invoke (gclosure.c:767)
==18177==    by 0x4CC584C: signal_emit_unlocked_R (gsignal.c:3243)
==18177==    by 0x4CC6FA3: g_signal_emit_valist (gsignal.c:2976)
==18177==    by 0x4CC7705: g_signal_emit (gsignal.c:3033)
==18177==    by 0x4183D10: gtk_dialog_response (gtkdialog.c:928)
==18177==    by 0x41846D5: gtk_dialog_delete_event_handler (gtkdialog.c:382)
==18177==    by 0x4220257: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:84)"
Comment 13 Sebastien Bacher 2010-03-02 22:16:18 UTC
the bug happens when switching tab and closing use the x button
Comment 14 Michal Schmidt 2010-03-17 12:19:41 UTC
Created attachment 156352 [details] [review]
fix use after free when closing window
Comment 15 Bastien Nocera 2010-03-17 14:09:49 UTC
Review of attachment 156352 [details] [review]:

::: capplets/about-me/gnome-about-me.c
@@ +164,3 @@
 /********************/
 static void
+about_me_destroy ()

That should be "about_me_destroy (void)"
Comment 16 Michal Schmidt 2010-03-17 17:52:41 UTC
Created attachment 156386 [details] [review]
fix use after free when closing window [v2]

Right, I keep forgetting about this C vs C++ difference. Corrected patch attached.
Comment 17 Michal Schmidt 2010-03-17 17:54:43 UTC
Created attachment 156387 [details] [review]
do not pass the "me" pointer around all the time

Please also consider this patch in addition to "fix use after free when closing window [v2]".
Comment 18 Bastien Nocera 2010-03-22 14:17:37 UTC
Review of attachment 156386 [details] [review]:

Patch looks fine to commit. Could you please request for a freeze break with the release team?
Comment 19 Bastien Nocera 2010-03-22 14:18:39 UTC
Review of attachment 156387 [details] [review]:

Looks fine to commit after freeze
Comment 20 Jens Granseuer 2010-03-22 14:31:10 UTC
Comment on attachment 156386 [details] [review]
fix use after free when closing window [v2]

(In reply to comment #18)
> Patch looks fine to commit. Could you please request for a freeze break with
> the release team?

Already requested and approved...
Comment 21 Jens Granseuer 2010-03-23 18:30:22 UTC
Comment on attachment 156386 [details] [review]
fix use after free when closing window [v2]

Pushed as 41586c16b9672d26f54d465d6571df39a8aee8c8
Comment 22 André Klapper 2010-05-18 21:05:53 UTC
Comment on attachment 156387 [details] [review]
do not pass the "me" pointer around all the time

correcting patch status
Comment 23 Bastien Nocera 2011-01-21 12:06:04 UTC
about-me is gone from GNOME 3.x, and the bug does not apply to the user accounts panel.