Hello,

Building GNUstep from the latest source (last commit of libs-gui is Jul 28),  
clicking to foreground a just-launched modal alert view app occasionally 
crashes. The app tries to raise an exception and for some reason this is 
triggering an abort. 

The app is being compiled with ARC, libobjc2 1.9, on Aarch64. 

Oddly, sometimes when running this test in lldb, upon clicking or alt-tabbing 
to foreground the app instead of an abort I see that the process was “stopped 
and restarted” with “thread 1 received signal: SIGCHLD” and the app continues 
to run. 

(1) Does anyone understand by libs-gui would be occasionally throwing this 
exception in the first place?  Could it be some kind of race condition?

(2) Why would the exception throwing result in an abort()?  (Please see stack 
trace below).

Thank you,
Patryk


(lldb) run
Process 11479 launched: 
'/home/patryk/Desktop/gnustep-build/GUITest.app/GUITest' (aarch64)
Process 11479 stopped
* thread #1, name = 'GUITest', stop reason = signal SIGABRT
    frame #0: 0x0000007fb65e5528 libc.so.6`gsignal + 56
libc.so.6`gsignal:
->  0x7fb65e5528 <+56>: cmn    x0, #0x1, lsl #12         ; =0x1000 
    0x7fb65e552c <+60>: b.hi   0x7fb65e5550              ; <+96>
    0x7fb65e5530 <+64>: ret    
    0x7fb65e5534 <+68>: nop    
(lldb) fr va
(lldb) up
frame #1: 0x0000007fb65e69e0 libc.so.6`abort + 432
libc.so.6`abort:
    0x7fb65e69e0 <+432>: add    x0, x19, #0x9d8           ; =0x9d8 
    0x7fb65e69e4 <+436>: ldr    x1, [x0, #0x8]
    0x7fb65e69e8 <+440>: cmp    x20, x1
    0x7fb65e69ec <+444>: b.eq   0x7fb65e6a20              ; <+496>
(lldb) up
frame #2: 0x0000007fb67bcc08 
libobjc.so.4.6`objc_exception_throw(object=0x0000000000d3b808) at 
eh_personality.c:188
   185                  _objc_unexpected_exception(object);
   186          }
   187          DEBUG_LOG("Throw returned %d\n",(int) err);
-> 188          abort();
   189  }
   190  
   191  static Class get_type_table_entry(struct _Unwind_Context *context,
(lldb) up
frame #3: 0x0000007fb6c53268 libgnustep-base.so.1.26`-[NSException 
raise](self=0x0000000000d3b808, _cmd="\x85") at NSException.m:1513
   1510     }
   1511 
   1512 #if     defined(_NATIVE_OBJC_EXCEPTIONS)
-> 1513   @throw self;
   1514 #else
   1515 {
   1516   NSThread      *thread;
(lldb) up
frame #4: 0x0000007fb77b8fd8 libgnustep-gui.so.0.27`-[NSApplication 
runModalForWindow:](self=0x0000000000806d78, _cmd="z\x1c", 
theWindow=0x0000000000aac598) at NSApplication.m:1808
   1805         }
   1806       if ([[localException name] isEqual: NSAbortModalException] == NO)
   1807         {
-> 1808           [localException raise];
   1809         } 
   1810       code = NSRunAbortedResponse;
   1811     }
(lldb) up
frame #5: 0x0000007fb77985bc libgnustep-gui.so.0.27`-[NSAlert 
runModal](self=0x00000000009d9ad8, _cmd="`\x1c") at NSAlert.m:2016
   2013   else
   2014     {
   2015       [self _setupPanel];
-> 2016       [NSApp runModalForWindow: _window];
   2017       [_window orderOut: self];
   2018       _result = [(GSAlertPanel*)_window result];
   2019       DESTROY(_window);
(lldb) up
frame #6: 0x0000000000401018 GUITest`main at guitest.m:11
   8      NSAlert * alert = [[NSAlert alloc] init];
   9      [alert setMessageText:@"Hello alert"];
   10     [alert addButtonWithTitle:@"All done"];
-> 11     int result = [alert runModal];
   12     if (result == NSAlertFirstButtonReturn) {
   13       NSLog(@"First button pressed");
   14     }
(lldb) 

_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to