gnustep-dev
[Top][All Lists]
Advanced

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

Re: Disappointed by GNUstep


From: Wolfgang Lux
Subject: Re: Disappointed by GNUstep
Date: Tue, 08 Feb 2022 00:29:05 +0100
User-agent: Evolution 3.38.3-1

On Sun, 2022-02-06 at 19:50 +0100, Fred Kiefer wrote:
> > Am 06.02.2022 um 16:30 schrieb Wolfgang Lux
> > <wolfgang.lux@gmail.com>:
> > ...
> > 
> > No, it doesn't happen for a standard GNUstep application. And while
> > it is reproducible for me (in at least one case), it seems rather
> > difficult to narrow it down. I've tried to come up with a minimal
> > example today, but without luck so far (the examples were
> > apparently too minimal). In fact, the split view may just be a red
> > herring and the real problem may be lurking elsewhere. So don't
> > bother trying to come up with a test case yourself.
> 
> Thank you for warning me. If you have a stack trace, feel free to
> send it to me. Maybe I could then guess where the problem is.

So, I've finally given up trying to extract a simple test case.
Apparently, the crashes happen only when I quit the application with a
sufficient number of open windows (17 in this case). I've run the
application under gdb with NSZombieEnabled=YES and a breakpoint on
NSZombie's forwardInvocation: method. See below for the full stack
trace of the first time the breakpoint is hit. It's a bit long, but
you've asked for it. :-)

The application is (primarily) a document based application and at the
point of the crash all documents and window controllers have been
closed and deallocated after selecting Quit from the menu. All windows
have been closed as well, but obviously they haven't been deallocated
yet (obviously, as otherwise the window shouldn't receive a
ConfigureNotify event in frame #12).
I think part of the issue is the autorelease pool in the -[NSWindow
close] method. It effectively means that any window controller
associated with this window, which acts as a delegate for the window
and its views (including an NSSplitView), is gone when -[NSWindow
close] returns. But obviously there is a chance to still receive events
from the X server while the window has not yet been deallocated.
I see that -[NSWindow sendEvent:] already discards all events other
than NSAppKitDefined when the window is not visible. Maybe we need to
make that condition stronger by discarding NSAppKitDefined events too
if the window is closed? 

Wolfgang

(gdb) bt
#0  -[NSZombie forwardInvocation:] (self=0x28cb0f8, 
    _cmd=0x7ffff79b2768 <.objc_selector_forwardInvocation:_v240:816>, 
    anInvocation=0x29699a8) at NSObject.m:2519
#1  0x00007ffff7770f72 in GSFFIInvocationCallback (cif=0x278dcb0, 
    retp=0x7fffffff82a0, args=0x7fffffff8110, user=0x3332f58)
    at GSFFIInvocation.m:614
#2  0x00007ffff682bb4a in ?? () from /lib/x86_64-linux-gnu/libffi.so.7
#3  0x00007ffff682beb0 in ?? () from /lib/x86_64-linux-gnu/libffi.so.7
#4  0x00007ffff7d10aa8 in -[NSSplitView _dividerRectForIndex:] (
    self=0x28d6428, _cmd=<optimized out>, index=0) at NSSplitView.m:107
#5  0x00007ffff7d13aba in -[NSSplitView resetCursorRects]
(self=0x28d6428, 
    _cmd=<optimized out>) at NSSplitView.m:1399
#6  0x00007ffff7d900a6 in resetCursorRectsForView (theView=0x28d6428)
    at NSWindow.m:3002
#7  0x00007ffff7d9011a in resetCursorRectsForView (theView=<optimized
out>)
    at NSWindow.m:3017
#8  0x00007ffff7d9011a in resetCursorRectsForView (theView=<optimized
out>)
    at NSWindow.m:3017
#9  0x00007ffff7d8ff1e in -[NSWindow resetCursorRects] (self=0x28d1368,
    _cmd=<optimized out>) at NSWindow.m:3189
#10 0x00007ffff7d9235c in -[NSWindow sendEvent:] (self=0x28d1368, 
    _cmd=<optimized out>, theEvent=0x2ac0588) at NSWindow.m:4073
#11 0x00007ffff3a54c70 in -[XGServer(EventOps) processEvent:]
(self=0x92d468, 
    _cmd=<optimized out>, event=<optimized out>) at
XGServerEvent.m:1050
#12 0x00007ffff3a53023 in -[XGServer(EventOps)
receivedEvent:type:extra:forMode:] (self=0x92d468, _cmd=<optimized
out>, data=<optimized out>, 
    type=<optimized out>, extra=<optimized out>, mode=<optimized out>)
    at XGServerEvent.m:324
#13 0x00007ffff77a2555 in -[GSRunLoopCtxt pollUntil:within:]
(self=0xa7c098, 
    _cmd=0x7ffff79b7cf8 <.objc_selector_pollUntil:within:_C280:8i1620>,
    milliseconds=<optimized out>, contexts=0xa53748) at
GSRunLoopCtxt.m:452
#14 0x00007ffff7707347 in -[NSRunLoop acceptInputForMode:beforeDate:] (
    self=0xa53708, 
    _cmd=0x7ffff79b7d28
<.objc_selector_acceptInputForMode:beforeDate:_v320:81624>,
mode=0x7ffff79a5dd8 <.objc_str_NSConnectionReplyMode>, 
    limit_date=0xa7bfc8) at NSRunLoop.m:1254
#15 0x00007ffff7707738 in -[NSRunLoop runMode:beforeDate:]
(self=0xa53708, 
    _cmd=0x7ffff79ae198
<.objc_selector_runMode:beforeDate:_C320:81624>, 
    mode=0x7ffff79a5dd8 <.objc_str_NSConnectionReplyMode>,
date=0x6caa1c8)
    at NSRunLoop.m:1334
#16 0x00007ffff776c7b3 in -[GSMessageHandle sendMessage:beforeDate:] (
    self=0xd923e8, 
    _cmd=0x7ffff79b8a78
<.objc_selector_sendMessage:beforeDate:_C320:81624>,
components=<optimized out>, when=0x6caa1c8) at NSMessagePort.m:1045
#17 0x00007ffff7667f77 in -[NSConnection(Private)
_sendOutRmc:type:sequence:] (
    self=0xd86368, 
    _cmd=0x7ffff79b1078
<.objc_selector__sendOutRmc:type:sequence:_v320:816i24i28>, c=0xbd0af8,
msgid=<optimized out>, sno=<optimized out>)
    at NSConnection.m:3440
#18 0x00007ffff7662d8e in -[NSConnection(GNUstepExtensions)
forwardInvocation:forProxy:] (self=0x28cb0f8, 
    _cmd=0x7ffff79b12e8
<.objc_selector_forwardInvocation:forProxy:_v320:81624>, inv=0x2ac04b8,
object=<optimized out>) at NSConnection.m:2018
#19 0x00007ffff7770f72 in GSFFIInvocationCallback (cif=0x3a24200, 
    retp=0x7fffffffb080, args=0x7fffffffaed0, user=0x16eddd8)
    at GSFFIInvocation.m:614
#20 0x00007ffff682bb4a in ?? () from /lib/x86_64-linux-gnu/libffi.so.7
#21 0x00007ffff682beb0 in ?? () from /lib/x86_64-linux-gnu/libffi.so.7
#22 0x00007ffff768551b in -[NSDistributedNotificationCenter
postNotificationName:object:userInfo:deliverImmediately:]
(self=0xc14058, _cmd=<optimized out>, 
    notificationName=0x7ffff7fb74d0
<.objc_str_NSApplicationDidResignActiveNotification>,
anObject=0x7ffff7fb63f0 <.objc_str_GSWorkspaceNotification>, 
    userInfo=0x3534cf8, deliverImmediately=0 '\000')
    at NSDistributedNotificationCenter.m:430
#23 0x00007ffff7d99215 in -[_GSWorkspaceCenter postNotification:] (
    self=0xc7c788, 
    _cmd=0x7ffff7f98740 <.objc_selector_postNotification:_v240:816>, 
    aNotification=0x38c6a28) at NSWorkspace.m:400
#24 0x00007ffff7d99e9d in -[_GSWorkspaceCenter
postNotificationName:object:userInfo:] (self=0xc7c788, 
    _cmd=0x7ffff7f8a2d0
<.objc_selector_postNotificationName:object:userInfo:_v400:8162432>, 
    name=0x7ffff7fb74d0
<.objc_str_NSApplicationDidResignActiveNotification>, 
    object=0xc98708, info=0x3534cf8) at NSWorkspace.m:430
#25 0x00007ffff3a55a04 in -[XGServer(EventOps) processEvent:]
(self=0x92d468, 
    _cmd=<optimized out>, event=<optimized out>) at
XGServerEvent.m:1286
#26 0x00007ffff3a53023 in -[XGServer(EventOps)
receivedEvent:type:extra:forMode:] (self=0x92d468, _cmd=<optimized
out>, data=<optimized out>, 
    type=<optimized out>, extra=<optimized out>, mode=<optimized out>)
    at XGServerEvent.m:324
#27 0x00007ffff77a2555 in -[GSRunLoopCtxt pollUntil:within:]
(self=0xa7c098, 
    _cmd=0x7ffff79b7cf8 <.objc_selector_pollUntil:within:_C280:8i1620>,
    milliseconds=<optimized out>, contexts=0xa53748) at
GSRunLoopCtxt.m:452
#28 0x00007ffff7707347 in -[NSRunLoop acceptInputForMode:beforeDate:] (
    self=0xa53708, 
    _cmd=0x7ffff79b7d28
<.objc_selector_acceptInputForMode:beforeDate:_v320:81624>,
mode=0x7ffff79a5dd8 <.objc_str_NSConnectionReplyMode>, 
    limit_date=0xa7bfc8) at NSRunLoop.m:1254
#29 0x00007ffff7707738 in -[NSRunLoop runMode:beforeDate:]
(self=0xa53708, 
    _cmd=0x7ffff79ae198
<.objc_selector_runMode:beforeDate:_C320:81624>, 
    mode=0x7ffff79a5dd8 <.objc_str_NSConnectionReplyMode>,
date=0x6ca8cc8)
    at NSRunLoop.m:1334
#30 0x00007ffff776c7b3 in -[GSMessageHandle sendMessage:beforeDate:] (
    self=0xd923e8, 
    _cmd=0x7ffff79b8a78
<.objc_selector_sendMessage:beforeDate:_C320:81624>,
components=<optimized out>, when=0x6ca8cc8) at NSMessagePort.m:1045
#31 0x00007ffff7667f77 in -[NSConnection(Private)
_sendOutRmc:type:sequence:] (
    self=0xd86368, 
    _cmd=0x7ffff79b1078
<.objc_selector__sendOutRmc:type:sequence:_v320:816i24i28>, c=0x957af8,
msgid=<optimized out>, sno=<optimized out>)
    at NSConnection.m:3440
#32 0x00007ffff7662d8e in -[NSConnection(GNUstepExtensions)
forwardInvocation:forProxy:] (self=0x28cb0f8, 
    _cmd=0x7ffff79b12e8
<.objc_selector_forwardInvocation:forProxy:_v320:81624>, inv=0x400ac98,
object=<optimized out>) at NSConnection.m:2018
#33 0x00007ffff7770f72 in GSFFIInvocationCallback (cif=0x3fbe200, 
    retp=0x7fffffffdb40, args=0x7fffffffd990, user=0x31d15a8)
    at GSFFIInvocation.m:614
