Closed gshahbazian closed 3 years ago
Seems error is due this line: https://github.com/apple/swift/blob/main/stdlib/public/core/UnicodeHelpers.swift#L266
As I understand it is due UTF16 encoding. Probably your device (Pixel 4) has a non-latin language/encoding which cannot be processed by Swift.
@vgorloff Do you know what language or encoding to check for this? The device language is set to English. Note this crash does not occur if I set the SDK Version to 28 and run on the same device.
Not sure. Unicode is a complex topic. The quick look on Swift sources showing not too much.
@vgorloff Thanks. I'm wondering if you are able to reproduce the issue? Currently it only happens for me on a Pixel 4 running Android 11, our Galaxy S20 running Android 10 and emulator running Android 11 do not have the issue.
I ran into this as well. Was able to resolve by adding android:allowNativeHeapPointerTagging="false"
to the AndroidManifest.xml per this link.
Per the release notes...
Heap pointers now have a non-zero tag in the most significant byte (MSB). Applications that use pointers incorrectly, including those that modify the MSB, can now crash or experience other issues. This change is necessary to support future hardware with ARM Memory Tagging Extension (MTE) enabled. To learn more, see Tagged Pointers.
To disable this feature, see the allowNativeHeapPointerTagging manifest documentation.
Thank you for that pointer @Molanda! That flag also fixes the problem for me.
I found some discussion in the Swift forums about this.
I'm trying to get a fix upstreamed for this, apple/swift#40779, @vgorloff, try it out and let me know.
Seems it is fixed in Swift 5.6.1 https://github.com/apple/swift/pull/40779
No, that patch has not been merged in the 5.6 branch yet, apple/swift#42178.
Hello! I'm running into this crash when setting our project to use
compileSdkVersion
andtargetSdkVersion
30. This can also be reproduced by using the sample project (at https://github.com/vgorloff/swift-everywhere-samples/tree/55797008c69382f74e0fa492d2917a93c06852e4) and changing build.gradle to sdk 30.Crash that occurs:
Note that the crash does not occur in an emulator only when running on device (Pixel 4).