Skip to content

[RealmCollectionImpl] annotate internal methods to avoid dyld crash - #8824

Open
ThomasAWRaku wants to merge 1 commit into
realm:communityfrom
ThomasAWRaku:bugfix/inline_crash
Open

[RealmCollectionImpl] annotate internal methods to avoid dyld crash#8824
ThomasAWRaku wants to merge 1 commit into
realm:communityfrom
ThomasAWRaku:bugfix/inline_crash

Conversation

@ThomasAWRaku

Copy link
Copy Markdown

I was seeing a crash after migrating from Carthage to SPM. The crash doesn't occur with a simple test project, but does occur with a large app that includes many modules and libraries that use RealmSwift. When this crash occurs the following is logged on launch:

dyld[31956]: Symbol not found: _$s10RealmSwift7ResultsVyxGAA0A14CollectionImplAAMc
  Referenced from: <CA2BB602-C363-37B9-A568-54CC4C3267C6> /Users/<user>/Library/Developer/Xcode/DerivedData/OneApp-dgeqzukjzdnhcfeyiwctkbxaxuxc/Build/Products/EnterprisePreProd-iphonesimulator/NVIOSSDK.framework/NVIOSSDK
  Expected in:     <58DD162C-52B4-3DE7-91B4-17ED89341E11> /Users/<user>/Library/Developer/Xcode/DerivedData/OneApp-dgeqzukjzdnhcfeyiwctkbxaxuxc/Build/Products/EnterprisePreProd-iphonesimulator/PackageFrameworks/RealmSwift.framework/RealmSwift

The unmangled version of that symbol is protocol conformance descriptor for RealmSwift.Results<A> : RealmSwift.RealmCollectionImpl in RealmSwift.

Here are some other reports of a similar problem:
#8402
#8779
https://stackoverflow.com/questions/79512813/using-realmswift-in-a-framework-most-symbols-found-but-not-all

For our usage of RealmSwift, this crash is fixed by adding the @usableFromInline annotation to about 8 internal methods in RealmSwift.

ProductName:		macOS
ProductVersion:		15.7.4
BuildVersion:		24G517

/Applications/Xcode.app/Contents/Developer
Xcode 26.2
Build version 17C52

/Users/<user>/.rbenv/shims/pod
1.16.2

/bin/bash
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin24)

/opt/homebrew/bin/carthage
0.40.0
(not in use here)

/opt/homebrew/bin/git
git version 2.51.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant