Re: [gtk-osx-users] crash on maximize/unmaximize



On Fri, 12 Feb 2016, Miroslav Rajcic wrote:

This [see report below] sounds similar to the crashes reported to me by users of my app (I reported this case on this list in January) where crashes happen only on El Capitan and are related to using app in full screen or new split view.

It seems that El Capitan version changed something internally, because searching on the net finds many similar issues.

For example Atom editor crashes:
https://github.com/atom/atom/issues/9692
https://github.com/atom/atom/issues/9584

I know Atom is not a GTK+ app, but I believe that the crashes are related.
The fix for these particular crashes in Atom are explained here:
https://github.com/atom/electron/pull/3588

Quote: "Since EL Capitan it is possible that the methods of delegate would get called after the window has been closed."

Could something like this be a case for GTK+ code too?

Thanks, this sounds very plausible; it fits the facts that I have observed. My first resort here will be to try to implement in GdkQuartzWindow.c the fix that the Atom guys came up with. That is, add a callback for the windowWillClose signal that detaches the delegate.

I'm totally unfamiliar with Objective C and Apple APIs, but from looking at the Atom and GdkQuartz code it seems that the callback should look like this:

- (void)windowWillClose:(NSNotification*)notification
{
  NSWindow *nsw = get_the_window();

  [nsw setDelegate:nil];
}

So my question is, what should the notional call "get_the_window()" actually look like? I see in GdkQuartzWindow.c code to get the relevant GdkWindow in this sort of notification context, namely

GdkWindow *window = [[self contentView] gdkWindow];

and I also see in gdkwindow-quartz.c a function

gdk_quartz_window_get_nswindow(GdkWindow *window);

I guess one could chain these, but I suspect this would be more roundabout than need be. Is "self" already the relevant NSWindow, by any chance, or is there a more direct way of getting it?

Thanks for any help.

Allin Cottrell

________________________________________
From: Gtk-osx-users-list <gtk-osx-users-list-bounces gnome org> on behalf of Allin Cottrell <cottrell wfu edu>
Sent: Friday, February 12, 2016 4:00 AM
To: gtk-osx-users-list gnome org
Subject: [gtk-osx-users] crash on maximize/unmaximize

I've recently had a report of crashes from a user of my gtk-based
app on El Capitan. The gtk version I'm using is 2.24.29. I'm able to
reproduce the problem myself: it seems to happen only when you
maximize then unmaximize a window (or maximize then use the close
button). And it doesn't happen every time; I had a work away at
maxing and unmaxing various windows for a few minutes before I got
the crash.

I'm attaching the Apple problem report. Not as informative as one
would like, I know, but it does seem to show that the problem lies
with GTK rather than in my own code. When the crash occurs I'm not
doing anything substantive with the app, just resizing or closing
windows. The segfault occurs in the function updateTrackingRect in
GdkQuartzView.c.


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