Electron App EXC_BREAKPOINT (SIGTRAP) Namespace SIGNAL Thread 0 Crashed FatalProcessOutOfMemory

Electron App EXC_BREAKPOINT (SIGTRAP) Namespace SIGNAL Thread 0 Crashed FatalProcessOutOfMemory

Hello, I have an Electron app that took a while to get deployed to Testflight.

I ended up having to:

  • manually remove "print" and "sandbox" related entitlements, recreate certificate signing requests and certificates, and get the appropriate provisioning profiles
  • run electron-osx-sign out/Thea-mas-x64/Thea.app --identity='3rd Party Mac Developer Application' --entitlements=entitlements.plist --provisioning-profile=Thea11072024.provisionprofile --platform=mas --no-pre-auto-entitlements
    • after manually adjusting entitlements.plist to what we need
  • run productbuild --sign "3rd Party Mac Developer Installer: Govinda Dasu" --component out/Thea-mas-x64/Thea.app/ /Applications "Thea.pkg"
  • upload Thea.pkg to the Transporter app

Finally after 30-40 hours of investigation, given missing documentation on electron's website, I managed a successful to Testflight.

However, when I try to open the app I get the following error

Translated Report (Full Report Below)
-------------------------------------
Process:               Thea [29595]
Path:                  /Applications/Thea.app/Contents/MacOS/Thea
Identifier:            com.ldtalentwork.thea
Version:               1.0.15 (1.0.15)
App Item ID:           1623683489
Code Type:             X86-64 (Native)
Parent Process:        launchd [1]
User ID:               501
Date/Time:             2023-11-14 09:23:27.0219 +0545
OS Version:            macOS 13.5 (22G74)
Report Version:        12
Bridge OS Version:     7.6 (20P6072)
Anonymous UUID:        
Sleep/Wake UUID:       14139C75-C5B8-4ACD-AEE5-64B8651D5115
Time Awake Since Boot: 220000 seconds
Time Since Wake:       70911 seconds
System Integrity Protection: enabled
Crashed Thread:        0  Dispatch queue: com.apple.main-thread
Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000002, 0x0000000000000000
Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [29595]
Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   Electron Framework                     0x11bbe51b3 node::AsyncResource::get_async_id() const + 28112899
1   Electron Framework                     0x118b1d365 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) + 1013
2   Electron Framework                     0x118b1d1d4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) + 612
3   Electron Framework                     0x118ce4bd7 v8::internal::Heap::StartIncrementalMarking(int, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) + 983
4   Electron Framework                     0x118d69eb0 v8::internal::MemoryAllocator::Unmapper::EnsureUnmappingCompleted() + 1200
5   Electron Framework                     0x118d6a090 v8::internal::MemoryAllocator::Unmapper::EnsureUnmappingCompleted() + 1680
6   Electron Framework                     0x118d6a516 v8::internal::MemoryAllocator::AllocatePage(v8::internal::MemoryAllocator::AllocationMode, v8::internal::Space*, v8::internal::Executability) + 86
7   Electron Framework                     0x118d7a82e v8::internal::PagedSpaceBase::Expand() + 46
8   Electron Framework                     0x118d7bda0 v8::internal::PagedSpaceBase::RawRefillLabMain(int, v8::internal::AllocationOrigin) + 1152
9   Electron Framework                     0x118d7b911 v8::internal::PagedSpaceBase::RefillLabMain(int, v8::internal::AllocationOrigin) + 33
10  Electron Framework                     0x118cd8091 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) + 769
11  Electron Framework                     0x1191b4a74 v8::internal::Deserializer<v8::internal::Isolate>::ReadObject(v8::internal::SnapshotSpace) + 996
12  Electron Framework                     0x1191b7b71 v8::internal::Deserializer<v8::internal::Isolate>::ReadData(v8::internal::Handle<v8::internal::HeapObject>, int, int) + 4657
13  Electron Framework                     0x1191b6896 v8::internal::Deserializer<v8::internal::Isolate>::VisitRootPointers(v8::internal::Root, char const*, v8::internal::FullObjectSlot, v8::internal::FullObjectSlot) + 54
14  Electron Framework                     0x118cee9d8 v8::internal::Heap::InSpaceSlow(unsigned long, v8::internal::AllocationSpace) const + 568
15  Electron Framework                     0x1191cb2b8 v8::internal::WarmUpSnapshotDataBlobInternal(v8::StartupData, char const*) + 504
16  Electron Framework                     0x118c6fecc v8::internal::Isolate::Init(v8::internal::SnapshotData*, v8::internal::SnapshotData*, v8::internal::SnapshotData*, bool) + 2972
...

I even stripped down the app to just a hello-world app and I still get this error:

Translated Report (Full Report Below)
-------------------------------------
Process:               Thea [16362]
Path:                  /Applications/Thea.app/Contents/MacOS/Thea
Identifier:            com.ldtalentwork.thea
Version:               1.0.17 (1.0.17)
App Item ID:           1623683489
Code Type:             X86-64 (Native)
Parent Process:        launchd [1]
User ID:               501
Date/Time:             2023-12-11 16:17:55.2204 -0600
OS Version:            macOS 13.5 (22G74)
Report Version:        12
Bridge OS Version:     7.6 (20P6072)
Anonymous UUID:        
Sleep/Wake UUID:       7346D434-BDEE-483B-B37F-EBE27703730F
Time Awake Since Boot: 1200000 seconds
Time Since Wake:       33514 seconds
System Integrity Protection: enabled
Crashed Thread:        0  Dispatch queue: com.apple.main-thread
...

I have looked into the following resources briefly but none look like promising approaches and I am not sure what to try.

Can eskimo or someone at Apple please help? Thank you.

Post not yet marked as solved Up vote post of SridharaDasu Down vote post of SridharaDasu
706 views
  • To provide more context, I tried security find-identity -p codesigning -v but it only prints my Developer ID Application and not my Developer ID Installer, even though I saw the Developer ID Installer in Xcode and in Keychain Access.

    Hence what I think might be happening is that there is an issue on the Apple end with my Developer ID Installer certificate itself.

    Sridhara & Govinda Dasu
Add a Comment

Replies

It’s hard to say what’s going on here without knowing why v8::internal::Heap::StartIncrementalMarking(…) is trapping. Given that this isn’t Apple code, I don’t have any insight into that. My general advice is that you escalate questions about third-party libraries to the vendor. In this case it sounds like you’ve tried that, to no avail. If I were in your shoes, my next step would be to look at the source for this routine to work out what’s actually failing.

If you can track this down to some Apple API, I should be able to offer more advice based on that.

Share and Enjoy

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

Thank you so much for your answer. Yes - knowing why that traps would be helpful, but I actually I think I discovered an issue that may be causing all this. After making the app, it works fine and prints Hello world - both the MAS .app and the pkg work.

However, after running:

electron-osx-sign out/Thea-mas-x64/Thea.app --identity='3rd Party Mac Developer Application' --entitlements=entitlements.plist --provisioning-profile=Thea11072024.provisionprofile --platform=mas --no-pre-auto-entitlements

I tried it without --no-pre-auto-entitlements but no difference. By the way I am pretty sure osx-sign is using codesign under the hood.

Then clicking on MAS .app no longer works and it gives us this error:

Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: 526F2C25-10CD-41EE-9D79-88A664304EFD
CrashReporter Key:   C9688684-833E-6290-40E6-2EBFB18D3C42
Hardware Model:      MacBookPro15,1
Process:             Thea [53001]
Path:                /Users/USER/Desktop/*/Thea.app/Contents/MacOS/Thea
Identifier:          com.ldtalentwork.thea
Version:             1.0.18 (1.0.18)
Code Type:           X86-64 (Native)
Role:                Default
Parent Process:      launchd [1]
Coalition:           com.ldtalentwork.thea [171678]

Date/Time:           2023-12-19 17:39:39.5882 -0600
Launch Time:         2023-12-19 17:39:39.4860 -0600
OS Version:          macOS 13.5 (22G74)
Release Type:        User
Report Version:      104

Exception Type:  EXC_CRASH (SIGKILL (Code Signature Invalid))
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: CODESIGNING 1 Taskgated Invalid Signature

Triggered by Thread:  0

Thread 0 Crashed:
0   ???                           	       0x112640070 _dyld_start + 0
1                                 	       0x10d77e000 ???


Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000000  rcx: 0x0000000000000000  rdx: 0x0000000000000000
  rdi: 0x0000000000000000  rsi: 0x0000000000000000  rbp: 0x0000000000000000  rsp: 0x00007ff7b2781b78
   r8: 0x0000000000000000   r9: 0x0000000000000000  r10: 0x0000000000000000  r11: 0x0000000000000000
  r12: 0x0000000000000000  r13: 0x0000000000000000  r14: 0x0000000000000000  r15: 0x0000000000000000
  rip: 0x0000000112640070  rfl: 0x0000000000000200  cr2: 0x0000000000000000
  
Logical CPU:     0
Error Code:      0x00000000 
Trap Number:     0


Binary Images:
       0x11263b000 -        0x1126d6fff ??? (*) <31e1c182-e611-3883-97a3-4334a21c90bd> ???
       0x10d77e000 -        0x10d77ffff  (*) <4c4c441a-5555-3144-a113-99eac23befd3> ???

Error Formulating Crash Report:
dyld_process_snapshot_get_shared_cache failed

EOF

Is this normal that after codesigning the .app, it should no longer be openable. Moreover, I noticed that after running the electron-osx-sign command the .app file and the .pkg file were not modified at all.

Despite the .app file not being modified, it no longer worked after running osx-sign.

Might this be the issue? I tried to look this issue up:

https://forums.developer.apple.com/forums/thread/698870 https://github.com/electron/osx-sign/issues/61

But I don't think I have found any solution that might work.

Here is how my entitlements.plist looks:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.security.app-sandbox</key>
	<true/>
	<key>com.apple.security.device.camera</key>
	<true/>
    <key>com.apple.security.device.audio-input</key>
    <true/>
	<key>com.apple.security.network.client</key>
	<true/>
	<key>com.apple.security.network.server</key>
	<true/>
    <key>com.apple.security.cs.allow-jit</key>
    <true/>
    <key>com.apple.security.cs.debugger</key>
    <true/>
	<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
	<true/>
    <key>com.apple.application-identifier</key>
	<string>626S3G94S4.com.ldtalentwork.thea</string>
	<key>com.apple.developer.team-identifier</key>
	<string>626S3G94S4</string>
</dict>
</plist>

And I just created a certificate signing request in keychain access and then just downloaded the 3rd Party Mac Developer Application and put it in keychain access, so I am not sure how anything could be wrong.

Let me know if you have any ideas on what I can try.

I have this same exact issue, same stack trace and it only occurs after signing. Please let me know if you have found any solution!

And to clarify: the error occurs with the build I install in Testflight. I know it shouldn't work locally after signing.

I have an issue when I signed app and upload it with Transporter to Apple Portal. App is running correctly without signing.

I signed with --osx-sign and after productbuild or electron-osx-flat to package the app for Transporter.

Did you solved your issue ?

is it resolved ? similar issue is occurring in my scenario. Help is appreciated. Sharing details here.

https://developer.apple.com/forums/thread/744571?page=1#776901022

Build metadata is Entitlements Naukri Launcher.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib com.apple.security.app-sandbox: true com.apple.security.inherit: true Naukri Launcher.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework com.apple.security.app-sandbox: true com.apple.security.inherit: true Naukri Launcher.app/Contents/MacOS/Naukri Launcher com.apple.application-identifier: XXXXXX.com.naukri.securelogin com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: XXXXXX com.apple.security.application-groups: ( "XXXXXX.com.naukri.securelogin" ) com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.network.client: true com.apple.security.cs.allow-dyld-environment-variables: true Naukri Launcher.app/Contents/Library/LoginItems/Naukri Launcher Login Helper.app/Contents/MacOS/Naukri Launcher Login Helper com.apple.security.app-sandbox: true com.apple.security.inherit: true Naukri Launcher.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib com.apple.security.app-sandbox: true com.apple.security.inherit: true Naukri Launcher.app/Contents/Frameworks/Naukri Launcher Helper.app/Contents/MacOS/Naukri Launcher Helper com.apple.security.app-sandbox: true com.apple.security.inherit: true Naukri Launcher.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libvk_swiftshader.dylib com.apple.security.app-sandbox: true com.apple.security.inherit: true Naukri Launcher.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libEGL.dylib com.apple.security.app-sandbox: true com.apple.security.inherit: true Naukri Launcher.app/Contents/Frameworks/Naukri Launcher Helper (GPU).app/Contents/MacOS/Naukri Launcher Helper (GPU) com.apple.security.app-sandbox: true com.apple.security.inherit: true Naukri Launcher.app/Contents/Frameworks/Naukri Launcher Helper (Renderer).app/Contents/MacOS/Naukri Launcher Helper (Renderer) com.apple.security.app-sandbox: true com.apple.security.inherit: true Naukri Launcher.app/Contents/Frameworks/Naukri Launcher Helper (Plugin).app/Contents/MacOS/Naukri Launcher Helper (Plugin) com.apple.security.app-sandbox: true com.apple.security.inherit: true

build package.json are { "name": "naukri-login-app", "version": "1.1.11", "description": "naukri-login-app", "productName": "Naukri Launcher", "main": "app/min/main.js", "author": "Naukri ", "homepage": "recruit.naukri.com", "publisher": "recruit.naukri.com", "email": "", "scripts": { "start": "electron app/src/main.js", "git-cleangen": "git filter-branch -f --index-filter 'git rm -rf --cached --ignore-unmatch gen' -- --all && npm run remove-all-git-refs", "remove-all-git-refs": "rm -rf .git/refs/original/ && git reflog expire --expire=now --all && git gc --prune=now && git gc --aggressive --prune=now", "electron-build": "node electron-build.js", "build": "npm run minify-js && electron-builder", "minify-js": "javascript-obfuscator ./app/src --output app/min", "build-win": "node scripts/build.js --env=win", "build-mac": "node scripts/build.js --env=mac", "build-linux": "node scripts/build.js --env=linux", "package-mac": "electron-packager . --overwrite --platform=darwin --arch=x64 --icon=app/src/assets/icons/mac/icon.icns --prune=true --out=release-builds", "package-win": "electron-packager . secure-login --overwrite --asar=true --platform=win32 --arch=ia32 --icon=app/src/assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=Naukri --version-string.FileDescription=CE --version-string.ProductName="Recruiter Login App"", "package-linux": "electron-packager . recruiter-initiator-app --overwrite --asar=true --platform=linux --arch=x64 --icon=app/src/assets/icons/linux/icon.png --prune=true --out=release-builds" }, "build": { "appId": "com.xxxxx.securelogin", "artifactName": "naukri-launcher.${ext}", "directories": { "output": "gen/${platform}/${arch}", "buildResources": "gen/installers/${platform}" }, "files": [ "!gen", "!app/src" ], "protocols": { "name": "naukri-recruiter", "schemes": [ "deeplink" ] }, "publish": [ { "provider": "generic", "url": "https://static.naukimg.com/s/7/111/$%7Bplatform%7D/$%7Barch%7D/" } ], "afterSign": "./build/notarize.js", "mac": { "type": "distribution", "target": ["mas"], "category": "public.app-category.business", "icon": "build/icons/mac/icon.icns", "entitlements": "build/entitlements.mas.plist", "provisioningProfile": "/Users/akhilgoel/Downloads/NL_MAS_distribution.provisionprofile", "extendInfo": { "ElectronTeamID":"XXXXXX", "ITSAppUsesNonExemptEncryption": "NO", "NSMicrophoneUsageDescription": "Allow microphone access to take audio input for login form" } }, "mas": { "entitlements": "build/entitlements.mas.plist", "entitlementsInherit": "build/entitlements.mas.inherit.plist", "entitlementsLoginHelper":"build/entitlements.mas.loginhelper.plist", "provisioningProfile": "/Users/akhilgoel/Downloads/NL_MAS_distribution.provisionprofile" }, "win": { "target": "nsis", "icon": "build/icons/win/icon.ico" }, "nsis": { "oneClick": false }, "linux": { "category": "your.app.office.type", "target": "AppImage", "icon": "build/icons/linux/icon.png", "mimeTypes": [ "x-scheme-handler/naukri-recruiter" ], "desktop": { "MimeType": "x-scheme-handler/naukri-recruiter" } } }, "devDependencies": { "@electron-forge/cli": "^6.0.3", "electron": "^19.0.0", "electron-builder": "^23.6.0", "electron-builder-squirrel-windows": "^24.0.0-alpha.11", "electron-installer-dmg": "^4.0.0", "electron-notarize": "^1.2.2", "electron-rebuild": "^3.2.9", "electron-winstaller": "^5.1.0", "javascript-obfuscator": "^4.0.2" }, "dependencies": { "@electron/asar": "^3.2.2", "axios": "^1.2.0", "electron-squirrel-startup": "^1.0.0", "electron-store": "^8.1.0", "electron-updater": "^5.3.0", "fs": "0.0.1-security", "getmac": "^5.20.0", "jsencrypt": "^3.3.2", "macaddress": "^0.5.3" } }

This is occurring applicable for TestFlight too

I guessed that maybe the older versions of electron and forge don't work anymore. So I decided to literally try setting up the tutorial app on https://www.electronjs.org/docs/latest/

While going through the steps I noticed that here https://www.electronjs.org/docs/latest/tutorial/tutorial-packaging, they say that you should follow electron forge's docs' code-signing-macos section.

And there I noticed it recommends us to have a Developer ID Installer. Now I tried security find-identity -p codesigning -v but it only prints my Developer ID Application and not my Developer ID Installer, even though I saw the Developer ID Installer in Xcode and in Keychain Access. Hence, I am confused.

I am all out of Developer ID Installer certificates and none of them work, so I think I need to ask apple to revoke them all so I can retry with fresh ones. I will try emailing product-security AT apple.com