Re: crash in glib 2.32 relating to use of Gtk file chooser dialogs



> From: John Emmas <johne53 tiscali co uk>
> To: gtk-devel-list gnome org
> Subject: Re: crash in glib 2.32 relating to use of Gtk file chooser dialogs
> Date: Mon, 4 Jun 2012 10:33:19 +0100
> On 3 Jun 2012, at 20:05, David Andruczyk wrote:
> > I'm trying to debug a crash users are reporting with my app on glib 2.32.1  (gtk+-2.24.10-0ubuntu6) (what's is installed by default on ubuntu 12.04) gtk3.x is not possible with this app due to > > other conflicting requirements. The issues also occurs in an identical fashion on debian sid using glib 2.32.3 (gtk+2.24.10-1).  The app makes use of GtkFileChooserDialogs which is where the > crash occurs, specifically on the second one used,  the first one called by my app, always works, the subsequent ones tends to crash
> > 
> Hi David,
> I use gtk 2.20 / glib 2.24 on Windows and I can confirm that the same thing happens.  I've reported it myself and there are at least 2 other reports in Bugzilla (#636758 and #674269).  It tends to > be exactly as you described.  The dialog box works once - but will crash if hidden and then re-displayed.  Gtk file chooser widget has the same problem IIRC.
> This issue has been around for so long that I've had to assume it can't be fixed.  The only workaround seems to be not to create file choosers as persistent objects (e.g. class member objects).Instead, store a pointer somewhere, create your file chooser each time you need it, then destroy it afterwards.  It's hugely annoying but it's the only solution that works AFAICT.

> Just out of interest - are you using a theming engine (such as clearlooks).  On Windows, the problem seems to be worse when themes are being used but I don't know if that's significant or just a coincidence.
> John


Strange, I don't get the crash in windows,  though I built my own windows cross-compiled 32 and 64 bit builds of GTK+, using glib 2.28.8 and gtk+ 2.24.6 as well as the usual pre-reqs, so that's an apples to bananas comaprison.  The currently existing pre-built releases weren't suitable for my needs.  My issue is very specific to glib 2.32.x,  verified on 2.32.1 and 2.32.3 (ubuntu 12.04 and debian sid)  I can alleviate the problem by modifying glib gthread-posix.c line 1024 to NOT abort when it's given a bad key.  To me it doesn't make sense why they abort on a bad key instead of logging it, so at least things continue to work Okay.  AFAIK  their reasoning may be that something is trashed elsewhere and it'll lead to a future crash, but if no one is willing to give it any attention to fix it, where does that leave us?
I'm not using any additional themes on Windows, and for linux, I hadn't investigating a different theme.   As for the FileChooserDialogs, my tracing around within glib seems to indicate a potential race or a out of order create/set/destroy operation,  The first dialog initiates a bunch of threads and a glib threadpool, and I suspect when the next filechooser is being invoked something gets lost/screwed up which causes the abort within glib in g_private_set (gthread-posix.c lien 1024), as it's currently built to abort when the key is invalid (pthread_setspecific returns EINVAL),  I think that should be changed to a G_WARN or something where execution continues but it spits out an error that glib did something wrong internally.



--

-- David J Andruczyk



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]