Skip to content

[iOS] : App crashes with dart::malloc(unsigned long) #153419

@WinJayQ

Description

@WinJayQ

Steps to reproduce

1.There is an occasional crash, the average user half a month encountered once, each crash is just opened the App.
2.We used Apple's TestFLight test, which gave us a crash log.
3.We didn't find a pattern to reproduce the problem.
crashlog.txt

Code sample

Code sample
[Paste your code here]

What target platforms are you seeing this bug on?

iOS

OS/Browser name and version | Device information

iPhone 13 Pro,iOS 16.1.2

Does the problem occur on emulator/simulator as well as on physical devices?

Unknown

Logs

Logs
Thread 0 name:
Thread 0:
0   dyld                          	0x00000001d28e92d0 dyld4::APIs::dladdr(void const*, dl_info*) + 244 (DyldAPIs.cpp:1100)
1   dyld                          	0x00000001d28e92b0 dyld4::APIs::dladdr(void const*, dl_info*) + 212 (DyldAPIs.cpp:1092)
2   Runner                        	0x0000000105608e04 bly_mach_backtrace_symbolicate + 80
3   Runner                        	0x00000001056220c4 BLYThreadBacktraceSymbolicate + 172
4   Runner                        	0x0000000105606d78 collectThreadList + 768
5   Runner                        	0x0000000105607914 BLYCrashHandlerCallback + 700
6   Runner                        	0x0000000105603d3c BLYBSDSignalHandlerCallback + 136
7   libsystem_platform.dylib      	0x00000002011dba90 _sigtramp + 56 (sigtramp.c:116)
8   libsystem_pthread.dylib       	0x00000002012761ac pthread_kill + 268 (pthread.c:1670)
9   libsystem_c.dylib             	0x00000001bb849c8c abort + 180 (abort.c:118)
10  libsystem_malloc.dylib        	0x00000001c2628f2c malloc_vreport + 908 (malloc_printf.c:220)
11  libsystem_malloc.dylib        	0x00000001c26291d0 malloc_zone_error + 100 (malloc_printf.c:258)
12  libsystem_malloc.dylib        	0x00000001c26236b0 nanov2_guard_corruption_detected + 44 (nanov2_malloc.c:2369)
13  libsystem_malloc.dylib        	0x00000001c2621acc nanov2_allocate_outlined + 388 (nanov2_malloc.c:2861)
14  libobjc.A.dylib               	0x00000001ad52e78c class_createInstance + 64 (objc-runtime-new.mm:8422)
15  libdispatch.dylib             	0x00000001bb7e5414 _os_object_alloc_realized + 32 (object.m:55)
16  libdispatch.dylib             	0x00000001bb803cac dispatch_mach_msg_create + 156 (mach.c:2966)
17  libxpc.dylib                  	0x00000002012d08a8 _xpc_serializer_pack + 288 (serializer.c:402)
18  libxpc.dylib                  	0x00000002012c2144 _xpc_connection_pack_message + 120 (connection.c:1044)
19  libxpc.dylib                  	0x00000002012c3274 xpc_connection_send_message_with_reply_sync + 128 (connection.c:1089)
20  Security                      	0x00000001bbfe09b4 securityd_message_with_reply_sync + 124 (client.c:696)
21  Security                      	0x00000001bbfeaaa4 securityd_send_sync_and_do + 88 (client.c:795)
22  Security                      	0x00000001bc091598 cftype_to_bool_cftype_error_request + 160 (SecItem.m:1624)
23  Security                      	0x00000001bbfdad4c __SecItemCopyMatching_block_invoke_2 + 200 (SecItem.m:1646)
24  Security                      	0x00000001bbfdddc4 __SecItemAuthDoQuery_block_invoke + 532 (SecItem.m:1598)
25  Security                      	0x00000001bbfdc898 SecItemAuthDoQuery + 1236 (SecItem.m:1386)
26  Security                      	0x00000001bbfdda94 __SecItemCopyMatching_block_invoke + 140 (SecItem.m:1959)
27  Security                      	0x00000001bbfe399c SecOSStatusWith + 56 (SecItem.m:331)
28  Security                      	0x00000001bbfdd95c SecItemCopyMatching + 400 (SecItem.m:1958)
29  QAXTrustSDK                   	0x000000011105e8fc -[SPSAMKeychainQuery save:] + 2280 (SPKeychainKit.m:497)
30  QAXTrustSDK                   	0x000000011105dc44 +[SPSAMKeychain setPasswordData:forService:account:error:] + 392 (SPKeychainKit.m:425)
31  QAXTrustSDK                   	0x000000011105da78 +[SPSAMKeychain setPasswordData:forService:account:] + 116 (SPKeychainKit.m:414)
32  QAXTrustSDK                   	0x0000000111061a10 +[SPKeychainKit setPasswordData:account:service:] + 360 (SPKeychainKit.m:828)
33  QAXTrustSDK                   	0x00000001114124a4 +[TrustKeychain savePrimaryTokenInfo:] + 352 (TrustKeychain.m:34)
34  QAXTrustSDK                   	0x0000000110e258b0 -[QAXTrustInterface updataLoginPrimaryTokenInfo:] + 1684 (QAXTrustInterface.m:741)
35  QAXTrustSDK                   	0x0000000110e26484 __45-[QAXTrustInterface doLoginWithParams:isMFA:]_block_invoke + 528 (QAXTrustInterface.m:912)
36  QAXTrustSDK                   	0x0000000110dd82a4 __45-[QAXTrustRpcHandler login:isMFA:completion:]_block_invoke_2 + 112 (QAXTrustRpcHandler.m:363)
37  QAXTrustSDK                   	0x000000011100e51c __44-[TrustComm doRPCRequest:completionHandler:]_block_invoke + 1800 (TrustComm.mm:811)
38  libdispatch.dylib             	0x00000001bb7e44b4 _dispatch_call_block_and_release + 32 (init.c:1518)
39  libdispatch.dylib             	0x00000001bb7e5fdc _dispatch_client_callout + 20 (object.m:560)
40  libdispatch.dylib             	0x00000001bb7f47f4 _dispatch_main_queue_drain + 928 (inline_internal.h:2632)
41  libdispatch.dylib             	0x00000001bb7f4444 _dispatch_main_queue_callback_4CF + 44 (queue.c:7887)
42  CoreFoundation                	0x00000001b42a66f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1780)
43  CoreFoundation                	0x00000001b4288058 __CFRunLoopRun + 2036 (CFRunLoop.c:3147)
44  CoreFoundation                	0x00000001b428ced4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
45  GraphicsServices              	0x00000001ed58e368 GSEventRunModal + 164 (GSEvent.c:2196)
46  UIKitCore                     	0x00000001b676b3d0 -[UIApplication _run] + 888 (UIApplication.m:3745)
47  UIKitCore                     	0x00000001b676b034 UIApplicationMain + 340 (UIApplication.m:5335)
48  Runner                        	0x0000000104930500 main + 80 (main.m:7)
49  dyld                          	0x00000001d28f8960 start + 2528 (dyldMain.cpp:1170)