#34 0x00007ffff682bb4a in ?? () from /lib/x86_64-linux-gnu/libffi.so.7
#35 0x00007ffff682beb0 in ?? () from /lib/x86_64-linux-gnu/libffi.so.7
#36 0x00007ffff768551b in -[NSDistributedNotificationCenter
postNotificationName:object:userInfo:deliverImmediately:]
(self=0xc14058, _cmd=<optimized out>, 
    notificationName=0x7ffff7fb92f0
<.objc_str_NSWorkspaceDidTerminateApplicationNotification>,
anObject=0x7ffff7fb63f0 <.objc_str_GSWorkspaceNotification>, 
    userInfo=0x6183888, deliverImmediately=0 '\000')
    at NSDistributedNotificationCenter.m:430
#37 0x00007ffff7d99215 in -[_GSWorkspaceCenter postNotification:] (
    self=0xc7c788, 
    _cmd=0x7ffff7f98740 <.objc_selector_postNotification:_v240:816>, 
    aNotification=0x1ecb0d8) at NSWorkspace.m:400
#38 0x00007ffff7d99e9d in -[_GSWorkspaceCenter
postNotificationName:object:userInfo:] (self=0xc7c788, 
    _cmd=0x7ffff7f8a2d0
<.objc_selector_postNotificationName:object:userInfo:_v400:8162432>, 
    name=0x7ffff7fb92f0
<.objc_str_NSWorkspaceDidTerminateApplicationNotification>,
object=0xc98708, info=0x6183888) at NSWorkspace.m:430
#39 0x00007ffff7bcfe30 in -[NSApplication
replyToApplicationShouldTerminate:] (
    self=0x9188e8, _cmd=<optimized out>, shouldTerminate=<optimized
out>)
    at NSApplication.m:3567
#40 0x00007ffff7bcde36 in -[NSApplication sendAction:to:from:] (
    self=<optimized out>, _cmd=<optimized out>, aSelector=0x519ba0, 
    aTarget=<optimized out>, sender=0xf9eb18) at NSApplication.m:2273
#41 0x00007ffff7caa71e in -[NSMenu performActionForItemAtIndex:] (
    self=0xb5fe78, _cmd=<optimized out>, index=<optimized out>)
    at NSMenu.m:1400
#42 0x00007ffff7cb4eaa in -[NSMenuView
_trackWithEvent:startingMenuView:] (
    self=0xcd6338, 
    _cmd=0x7ffff7f98d30
<.objc_selector__trackWithEvent:startingMenuView:_C320:--Type <RET> for
more, q to quit, c to continue without paging--
81624>, event=0x6c4d0e8, mainWindowMenuView=0x0) at NSMenuView.m:1925
#43 0x00007ffff7cb5047 in -[NSMenuView trackWithEvent:] (self=0xcd6338,
    _cmd=0x7ffff7f98d90 <.objc_selector_trackWithEvent:_C240:816>, 
    event=0x6b76418) at NSMenuView.m:1961
#44 0x00007ffff7cb52cd in -[NSMenuView mouseDown:] (self=0xcd6338, 
    _cmd=0x7ffff7f8a9e0 <.objc_selector_mouseDown:_v240:816>, 
    theEvent=0x6b76418) at NSMenuView.m:2001
#45 0x00007ffff7d92cbd in -[NSWindow sendEvent:] (self=0xf9ed18, 
    _cmd=<optimized out>, theEvent=0x6b76418) at NSWindow.m:4154
#46 0x00007ffff7bccc88 in -[NSApplication run] (self=0x9188e8, 
    _cmd=<optimized out>) at NSApplication.m:1585
#47 0x00007ffff7bab557 in NSApplicationMain (argc=1,
argv=0x7fffffffe548)
    at Functions.m:119
#48 0x000000000045f8e7 in main (argc=1, argv=0x7fffffffe548) at
main.m:16





reply via email to

[Prev in Thread] Current Thread [Next in Thread]