Crash on writing to file

I do have a strange problem on porting my application to BigSur MacOS. The Application is Intel code, the machine does have an M1 CPU.

Application is sandboxed, the file in question is an embedded FirebirdSQL database created by application. File is located in an subdirectory inside sandbox-container.

Error does happen on writing first data page after creation of empty file. The executable is stopped by "Abort trap: 6" error, the file is left at size 0.

Any Idea what might cause the problem and how to avoid?

Elmar

The executable is stopped by Abort trap: 6 error, the file is left at size 0.

An abort trap should generate a crash report. Please post it here.

For hints on how best to do that, see Posting a Crash Report.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thread 0 Crashed:: tid_103  Dispatch queue: com.apple.main-thread
0   ???                    … ???
1   libsystem_kernel.dylib … __pthread_kill + 10
2   libsystem_c.dylib      … abort + 125
3   libmono-2.0.1.dylib    … mono_post_native_crash_handler + 14
4   libmono-2.0.1.dylib    … mono_handle_native_crash + 456
5   libmono-2.0.1.dylib    … altstack_handle_and_restore + 230
6   ???                    … 0 + 0
7   libfbclient.dylib      … write_page(Jrd::thread_db*, Jrd::BufferDesc*,…

This indicates that your app contains a third-party crash reporter and that’s disguised the true nature of the crash. Specifically, it has detected the crash and called abort.

My advice is that you disable this crash reporter, if not permanently then at least while you investigate this issue. For more on why that’s important, see Implementing Your Own Crash Reporter.

23  ???                           	0x00007fa65c876358 ???
24  ???                           	0x00007fa65c876358 ???
25  ???                           	0x00007fa65c876358 ???
…
508 ???                           	0x00007fa65c876358 ???
509 ???                           	0x00007fa65c876358 ???
510 ???                           	0x00007fa65c876358 ???

This suggests that you’re hitting some sort of infinite recursion that has run you off the bottom of your stack. Note that the Apple crash reporter only reports the first 512-ish frames, which is why it stops here.

Normally crashes like this are clearer because the crashing address is:

  • Below the bottom of the stack

  • Close to the rsp register

In this case, however, your third-party crash reporter has switch to an alternative stack (assuming the symbol on frame 5 is accurate) and so rsp is nowhere relevant.

17  libfbclient.dylib 0x0000000118c8a02c isc_create_database + 1900
18  libhedbcon.dylib  0x00000001186c4109 0x11861f000 + 676105
19  libhedbcon.dylib  0x00000001186c3d13 0x11861f000 + 675091
20  libhedbcon.dylib  0x0000000118622329 0x11861f000 + 13097
21  ???               000000000000000000 0 + 0
22  ???               0x000000000000000f 0 + 15
23  ???               0x00007fa65c876358 ???
24  ???               0x00007fa65c876358 ???
25  ???               0x00007fa65c876358 ???

I think it’s important for you to symbolicate frames 20 through 18 here. Something has managed to break you out of this apparent infinite recursion. It’s possible that this is another third-party crash reporter. Or it’s also possible that there is no infinite recursion and this code has corrupted your stack to put a loop in the stack frame chain. Regardless, these frames are the closest thing you have to a smoking gun and you need to identify them.

For more on symbolication, see Adding Identifiable Symbol Names to a Crash Report.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Frames 18-20 from within libhedbcon.dylib are exactly the expected calls within the fpc-compiled lib. Frame 20 is called form JIT generated code, the main application is in C#.

The "infinite recursion" does not happen, the stacktrace is damaged there.

The final solution was that write_page crashed on a plugin not loaded.

Crash on writing to file
 
 
Q