Constant crashing on OSX while editing text fields.
Whenever I edit fields inside of the magnets.pro and magnets_data.pro files gmsh will randomly crash (sometimes I click off of the field, other times I hit tab). It's in Fl::focus and obtained debug into with lldb. It seems to happen pretty often if I use the keyboard and backspace the number and then hit tab to lose focus on the edit field. It seems to be a timing thing, where the 3D View is updating and then the Menu UI gets recreated (or something similar) and an old input has focus, which was deleted/freed? and then clicking off of that old focused item causes a crash like these two:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x00000001064612c1 libfltk.1.3.dylib`Fl::focus(Fl_Widget*) + 195
libfltk.1.3.dylib`Fl::focus:
-> 0x1064612c1 <+195>: movq (%rbx), %rax
0x1064612c4 <+198>: movl $0x7, %esi
0x1064612c9 <+203>: movq %rbx, %rdi
0x1064612cc <+206>: callq *0x18(%rax)
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x00000001064612cc libfltk.1.3.dylib`Fl::focus(Fl_Widget*) + 206
libfltk.1.3.dylib`Fl::focus:
-> 0x1064612cc <+206>: callq *0x18(%rax)
0x1064612cf <+209>: movq %rbx, 0x82962(%rip) ; fl_oldfocus
0x1064612d6 <+216>: movq 0x8(%rbx), %rbx
0x1064612da <+220>: testq %rbx, %rbx
Target 0: (gmsh) stopped.
Here's a full backtrace for the first one.
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x3100000202)
* frame #0: 0x00000001064612c1 libfltk.1.3.dylib`Fl::focus(Fl_Widget*) + 195
frame #1: 0x00000001064aacff libfltk.1.3.dylib`Fl_Widget::take_focus() + 77
frame #2: 0x0000000106474a3d libfltk.1.3.dylib`Fl_Group::navigation(int) + 251
frame #3: 0x0000000106461d1e libfltk.1.3.dylib`send_event(int, Fl_Widget*, Fl_Window*) + 126
frame #4: 0x00000001064617b6 libfltk.1.3.dylib`Fl::handle_(int, Fl_Window*) + 472
frame #5: 0x00007fff3856fbba AppKit`-[NSTextInputContext(NSInputContext_WithCompletion) doCommandBySelector:completionHandler:] + 228
frame #6: 0x00007fff38564e1a AppKit`-[NSKeyBindingManager(NSKeyBindingManager_MultiClients) interpretEventAsCommand:forClient:] + 2972
frame #7: 0x00007fff38c30fdf AppKit`__84-[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:]_block_invoke_5 + 341
frame #8: 0x00007fff38c30e75 AppKit`__84-[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:]_block_invoke_3.784 + 74
frame #9: 0x00007fff3856bf23 AppKit`-[NSTextInputContext tryHandleEvent_HasMarkedText_withDispatchCondition:dispatchWork:continuation:] + 87
frame #10: 0x00007fff38c30dfb AppKit`__84-[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:]_block_invoke.781 + 237
frame #11: 0x00007fff39f14efb HIToolbox`__TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_5 + 70
frame #12: 0x00007fff39f13db9 HIToolbox`___ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec_block_invoke + 110
frame #13: 0x00007fff38c2b70e AppKit`__55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke.265 + 575
frame #14: 0x00007fff38566512 AppKit`__55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke_2 + 74
frame #15: 0x00007fff3856649a AppKit`-[NSTextInputContext tryHandleTSMEvent_HasMarkedText_withDispatchCondition:dispatchWork:continuation:] + 87
frame #16: 0x00007fff38565c92 AppKit`-[NSTextInputContext handleTSMEvent:completionHandler:] + 1749
frame #17: 0x00007fff38565545 AppKit`_NSTSMEventHandler + 306
frame #18: 0x00007fff39eaa22e HIToolbox`DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1422
frame #19: 0x00007fff39ea95df HIToolbox`SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 371
frame #20: 0x00007fff39ea9465 HIToolbox`SendEventToEventTargetWithOptions + 45
frame #21: 0x00007fff39f10f8f HIToolbox`SendTSMEvent_WithCompletionHandler + 383
frame #22: 0x00007fff39f113fa HIToolbox`__SendUnicodeTextAEToUnicodeDoc_WithCompletionHandler_block_invoke + 387
frame #23: 0x00007fff39f11268 HIToolbox`__SendFilterTextEvent_WithCompletionHandler_block_invoke + 221
frame #24: 0x00007fff39f10fde HIToolbox`SendTSMEvent_WithCompletionHandler + 462
frame #25: 0x00007fff39f10de3 HIToolbox`SendFilterTextEvent_WithCompletionHandler + 225
frame #26: 0x00007fff39f10aa4 HIToolbox`SendUnicodeTextAEToUnicodeDoc_WithCompletionHandler + 280
frame #27: 0x00007fff39f1084e HIToolbox`__utDeliverTSMEvent_WithCompletionHandler_block_invoke_2 + 283
frame #28: 0x00007fff39f106ad HIToolbox`__utDeliverTSMEvent_WithCompletionHandler_block_invoke + 355
frame #29: 0x00007fff39f104cb HIToolbox`TSMKeyEvent_WithCompletionHandler + 598
frame #30: 0x00007fff39f1025a HIToolbox`__TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_4 + 250
frame #31: 0x00007fff39f10089 HIToolbox`__TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_3 + 257
frame #32: 0x00007fff39f0fdce HIToolbox`__TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_2 + 282
frame #33: 0x00007fff39f0fb32 HIToolbox`__TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke + 274
frame #34: 0x00007fff39f0f127 HIToolbox`TSMProcessRawKeyEventWithOptionsAndCompletionHandler + 3398
frame #35: 0x00007fff38c30cd9 AppKit`__84-[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:]_block_invoke_3.779 + 110
frame #36: 0x00007fff38c302d6 AppKit`__204-[NSTextInputContext tryTSMProcessRawKeyEvent_orSubstitution:dispatchCondition:setupForDispatch:furtherCondition:doubleSpaceSubstitutionCondition:doubleSpaceSubstitutionWork:dispatchTSMWork:continuation:]_block_invoke.734 + 115
frame #37: 0x00007fff38c301c7 AppKit`-[NSTextInputContext tryTSMProcessRawKeyEvent_orSubstitution:dispatchCondition:setupForDispatch:furtherCondition:doubleSpaceSubstitutionCondition:doubleSpaceSubstitutionWork:dispatchTSMWork:continuation:] + 245
frame #38: 0x00007fff38c30892 AppKit`-[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:] + 1286
frame #39: 0x00007fff38c30086 AppKit`-[NSTextInputContext _handleEvent:allowingSyntheticEvent:] + 107
frame #40: 0x00000001064583cc libfltk.1.3.dylib`-[FLView keyDown:] + 207
frame #41: 0x00007fff383b1367 AppKit`-[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 6840
frame #42: 0x00007fff383af667 AppKit`-[NSWindow(NSEventRouting) sendEvent:] + 478
frame #43: 0x00007fff3824f8a9 AppKit`-[NSApplication(NSEvent) sendEvent:] + 2953
frame #44: 0x00000001064538ad libfltk.1.3.dylib`fl_wait(double) + 185
frame #45: 0x000000010645398d libfltk.1.3.dylib`fl_mac_flush_and_wait(double) + 202
frame #46: 0x0000000106460ea9 libfltk.1.3.dylib`Fl::run() + 19
frame #47: 0x00000001012057cc gmsh`FlGui::run() at FlGui.cpp:679:10
frame #48: 0x00000001000101bf gmsh`GmshFLTK(argc=1, argv=0x00007ffeefbff690) at GmshGlobal.cpp:458:10
frame #49: 0x00000001000105f0 gmsh`GmshMainFLTK(argc=1, argv=0x00007ffeefbff690) at GmshGlobal.cpp:515:10
frame #50: 0x000000010000dc92 gmsh`main(argc=1, argv=0x00007ffeefbff690) at Main.cpp:12:10
frame #51: 0x00007fff66bc53d5 libdyld.dylib`start + 1
I'll see if I can reproduce on Linux.
Edited by Christophe Geuzaine