MBS Xojo Conference
6/7th September 2018, Munich

« MBS Xojo Plugins, ver… | Home | Microsoft SQL Server … »

Crashes with FileMaker 16.0.4 with scroll gesture notification


If you saw the thread on the FileMaker Community, you may have noticed that for a few weeks people experience crashes with FileMaker 16.0.4 on MacOS 10.13.3.

Checking the crash reports, you see they all are quite similar and show abort being called to terminate the app due to an unhandled exception:

terminating with uncaught exception of type std::__1::bad_function_call: std::exception

Now if you look on the stack trace, you see the abort is caused due to the invocation of a notification observer. So somewhere in the function CreateNativeViewIfNeeded deep inside FileMaker, they create the scroll view for the window. They attach an observer to listen for a notification. Somehow the related object for the observing block of code is released too early. When a scroll gesture is detected in the Cocoa event handling system, the system calls the method _beginScrollGesture to inform interested observers about the new gesture coming. As the block of code observing is gone already, an C++ Exception is raised, which nobody handles, so the app goes down. The crash report looks like this:

Application Specific Information:
abort() called
terminating with uncaught exception of type std::__1::bad_function_call: std::exception

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff6e66be3e __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff6e7aa150 pthread_kill + 333
2 libsystem_c.dylib 0x00007fff6e5c8312 abort + 127
3 libc++abi.dylib 0x00007fff6c5a3f8f abort_message + 245
4 libc++abi.dylib 0x00007fff6c5a4113 default_terminate_handler() + 241
5 libobjc.A.dylib 0x00007fff6d92eeab _objc_terminate() + 105
6 libc++abi.dylib 0x00007fff6c5bf7c9 std::__terminate(void (*)()) + 8
7 libc++abi.dylib 0x00007fff6c5bf26d __cxa_throw + 121
8 libViewSystem.dylib 0x0000000103e34c17 std::__1::function::operator()() const + 65
9 libViewSystem.dylib 0x0000000103e34bd4 invocation function for block in ScrollView::CreateNativeViewIfNeeded() + 20
10 com.apple.Foundation 0x00007fff48d01330 -[__NSObserver _doit:] + 303
11 com.apple.CoreFoundation 0x00007fff46c1ebbc __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
12 com.apple.CoreFoundation 0x00007fff46c1eaaa _CFXRegistrationPost + 442
13 com.apple.CoreFoundation 0x00007fff46c1e7f2 ___CFXNotificationPost_block_invoke + 50
14 com.apple.CoreFoundation 0x00007fff46bdc670 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1664
15 com.apple.CoreFoundation 0x00007fff46bdb7a3 _CFXNotificationPost + 595
16 com.apple.Foundation 0x00007fff48cc0467 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
17 com.apple.AppKit 0x00007fff44440470 -[NSScrollView _beginScrollGesture] + 82
18 com.apple.AppKit 0x00007fff4475789d -[NSScrollingBehaviorConcurrentVBL _startGestureScrollWithVBLFilter:] + 130
19 com.apple.AppKit 0x00007fff4443fbcf -[NSScrollingBehaviorConcurrentVBL _scrollView:trackGestureScrollWithEvent:] + 1024
20 com.apple.AppKit 0x00007fff4443ead3 -[NSScrollingBehaviorConcurrentVBL scrollView:scrollWheelWithEvent:] + 549
21 libViewSystem.dylib 0x0000000103e34179 -[VSScrollViewMac scrollWheel:] + 2052
22 libViewSystem.dylib 0x0000000103df7efa -[NativeView_Mac scrollWheel:] + 116
23 com.apple.AppKit 0x00007fff44b20029 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 5040
24 com.apple.AppKit 0x00007fff44b1e85c -[NSWindow(NSEventRouting) sendEvent:] + 497
25 com.filemaker.client.pro12 0x00000001022561cb -[FMDocWindowCocoa sendEvent:] + 1221
26 com.apple.AppKit 0x00007fff4497fed3 -[NSApplication(NSEvent) sendEvent:] + 2543
27 com.filemaker.client.pro12 0x0000000101f73756 -[FMCocoaApplication sendEvent:] + 329
28 com.apple.AppKit 0x00007fff441e0d9d -[NSApplication run] + 812
29 com.filemaker.client.pro12 0x0000000101f73956 CMacApp_Main + 497
30 com.filemaker.client.pro12 0x0000000102039a73 main + 49
31 libdyld.dylib 0x00007fff6e51c115 start + 1


This looks like a little bug in FileMaker 16.0.4, where an object reference for the code block is not retained properly and kept as long as the window is alive. We expect this to be fixed soon with a 16.0.5 update.

For our MBS Plugin we prepared a workaround for you. By calling our new function FM.PatchNotificationProblem, you can let the plugin filter all notification. So whenever the _beginScrollGesture (or related methods) send a notification like NSScrollViewWillStartLiveScrollNotification, we can ignore it, so no observer is notified and nothing crashes.

Once FileMaker 16.0.5 will come out, the problem is gone and we can remove the function again...

If you like to try this plugin function, please contact us soon.

PS: New plugin uploaded with newer version of 8.1pr6 disk image.
02 03 18 - 22:12
No comments

  
Remember personal info?

Emoticons / Textile


Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.