Skip to content

ICU causes crash, when running on Mac (.NET8) #115928

@i-nikityuk

Description

@i-nikityuk

Description

Firebase.Crashlytics library requires "_ExportSymbolsExplicitly" set to "false" for net8.0-ios TFMs to avoid issues with crash reporting.
see here

However installing IPA on Mac silicon with such key causing ICU crash.
Removing "_ExportSymbolsExplicitly" at build time is impossible as I can't predict if app will be run on iOS or Mac or both.

Thread 10 Crashed:: Dispatch queue: com.google.fira.worker
0 libsystem_kernel.dylib 0x182709388 __pthread_kill + 8
1 libsystem_pthread.dylib 0x18274288c pthread_kill + 296
2 libsystem_c.dylib 0x18264bc60 abort + 124
3 Firebase.Test.iOS 0x100d99000 sigabrt_signal_handler.cold.1 + 48 (mini-posix.c:248)
4 Firebase.Test.iOS 0x100d5c824 sigabrt_signal_handler + 196 (mini-posix.c:246)
5 Firebase.Test.iOS 0x100495164 FIRCLSSignalSafeInstallPreexistingHandlers + 244
6 Firebase.Test.iOS 0x100494f28 FIRCLSSignalHandler + 564
7 libsystem_platform.dylib 0x18277c624 _sigtramp + 56
8 libsystem_pthread.dylib 0x18274288c pthread_kill + 296
9 libsystem_c.dylib 0x18264bc60 abort + 124
10 libsystem_malloc.dylib 0x182550174 malloc_vreport + 892
11 libsystem_malloc.dylib 0x182553c90 malloc_report + 64
12 libsystem_malloc.dylib 0x18255821c ___BUG_IN_CLIENT_OF_LIBMALLOC_POINTER_BEING_FREED_WAS_NOT_ALLOCATED + 32
13 libicucore.A.dylib 0x185f9dad8 icu::Locale::setToBogus() + 52
14 libicucore.A.dylib 0x185f9de40 icu::Locale::operator=(icu::Locale const&) + 40
15 libicucore.A.dylib 0x186109800 icu::number::LocalizedNumberFormatter::LocalizedNumberFormatter(icu::number::impl::MacroProps&&, icu::Locale const&) + 212
16 libicucore.A.dylib 0x1860a8390 icu::DecimalFormat::touch(UErrorCode&) + 240
17 libicucore.A.dylib 0x1860a8d78 icu::DecimalFormat::DecimalFormat(icu::UnicodeString const&, icu::DecimalFormatSymbols*, UNumberFormatStyle, UErrorCode&) + 424
18 libicucore.A.dylib 0x18612710c icu::NumberFormat::makeInstance(icu::Locale const&, UNumberFormatStyle, signed char, UErrorCode&) + 1668
19 libicucore.A.dylib 0x1861268c0 icu::LocaleCacheKeyicu::SharedNumberFormat::createObject(void const*, UErrorCode&) const + 88
20 libicucore.A.dylib 0x186029948 icu::UnifiedCache::_get(icu::CacheKeyBase const&, icu::SharedObject const*&, void const*, UErrorCode&) const + 168
21 libicucore.A.dylib 0x186072bd0 0x185f7e000 + 1002448
22 libicucore.A.dylib 0x186126a28 0x185f7e000 + 1739304
23 libicucore.A.dylib 0x1861262f0 icu::NumberFormat::createInstance(icu::Locale const&, UNumberFormatStyle, UErrorCode&) + 64
24 libicucore.A.dylib 0x1861b9d64 unum_open + 360
25 CoreFoundation 0x1828574e0 __cficu_unum_open + 64
26 CoreFoundation 0x1828570a0 CFNumberFormatterCreate + 276
27 Foundation 0x183e1b568 -[NSNumberFormatter _regenerateFormatter] + 232
28 Foundation 0x183e767ac -[NSNumberFormatter decimalSeparator] + 292
29 Foundation 0x183e295ec getObjectValue + 436
30 Foundation 0x183e76378 -[NSNumberFormatter getObjectValue:forString:errorDescription:] + 312
31 Foundation 0x183e6086c -[NSNumberFormatter numberFromString:] + 56
32 Firebase.Test.iOS 0x100439208 -[APMRemoteConfig numberFromString:] + 68
33 Firebase.Test.iOS 0x100439460 -[APMRemoteConfig numberFromCacheWithKey:defaultValue:maxValue:minValue:block:] + 304
34 Firebase.Test.iOS 0x10043975c -[APMRemoteConfig intValueFromCacheWithKey:defaultValue:maxValue:minValue:] + 160
35 Firebase.Test.iOS 0x1003c1b10 +[APMDataTypeValidator isValidPublicEventParameterValue:failureCode:] + 68
36 Firebase.Test.iOS 0x1003cfaa0 APMNormalizedParametersForParametersAndEventName + 476
37 Firebase.Test.iOS 0x1003cbd38 -[APMEvent initWithOrigin:isPublic:name:timestamp:previousTimestamp:parameters:] + 360
38 Firebase.Test.iOS 0x1003e3294 -[APMMeasurement logEventOnWorkerQueueWithOrigin:isPublicEvent:name:parameters:timestamp:enabled:ignoreEnabled:ignoreInterceptor:interceptor:addedScreenParameters:] + 224
39 Firebase.Test.iOS 0x1003e3154 __151-[APMMeasurement logEventWithOrigin:isPublicEvent:name:parameters:timestamp:enabled:ignoreEnabled:ignoreInterceptor:interceptor:addedScreenParameters:]_block_invoke + 60
40 Firebase.Test.iOS 0x100439d34 __51-[APMScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 44
41 libdispatch.dylib 0x18258ab2c _dispatch_call_block_and_release + 32
42 libdispatch.dylib 0x1825a485c _dispatch_client_callout + 16
43 libdispatch.dylib 0x182593350 _dispatch_lane_serial_drain + 740
44 libdispatch.dylib 0x182593e2c _dispatch_lane_invoke + 388
45 libdispatch.dylib 0x18259e264 _dispatch_root_queue_drain_deferred_wlh + 292
46 libdispatch.dylib 0x18259dae8 _dispatch_workloop_worker_thread + 540
47 libsystem_pthread.dylib 0x18273ee64 _pthread_wqthread + 292
48 libsystem_pthread.dylib 0x18273db74 start_wqthread + 8

Reproduction Steps

Minimal project zip file is around 35MB as it is using non-public binding libraries for Firebase. I couldn't attach it here (seems too big). Let me know if you need a sample project and where I can send it to.

Steps to replicate:

  1. Update "GoogleService-Info.plist" file
  2. Update "Bundle identifier" in Info.plist
  3. Build test project: (dotnet publish Firebase.Test.iOS.csproj -f net8.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64)
  4. Install IPA on Mac
  5. BOOM

full_crash_report.txt

Expected behavior

No crash

Actual behavior

Crash

Regression?

"_ExportSymbolsExplicitly" is a workaround for NET8 builds, NET7 works fine

Known Workarounds

  1. Build using net9.0-ios TFM (.NET 9.0.300 works for me)
  2. Remove "_ExportSymbolsExplicitly(false)" from project file (Crash reporting will stop working)

Configuration

.NET SDK:
Version: 9.0.300
Commit: 15606fe0a8
Workload version: 9.0.300-manifests.87b8cca8
MSBuild version: 17.14.5+edd3bbf37

Runtime Environment:
OS Name: Mac OS X
OS Version: 15.5
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/9.0.300/

.NET workloads installed:
[ios]
Installation Source: SDK 9.0.300
Manifest Version: 18.4.9289/9.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.ios/18.4.9289/WorkloadManifest.json
Install Type: FileBased

[maccatalyst]
Installation Source: SDK 9.0.300
Manifest Version: 18.4.9289/9.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maccatalyst/18.4.9289/WorkloadManifest.json
Install Type: FileBased

[android]
Installation Source: SDK 9.0.300
Manifest Version: 35.0.61/9.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.android/35.0.61/WorkloadManifest.json
Install Type: FileBased

Configured to use loose manifests when installing new manifests.

Host:
Version: 9.0.5
Architecture: arm64
Commit: e36e4d1

.NET SDKs installed:
8.0.409 [/usr/local/share/dotnet/sdk]
9.0.300 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.16 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.16 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
x64 [/usr/local/share/dotnet/x64]
registered at [/etc/dotnet/install_location_x64]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions