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 528476 - Calls System.Environment.Exit() while the GTK main loop is still running
Calls System.Environment.Exit() while the GTK main loop is still running
Status: RESOLVED WONTFIX
Product: tomboy
Classification: Applications
Component: General
0.10.x
Other Linux
: Normal normal
: 1.4.0
Assigned To: Tomboy Maintainers
Tomboy Maintainers
: 524160 549828 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-04-16 20:56 UTC by Sebastian Dröge (slomo)
Modified: 2014-05-26 07:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2008-04-16 20:56:56 UTC
Hi,
tomboy currently calls System.Environment.Exit() while the main loop is still running in several places.

This will cause tomboy to segfault on exit as:
- libgnome stores a global copy of the first created Gnome.Application and unrefs it in a atexit() handler
- gtk# uses toggle refs

=> after exit() the Gnome.Application will be unreffed and the toggle ref notify (which is in managed land and doesn't exist anymore after exit()) will be called and boom.

gtk#/gnome# have a workaround for this now but this only works when then main loop is stopped before calling exit.

So please stop your main loops before exit, thanks :)
Comment 1 Sandy Armstrong 2008-09-13 14:40:27 UTC
*** Bug 549828 has been marked as a duplicate of this bug. ***
Comment 2 Sandy Armstrong 2008-10-12 19:43:41 UTC
*** Bug 524160 has been marked as a duplicate of this bug. ***
Comment 3 Sandy Armstrong 2008-10-12 19:46:37 UTC
I'm not getting this segfault anymore, I'm not sure why.  But we certainly call Environment.Exit while the main loop is still running.

Sebastian, what distro/version do you see this on, so I can reproduce again?
Comment 4 Sebastian Dröge (slomo) 2008-10-13 07:40:29 UTC
(In reply to comment #3)
> I'm not getting this segfault anymore, I'm not sure why.  But we certainly call
> Environment.Exit while the main loop is still running.
> 
> Sebastian, what distro/version do you see this on, so I can reproduce again?

This was with gtk-sharp 2.12.0 and the corresponding gnome-sharp... it was fixed by a workaround in gtk-sharp 2.12.1 and it's corresponding gnome-sharp version.

So it won't crash anymore but it's still not nice ;)
Comment 5 Benjamin Podszun 2009-05-22 21:54:33 UTC
Won't crash but not nice: Are we going to do something about this 7 month old bug? I hope that libtomboy is going to die (or at least shrink) anyway.
Comment 6 Sandy Armstrong 2009-05-22 22:31:42 UTC
This doesn't have anything to do with libtomboy.  We should still audit our code to clean up the places we call System.Environment.Exit.  It *is* targeted for this cycle.
Comment 7 Sebastian Dröge (slomo) 2014-05-25 15:03:50 UTC
Would be nice to get some kind of comment with the reasoning when closing a bug as WONTFIX
Comment 8 Jared Jennings 2014-05-25 22:22:03 UTC
(In reply to comment #7)
Basically, 1. no one has provided a patch. 2. no one is complaining about the issue 3. I don't think I understand the problem enough to fix it.

If you want to guide me in the correct direction I am willing to give it a try.
Comment 9 Sebastian Dröge (slomo) 2014-05-26 07:04:01 UTC
Basically it's unclean to call exit() anywhere other than after your g_main_loop_run()... so you would just quit your mainloop instead of calling exit(), and then gracefully exit from there.

Initially the problem was as described in comment 1 and caused funny crashes. This is mostly a problem when atexit() handlers are used, but even without it's not really clean and asking for problems.