......


Thread 28 name:
Thread 28 Crashed:
0   libsystem_kernel.dylib        	0x00000001f0e14200 __pthread_kill + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000002012761ac pthread_kill + 268 (pthread.c:1670)
2   libsystem_c.dylib             	0x00000001bb8a13e4 __abort + 128 (abort.c:155)
3   libsystem_c.dylib             	0x00000001bb849c98 abort + 192 (abort.c:126)
4   libsystem_malloc.dylib        	0x00000001c2628f2c malloc_vreport + 908 (malloc_printf.c:220)
5   libsystem_malloc.dylib        	0x00000001c26291d0 malloc_zone_error + 100 (malloc_printf.c:258)
6   libsystem_malloc.dylib        	0x00000001c26236b0 nanov2_guard_corruption_detected + 44 (nanov2_malloc.c:2369)
7   libsystem_malloc.dylib        	0x00000001c2621acc nanov2_allocate_outlined + 388 (nanov2_malloc.c:2861)
8   Flutter                       	0x000000011f2ff3c8 dart::malloc(unsigned long) + 4 (allocation.cc:20)
9   Flutter                       	0x000000011f2ff3c8 dart::WeakTable::Rehash() + 132 (weak_table.cc:172)
10  Flutter                       	0x000000011f245e14 dart::MessageSerializer::SetObjectId(dart::ObjectPtr, long) + 36 (message_snapshot.cc:228)
11  Flutter                       	0x000000011f245e14 dart::MessageSerializer::AssignRef(dart::ObjectPtr) + 56 (message_snapshot.cc:246)
12  Flutter                       	0x000000011f2542d4 dart::MessageSerializer::AddBaseObject(dart::ObjectPtr) + 20 (message_snapshot.cc:242)
13  Flutter                       	0x000000011f254638 dart::MessageSerializer::AddBaseObjects() + 112 (message_snapshot.cc:3222)
14  Flutter                       	0x000000011f254638 dart::MessageSerializer::Serialize(dart::Object const&) + 112 (message_snapshot.cc:3265)
15  Flutter                       	0x000000011f254638 dart::WriteMessage(bool, dart::Object const&, long long, dart::Message::Priority) + 728 (message_snapshot.cc:3432)
16  Flutter                       	0x000000011f20c6e8 dart::DN_HelperSendPort_sendInternal_(dart::Isolate*, dart::Thread*, dart::Zone*, dart::NativeArguments*) + 284 (isolate.cc:127)
17  Flutter                       	0x000000011f20c6e8 dart::BootstrapNatives::DN_SendPort_sendInternal_(dart::Thread*, dart::Zone*, dart::NativeArguments*) + 320 (isolate.cc:113)
18  Flutter                       	0x000000011f25674c dart::NativeEntry::BootstrapNativeCallWrapper(_Dart_NativeArguments*, void (*)(_Dart_NativeArguments*)) + 192 (native_entry.cc:144)
19  App                           	0x0000000127923e6c stub CallBootstrapNative + 80
20  App                           	0x000000012794ac8c SendPort._sendInternal + 56 (isolate_patch.dart:250)
21  App                           	0x0000000127947f1c _SendPort.send + 36 (isolate_patch.dart:231)
22  App                           	0x0000000127947f1c IOService._dispatch + 524 (io_service_patch.dart:65)
23  App                           	0x0000000128059dfc RawSecureSocket._pushAllFilterStages + 452 (secure_socket.dart:1145)
24  App                           	0x0000000128059484 RawSecureSocket._tryFilter + 144 (secure_socket.dart:1006)
25  App                           	0x00000001280593e0 RawSecureSocket._scheduleFilter + 44 (secure_socket.dart:991)
26  App                           	0x000000012805b298 RawSecureSocket._readHandler + 48 (secure_socket.dart:865)
27  App                           	0x000000012805b1a0 RawSecureSocket._eventDispatcher + 56 (secure_socket.dart:852)
28  App                           	0x000000012805b740 RawSecureSocket._eventDispatcher (#2) + 48 (secure_socket.dart:849)
29  App                           	0x00000001279359c0 rootRunUnary + 148 (zone.dart:1415)
30  App                           	0x0000000127935a84 rootRunUnary (#2) + 132
31  App                           	0x000000012889cdc8 CustomZone.runUnary + 168 (zone.dart:1308)
32  App                           	0x000000012889d430 CustomZone.runUnaryGuarded + 116 (zone.dart:1217)
33  App                           	0x0000000128818fb4 BufferingStreamSubscription._sendData + 188 (stream_impl.dart:339)
34  App                           	0x00000001287f9038 BufferingStreamSubscription._add (#3) + 148 (stream_impl.dart:271)
35  App                           	0x00000001287f8f44 _SyncStreamControllerDispatch._sendData + 28 (stream_controller.dart:784)
36  App                           	0x00000001287f8f44 StreamController._add (#3) + 208 (stream_controller.dart:658)
37  App                           	0x0000000127bf61c0 StreamController.add (#3) + 124 (stream_controller.dart:606)
38  App                           	0x00000001279e884c new _RawSocket.<anonymous closure> (#4) + 56 (socket_patch.dart:1936)
39  App                           	0x00000001279e9a08 NativeSocket.issueReadEvent.issue + 292 (socket_patch.dart:1379)
40  App                           	0x0000000127933a20 microtaskLoop + 116 (schedule_microtask.dart:40)
41  App                           	0x0000000127933920 startMicrotaskLoop (#2) + 40 (schedule_microtask.dart:49)
42  App                           	0x00000001279338e4 startMicrotaskLoop + 24 (schedule_microtask.dart:44)
43  App                           	0x0000000127923b74 stub InvokeDartCode + 216
44  Flutter                       	0x000000011f232e28  + -1 (dart_entry.cc:125)
45  Flutter                       	0x000000011f34c930  + -1 (dart_api_impl.cc:4816)
46  Flutter                       	0x000000011f048050 tonic::DartMicrotaskQueue::RunMicrotasks() + 212 (dart_microtask_queue.cc:77)
47  Flutter                       	0x000000011ef151a4 std::_fl::__function::__value_func<void ()>::operator()[abi:v15000]() const + 20 (function.h:512)
48  Flutter                       	0x000000011ef151a4 std::_fl::function<void ()>::operator()() const + 20 (function.h:1187)
49  Flutter                       	0x000000011ef151a4 fml::MessageLoopImpl::FlushTasks(fml::FlushType) + 1236 (message_loop_impl.cc:130)
50  Flutter                       	0x000000011ef186bc fml::MessageLoopImpl::RunExpiredTasksNow() + 8 (message_loop_impl.cc:139)
51  Flutter                       	0x000000011ef186bc fml::MessageLoopDarwin::OnTimerFire(__CFRunLoopTimer*, fml::MessageLoopDarwin*) + 32 (message_loop_darwin.mm:85)
52  CoreFoundation                	0x00000001b42da35c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1797)
53  CoreFoundation                	0x00000001b42969d8 __CFRunLoopDoTimer + 940 (CFRunLoop.c:2402)
54  CoreFoundation                	0x00000001b423a598 __CFRunLoopDoTimers + 288 (CFRunLoop.c:2560)
55  CoreFoundation                	0x00000001b4287fcc __CFRunLoopRun + 1896 (CFRunLoop.c:3120)
56  CoreFoundation                	0x00000001b428ced4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
57  Flutter                       	0x000000011ef187a8  + -1 (message_loop_darwin.mm:51)
58  Flutter                       	0x000000011ef17e20  + -1 (:-1)
59  libsystem_pthread.dylib       	0x00000002012706cc _pthread_start + 148 (pthread.c:893)
60  libsystem_pthread.dylib       	0x000000020126fba4 thread_start + 8 (:-1)

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.19.5, on macOS 14.6 23G80 darwin-arm64, locale zh-Hans-CN)
    • Flutter version 3.19.5 on channel stable at
      /Users/quwenjie/Documents/FlutterSDK/flutter_3.19.5
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 300451adae (5 months ago), 2024-03-27 21:54:07 -0500
    • Engine revision e76c956498
    • Dart version 3.3.3
    • DevTools version 2.31.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/quwenjie/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.92.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • dev的iPhone14 (mobile)      • 00008110-001225C81A3A401E                • ios            • iOS
      17.5.1 21F90
    • dev的iPhone15Pro (mobile)   • 00008130-000E0D0C01F0001C                • ios            • iOS
      17.5.1 21F90
    • macOS (desktop)            • macos                                    • darwin-arm64   • macOS
      14.6 23G80 darwin-arm64
    • Chrome (web)               • chrome                                   • web-javascript •
      Google Chrome 127.0.6533.100

[✓] Network resources
    • All expected network resources are available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: productionIssues experienced in live production appsc: crashStack traces logged to the consoledependency: dartDart team may need to help usdependency:dart-triagedTriaged by Dart teamneeds repro infoAutomated crash report whose cause isn't yet knownplatform-iosiOS applications specificallyr: solvedIssue is closed as solvedteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions