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
[SR-16047] iOS 15.4.0 Crash in MetadataAllocator #58308
Comments
Comment by Maxime Epain (JIRA) Hey! Looks like it's related to this assertion, @mikeash, could it be? |
This turned out to be a compiler bug. Fix here: apple/llvm-project#3917 |
Comment by Alex Leffelman (JIRA) Thanks for your response! I'm not really familiar with release process/timelines for these projects, can you say anything about when/whether that compiler fix will make it into an iOS release? I'm not sure what to expect or if there are any next steps I should take here while waiting for that fix. (Additional note: In another discussion it was brought to my attention that the iOS binaries for our app were built with Xcode 13.2.1, so if the answer is that the fix has already been released in Xcode 13.3 and we should just recompile with that, that would be excellent news). |
That fix will be in a future release, but as you suspect I can't say when. Unfortunately, this compiler bug ends up affecting the Swift runtime, so the compiler you use for your own code doesn't affect it, and using 13.3 won't help. |
Today's 15.4.1 update includes this fix. |
Comment by Alex Leffelman (JIRA) Awesome, thanks for the update, @mikeash! |
are there some action to avoid this crash?I can‘t suggest user to update system when meet this crash in iOS 15.4,and threre are a lot of iOS15.4 users |
I don’t think we have a proper way of dealing with these issues. Theoretically, statically linking the standard library when deploying to iOS 15.4 specifically would solve the issue, but static linking is an all-or-nothing decision as far as I am concerned. I may be wrong. Alternatively (still ugly though), you could localize the crash, figure out a different way of expressing that code that doesn’t crash, and put it under a dynamic |
Attachment: Download
Additional Detail from JIRA
md5: 0ca327e049dfcd077837218d35cfde86
Issue Description:
We’re experiencing a set of crashes that began affecting all of our iOS releases on March 14, 2022, the day iOS 15.4.0 was released to the public. The crashes begin appearing on the same date in proportional volume to our usage on each live version of our app (see screenshot); March 14th doesn't correlate to our own release dates, so we don't believe the crashes resulted from any changes we made. We also saw that
Metadata.cpp
has a recent history of changes, which solidified our theory that a bug was shipped in Swift with the release of iOS 15.4.0. We haven't experienced the crash directly and do not have reproduction steps. Two crash logs are attached for reference, each crashing inMetadataAllocator::Allocate(unsigned long, unsigned long)
.4 libswiftCore.dylib 0x0000000185f3801c swift::fatalError(unsigned int, char const*, ...) + 140 (Errors.cpp:376)
5 libswiftCore.dylib 0x0000000185f41698 swift::MetadataAllocator::Allocate(unsigned long, unsigned long) + 516 (Metadata.cpp:6106)
6 libswiftCore.dylib 0x0000000185f421f4 _swift_getGenericMetadata(swift::MetadataRequest, void const* const*, swift::TargetTypeContextDescriptor<swift::InProcess> const*) + 1004 (Concurrent.h:1210)
We hope this can be addressed in a 15.4.1 of iOS, and we'd be interested in hearing if there may be a workaround to not trigger whatever is causing this condition. I'm happy to provide any additional information that may be helpful.
The text was updated successfully, but these errors were encountered: