Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac Catalyst symbol not found os_proc_available_memory crash #1676

Closed
braess opened this issue Jul 5, 2024 · 6 comments
Closed

Mac Catalyst symbol not found os_proc_available_memory crash #1676

braess opened this issue Jul 5, 2024 · 6 comments
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug

Comments

@braess
Copy link

braess commented Jul 5, 2024

Describe the bug

Mac Catalyst apps running on older macOS versions (10.15) are terminated on launch with a symbol not found exception:
Symbol not found: _os_proc_available_memory

Function os_proc_available_memory is available on iOS 13.0+ and Mac Catalyst 13.1+:
Apple Documentation

It looks like BSGRunContext.m UpdateTaskMemory might be incorrectly checking api availability:
BSGRunContext.m

This issue could be related or a regression of a similar problem:
Fix os_proc_available_memory runtime link error on Mac Catalyst

This crash was reported by users, unfortunately I can't reproduce it myself as I don't have macOS 10.15 anymore for testing. Below the limited information I received.

I'm not quite sure that this really is the problem, but BugSnag appears to be the only sdk using os_proc_available_memory. It would mean that Mac Catalyst apps supporting older macOS versions can't use bugsnag-cocoa at the moment.

Thanks for looking into this issue.

Steps to reproduce

  1. Integrate BugSnag as Swift package
  2. Launch macCatalyst app on macOS 10.15.7
  3. App is terminated on launch with exception

Environment

  • Bugsnag version: bugsnag-cocoa v6.28.1
  • macOS version(s): Mac OS X 10.15.7 (19H1615)
  • Physical device: MacBookPro16,2
  • Xcode version: 15.3

Crash report

- Exception
Exception Type: EXC_CRASH (SIGABRT)
Termination Reason: DYLD, [0x4] Symbol missing
Symbol not found: _os_proc_available_memory
Expected in: /usr/lib/libSystem.B.dylib

- Stacktrace
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   dyld                          	0x00000001177ce05e __abort_with_payload + 10
1   dyld                          	0x00000001177f76ed abort_with_payload_wrapper_internal + 80
2   dyld                          	0x00000001177f771f abort_with_payload + 9
3   dyld                          	0x00000001177f4d74 dyld::halt(char const*) + 463
4   dyld                          	0x000000011777cbc3 dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 140
5   libdyld.dylib                 	0x00007fff7395d692 dyld_stub_binder + 282
...
15  com.apple.UIKitCore           	0x00007fff7a3cfcad -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 312
16  com.apple.UIKitCore           	0x00007fff7a3cf527 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 5775
17  com.apple.UIKitCore           	0x00007fff7a3cc91f -[UIApplication _runWithMainScene:transitionContext:completion:] + 1319
18  com.apple.UIKitCore           	0x00007fff7a3cc328 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 179
19  com.apple.UIKitCore           	0x00007fff7af3a4d7 -[UIApplication _compellApplicationLaunchToCompleteUnconditionally] + 59
20  com.apple.UIKitCore           	0x00007fff7a3a5a8b -[UIApplication _run] + 747
21  com.apple.UIKitCore           	0x00007fff7a39a1ef UIApplicationMain + 2114
...
23  libdyld.dylib                 	0x00007fff7395ecc9 start + 1
@mclack
Copy link

mclack commented Jul 8, 2024

Hi @braess

Thanks for raising this with us. We've added a task to our backlog to investigate this further, as this is something we should be able to test for.

While I don't currently have an ETA I can share on exactly when this will be addressed, we'll make sure to post any updates here.

@mclack mclack added bug Confirmed bug backlog We hope to fix this feature/bug in the future labels Jul 8, 2024
@braess
Copy link
Author

braess commented Jul 10, 2024

Hi Milo, thanks for your quick reply. Let me know if you need any further information.

@hannah-smartbear
Copy link

Hi @braess

A fix for this has now been released in v6.30.1 of bugsnag-cocoa. Mac Catalyst targets now only attempt to call os_proc_available_memory() for version 13.1 or above of Mac Catalyst. Please let us know if you have any questions about this!

@hannah-smartbear hannah-smartbear added released This feature/bug fix has been released and removed backlog We hope to fix this feature/bug in the future labels Jul 25, 2024
@braess
Copy link
Author

braess commented Jul 28, 2024

Thanks for the update! This should solve the problem.

@braess
Copy link
Author

braess commented Aug 5, 2024

Hi @hannah-smartbear,

release v6.30.1 does not seem to resolve this issue. Mac Catalyst apps running on macOS 10.15 are still terminated on launch with the same symbol not found exception.

Only extending @available as in the current fix is probably not enough. To check for api availability in this case, the TARGET_OS_MACCATALYST macro would need to be used as well.

@hannah-smartbear
Copy link

Hi @braess

Thanks for letting us know. We’ve added another task to look into this further and consider the approach of using TARGET_OS_MACCATALYST to check for API availability. We will be sure to let you know of any updates on this.

@hannah-smartbear hannah-smartbear added backlog We hope to fix this feature/bug in the future and removed released This feature/bug fix has been released labels Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

3 participants