"stack buffer overflow" when starting app on M1

Does anyone have an idea what might cause an application to crash on start before the first line of code?

Using computer with High Sierra and Xojo 2020r2.1 I get this lovely crash:

Process: Mail Archiver X [68899]
Path: /Applications/Mail Archiver X/Mail Archiver X.app/Contents/MacOS/Mail Archiver X
Identifier: com.mothsoftware.mailarchiverx
Version: 6.0.0b1 (6.0.0.3.2210)
Code Type: X86-64 (Translated)
Parent Process: ??? [1]
Responsible: Mail Archiver X [68899]
User ID: 501

Date/Time: 2021-02-02 13:27:54.034 +0100
OS Version: macOS 11.1 (20C69)
Report Version: 12
Anonymous UUID: AD0E17C4-56F5-D9DA-B323-5C0F432C4D48

Sleep/Wake UUID: ABAE66AC-A661-4D96-8516-749D0CD2667F

Time Awake Since Boot: 180000 seconds
Time Since Wake: 890 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information:
stack buffer overflow

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 ??? 0x00007ffe96386a30 ???
1 libsystem_kernel.dylib 0x00007fff20383462 __pthread_kill + 10
2 libsystem_c.dylib 0x00007fff203047ba __abort + 139
3 libsystem_c.dylib 0x00007fff202de8eb __stack_chk_fail + 100
4 com.xojo.XojoFramework 0x000000011082d98a 0x1105d1000 + 2476426
5 ??? 0x0000726576696863 0 + 125780103882851

Thread 1:: com.apple.rosetta.exceptionserver
0 runtime 0x00007ffdffe22a98 0x7ffdffe20000 + 10904
1 runtime 0x00007ffdffe2be98 0x7ffdffe20000 + 48792
2 runtime 0x00007ffdffe2d8e8 0x7ffdffe20000 + 55528

Thread 2:
0 runtime 0x00007ffdffe7a914 0x7ffdffe20000 + 370964

Thread 3:
0 runtime 0x00007ffdffe7a914 0x7ffdffe20000 + 370964

Thread 4:
0 runtime 0x00007ffdffe7a914 0x7ffdffe20000 + 370964

Thread 5:
0 runtime 0x00007ffdffe7a914 0x7ffdffe20000 + 370964

Using an M1 computer the app doesn’t crash. But there I have a different problem.

Here is the console log:

default 13:47:54.236699+0100 runningboardd Acquiring assertion targeting [app<application.com.mothsoftware.mailarchiverx.5556463.5556910(501)>:69800] from originator [daemon<com.apple.coreservices.appleevents(55)>:277] with description <RBSAssertionDescriptor| “AE/Mail Archiver X” ID:171-277-53011 target:69800 attributes:[
<RBSDomainAttribute| domain:“com.apple.launchservicesd” name:“LSNotification” sourceEnvironment:"(null)">
]>
default 13:47:54.230541+0100 loginwindow -[PersistentAppsSupport applicationReady:] | App: Mail Archiver X, ready, updating active tracking timer
default 13:47:54.230607+0100 loginwindow -[ApplicationManager checkInAppContext:eventData:] | ApplicationManager: Checked in app : Mail Archiver X
default 13:47:56.656811+0100 Mail Archiver X Received configuration update from daemon (initial)
default 13:47:56.658335+0100 Mail Archiver X CHECKIN: pid=69800
default 13:47:56.671314+0100 Mail Archiver X CHECKEDIN: pid=69800 asn=0x0-0xb6ab6a foreground=1
default 13:47:56.672930+0100 loginwindow -[ApplicationManager checkInAppContext:eventData:] | ApplicationManager: Checked in app : Mail Archiver X
default 13:47:56.677264+0100 tccd AUTHREQ_ATTRIBUTION: msgID=69800.1, attribution={requesting={identifier=com.mothsoftware.mailarchiverx, pid=69800, auid=501, euid=501, binary_path=/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/MacOS/Mail Archiver X}, },
default 13:47:56.701935+0100 lsd Non-fatal error enumerating at , continuing: Error Domain=NSCocoaErrorDomain Code=260 “Die Datei „PlugIns“ konnte nicht geöffnet werden, da sie nicht existiert.” UserInfo={NSURL=PlugIns/ – file:///Users/beatrixwillius/Desktop/Mail%20Archiver%20X.app/Contents/, NSFilePath=/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/PlugIns, NSUnderlyingError=0x102d48a00 {Error Domain=NSPOSIXErrorDomain Code=2 “No such file or directory”}}
default 13:47:56.782615+0100 lsd Non-fatal error enumerating at , continuing: Error Domain=NSCocoaErrorDomain Code=260 “Die Datei „PlugIns“ konnte nicht geöffnet werden, da sie nicht existiert.” UserInfo={NSURL=PlugIns/ – file:///Users/beatrixwillius/Desktop/Mail%20Archiver%20X.app/Contents/Library/LoginItems/Mail%20Archiver%20X%20.app/Contents/, NSFilePath=/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/Library/LoginItems/Mail Archiver X .app/Contents/PlugIns, NSUnderlyingError=0x102c2a850 {Error Domain=NSPOSIXErrorDomain Code=2 “No such file or directory”}}
default 13:47:56.810070+0100 tccd AUTHREQ_ATTRIBUTION: msgID=142.2540, attribution={accessing={identifier=com.mothsoftware.mailarchiverx, pid=69800, auid=501, euid=501, binary_path=/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/MacOS/Mail Archiver X}, requesting={identifier=com.apple.WindowServer, pid=142, auid=88, euid=88, binary_path=/System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/Resources/WindowServer}, },
default 13:47:56.810142+0100 tccd requestor: identifier=com.apple.WindowServer, pid=142, auid=88, euid=88, binary_path=/System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/Resources/WindowServer is checking access for accessor identifier=com.mothsoftware.mailarchiverx, pid=69800, auid=501, euid=501, binary_path=/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/MacOS/Mail Archiver X
default 13:47:56.822658+0100 Mail Archiver X FRONTLOGGING: version 1
default 13:47:56.822706+0100 Mail Archiver X Registered, pid=69800 ASN=0x0,0xb6ab6a
default 13:47:56.826188+0100 Mail Archiver X BringForward: pid=69800 asn=0x0-0xb6ab6a bringForward=1 foreground=1 uiElement=0 launchedByLS=1 modifiersCount=1 allDisabled=1
default 13:47:56.826230+0100 Mail Archiver X BringFrontModifier: pid=69800 asn=0x0-0xb6ab6a Modifier 0 hideAfter=0 hideOthers=0 dontMakeFrontmost=0 mouseDown=0/0 seed=0/0
default 13:47:56.826317+0100 Mail Archiver X BringForward: pid=69800 asn=0x0-0xb6ab6a
default 13:47:56.826395+0100 Mail Archiver X SetFrontProcess: asn=0x0-0xb6ab6a options=0
default 13:47:56.839431+0100 Mail Archiver X Current system appearance, (HLTB: 1), (SLS: 0)
default 13:47:56.846389+0100 Mail Archiver X Post-registration system appearance: (HLTB: 1)
default 13:47:59.235248+0100 loginwindow -[PersistentAppsSupport saveLogoutPersistentState:finalSnapshot:] | checkAgainstApp is : Mail Archiver X
default 13:47:59.235268+0100 loginwindow -[PersistentAppsSupport appShouldBeRelaunched:] | entered. checking app: Mail Archiver X
default 13:47:59.236140+0100 loginwindow -[PersistentAppsSupport saveLogoutPersistentState:finalSnapshot:] | Adding to relaunchArray: Mail Archiver X
default 13:47:59.247653+0100 loginwindow -[PersistentAppsSupport saveLogoutPersistentState:finalSnapshot:] | Contents:(
{
BackgroundState = 0;
BundleID = “com.mothsoftware.mailarchiverx”;
Hide = 0;
Path = “/Users/beatrixwillius/Desktop/Mail Archiver X.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.finder”;
Hide = 0;
Path = “/System/Library/CoreServices/Finder.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.console”;
Hide = 1;
Path = “/System/Applications/Utilities/Console.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.safari”;
Hide = 1;
Path = “/Applications/Safari.app”;
},
{
BackgroundState = 2;
BundleID = “com.microsoft.to-do-mac”;
Hide = 1;
Path = “/Applications/Microsoft To Do.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.textedit”;
Hide = 1;
Path = “/System/Applications/TextEdit.app”;
},
{
BackgroundState = 2;
BundleID = “com.xojo.xojo”;
Hide = 1;
Path = “/Applications/Xojo/Xojo 2020r2.1.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.mail”;
Hide = 1;
Path = “/System/Applications/Mail.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.mobilesms”;
Hide = 1;
Path = “/System/Applications/Messages.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.preview”;
Hide = 1;
Path = “/System/Applications/Preview.app”;
},
{
BackgroundState = 2;
BundleID = “com.google.chrome”;
Hide = 1;
Path = “/Applications/Google Chrome.app”;
},
{
BackgroundState = 2;
BundleID = “net.kovidgoyal.calibre”;
Hide = 1;
Path = “/Applications/calibre.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.systempreferences”;
Hide = 1;
Path = “/System/Applications/System Preferences.app”;
}
)
default 13:48:00.874073+0100 Mail Archiver X dlopen(/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/Frameworks/v4rb_cocoa_64.dylib, 5): Library not loaded: @executable_path/…/vcomponents_x64/libvshared_fat_release_x64.dylib
Referenced from: /Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/Frameworks/v4rb_cocoa_64.dylib
Reason: no suitable image found. Did find:
/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/MacOS/…/vcomponents_x64/libvshared_fat_release_x64.dylib: code signature in (/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/MacOS/…/vcomponents_x64/libvshared_fat_release_x64.dylib) not valid for use in process using Library Validation: mapping process and mapped file (non-platform) have different Team IDs
/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/MacOS/…/vcomponents_x64/libvshared_fat_release_x64.dylib: code signature in (/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/MacOS/…/vcomponents_x64/libvshared_fat_release_x64.dylib) not valid for use in process us<…>
default 13:48:00.874185+0100 Mail Archiver X Runtime Error
Please report what caused this error along with the information below.
Common/plugin.cpp: 1048
Failure Condition: false
Could not open plugin v4rb_cocoa_64.dylib (dlopen(/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/Frameworks/v4rb_cocoa_64.dylib, 5): Library not loaded: @executable_path/…/vcomponents_x64/libvshared_fat_release_x64.dylib
Referenced from: /Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/Frameworks/v4rb_cocoa_64.dylib
Reason: no suitable image found. Did find:
/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/MacOS/…/vcomponents_x64/libvshared_fat_release_x64.dylib: code signature in (/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/MacOS/…/vcomponents_x64/libvshared_fat_release_x64.dylib) not valid for use in process using Library Validation: mapping process and mapped file (non-platform) have different Team IDs
/Users/beatrixwillius/Desktop/Mail Archiver X.app/Contents/MacOS/…/vcomponents_x64/libvshared_fat_release_x6<…>
default 13:48:00.874736+0100 kernel AMFI: Denying core dump for pid 69800 (Mail Archiver X)
default 13:48:00.906502+0100 ReportCrash Parsing corpse data for process Mail Archiver X [pid 69800]
default 13:48:00.922130+0100 loginwindow -[PersistentAppsSupport applicationQuit:] | for app:Mail Archiver X, _appTrackingState = 2
default 13:48:00.922157+0100 loginwindow -[PersistentAppsSupport applicationQuit:] | App: Mail Archiver X, quit, updating active tracking timer
default 13:48:05.035038+0100 ReportCrash Saved crash report for Mail Archiver X[69800] version 6.0.0b1 (6.0.0.3.2210) to Mail Archiver X_2021-02-02-134805_MacBook-Air-von-Beatrix.crash
default 13:48:05.109756+0100 analyticsd Received event: com.apple.stability.crash {“appVersion”:“6.0.0b1”,“bundleID”:“com.mothsoftware.mailarchiverx”,“exceptionType”:13,“logwritten”:1,“process”:“Mail Archiver X”,“responsibleApp”:“Mail Archiver X”}
default 13:48:05.109563+0100 ReportCrash Sending event: com.apple.stability.crash {“appVersion”:“6.0.0b1”,“bundleID”:“com.mothsoftware.mailarchiverx”,“exceptionType”:13,“logwritten”:1,“process”:“Mail Archiver X”,“responsibleApp”:“Mail Archiver X”}
default 13:48:05.110488+0100 analyticsd Aggregated. Transform: StabilityCrashNumerator3 Dirty: 1 Event: com.apple.stability.crash {“appVersion”:“6.0.0b1”,“bundleID”:“com.mothsoftware.mailarchiverx”,“exceptionType”:13,“logwritten”:1,“process”:“Mail Archiver X”,“responsibleApp”:“Mail Archiver X”,“timestamp”:1612270085109482}
default 13:48:05.110780+0100 analyticsd Aggregated. Transform: StabilityCrashNumerator3WithIncidentID Dirty: 1 Event: com.apple.stability.crash {“appVersion”:“6.0.0b1”,“bundleID”:“com.mothsoftware.mailarchiverx”,“exceptionType”:13,“logwritten”:1,“process”:“Mail Archiver X”,“responsibleApp”:“Mail Archiver X”,“timestamp”:1612270085109482}
default 13:48:05.923708+0100 loginwindow -[PersistentAppsSupport saveLogoutPersistentState:finalSnapshot:] | previouslyRunningApps: (
{
BackgroundState = 0;
BundleID = “com.mothsoftware.mailarchiverx”;
Hide = 0;
Path = “/Users/beatrixwillius/Desktop/Mail Archiver X.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.finder”;
Hide = 0;
Path = “/System/Library/CoreServices/Finder.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.console”;
Hide = 1;
Path = “/System/Applications/Utilities/Console.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.safari”;
Hide = 1;
Path = “/Applications/Safari.app”;
},
{
BackgroundState = 2;
BundleID = “com.microsoft.to-do-mac”;
Hide = 1;
Path = “/Applications/Microsoft To Do.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.textedit”;
Hide = 1;
Path = “/System/Applications/TextEdit.app”;
},
{
BackgroundState = 2;
BundleID = “com.xojo.xojo”;
Hide = 1;
Path = “/Applications/Xojo/Xojo 2020r2.1.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.mail”;
Hide = 1;
Path = “/System/Applications/Mail.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.mobilesms”;
Hide = 1;
Path = “/System/Applications/Messages.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.preview”;
Hide = 1;
Path = “/System/Applications/Preview.app”;
},
{
BackgroundState = 2;
BundleID = “com.google.chrome”;
Hide = 1;
Path = “/Applications/Google Chrome.app”;
},
{
BackgroundState = 2;
BundleID = “net.kovidgoyal.calibre”;
Hide = 1;
Path = “/Applications/calibre.app”;
},
{
BackgroundState = 2;
BundleID = “com.apple.systempreferences”;
Hide = 1;
Path = “/System/Applications/System Preferences.app”;
}
)

I don’t need this kind of excitement. I had built the version on High Sierra before I fixed a problem with codesigning the Valentina files.

Still the hard crash is quite nasty.

M1 is usually much faster than Intel machines. Double my 2015 iMac at GeekBench.

Stack overflow usually comes from recursion. It may not show on the previous machines because they were slower, but it reaches stack overflow on that faster one.

I hope someone more versed into Apple inner workings will chime in to detect what would be the problem in that cryptic log.

I would try to get the stack in App.UnhandledException. That may show you where the crash happens.

Thanks for your thoughts, @Michel_Bujardet. I’ve already solved the problem. This was the weirdest codesign issue I ever had.

I had stackoverflow when recursive into folder and its subfolder in a thread. I was reading FolderItem.ModificationDateTime , I corrected the problem reverse back to old FolderItem.ModificationDate .
I report a Xojo bug (Feedback) but the case was closed because hard to reproduce.

What was it? Maybe I can prevent it from happening in the future?

The dylibs for Valentina were signed and with building the app I needed to resign them. But I made an error in the codesign script. What is very odd is that both spctl and the codesign check both said that the codesign was okay. App started fine on High Sierra and BS/M1 puked on the app.

Ah, I see.

I seem to recall that this was a legal thing.

By re-signing components, you are accepting responsibility for the components containing malicious code or something along those lines.

Yes, this is clear. All plugins need to be signed before using them or the world is doomed or some such.

I just was a bit astonished that checking the codesign didn’t give me an error. And having those absolute panic moments are always so much fun.

1 Like

There is actually quite a lot you can do to get a valid code signature, but the multitude other “protection” systems don’t like. My favorites are where you don’t even get an error message, I mean we all know what we did wrong right?

I am actively working on a tool to help diagnose code signing issues.

Oh and my customers and I absolutely love the false positives from the various on-line services from Apple, where it rejects your app, highlights a file, but won’t tell you why. The latest one I have, I can’t see why either.