objectbox / objectbox-dart

Flutter database for super-fast Dart object persistence
https://docs.objectbox.io/getting-started
Apache License 2.0
927 stars 115 forks source link

Mac app was crashed by objectbox #626

Open MegatronKing opened 3 weeks ago

MegatronKing commented 3 weeks ago

Is there an existing issue?

Build info

Logs ```console Thread 5 Crashed:: io.flutter.ui\ 0 ??? 000000000000000000 0 + 0\ 1 io.objectbox.ObjectBox 0x0000000102060294 0x101fd4000 + 574100\ 2 io.objectbox.ObjectBox 0x000000010206208c 0x101fd4000 + 581772\ 3 io.objectbox.ObjectBox 0x0000000102061e6c 0x101fd4000 + 581228\ 4 io.objectbox.ObjectBox 0x0000000102061da0 0x101fd4000 + 581024\ 5 io.objectbox.ObjectBox 0x0000000102013c84 obx_model_property + 200\ 6 io.flutter.flutter.app 0x00000001104064b8 kDartVmSnapshotInstructions + 21752\ 7 io.flutter.flutter.app 0x0000000110e85f98 kDartIsolateSnapshotInstructions + 10988696\ 8 io.flutter.flutter.app 0x0000000110d9c04c kDartIsolateSnapshotInstructions + 10030412\ 9 io.flutter.flutter.app 0x0000000110e85d84 kDartIsolateSnapshotInstructions + 10988164\ 10 io.flutter.flutter.app 0x0000000110e85ae8 kDartIsolateSnapshotInstructions + 10987496\ 11 io.flutter.flutter.app 0x0000000110e8577c kDartIsolateSnapshotInstructions + 10986620\ 12 io.flutter.flutter.app 0x0000000110e8519c kDartIsolateSnapshotInstructions + 10985116\ 13 io.flutter.flutter.app 0x0000000110e85024 kDartIsolateSnapshotInstructions + 10984740\ 14 io.flutter.flutter.app 0x0000000110e93b18 kDartIsolateSnapshotInstructions + 11044888\ 15 io.flutter.flutter.app 0x00000001104169d0 kDartIsolateSnapshotInstructions + 46800\ 16 io.flutter.flutter.app 0x0000000110dc2fb8 kDartIsolateSnapshotInstructions + 10190008\ 17 io.flutter.flutter.app 0x0000000110413f28 kDartIsolateSnapshotInstructions + 35880\ 18 io.flutter.flutter.app 0x0000000110dc6e88 kDartIsolateSnapshotInstructions + 10206088\ 19 io.flutter.flutter.app 0x0000000110413ea0 kDartIsolateSnapshotInstructions + 35744\ 20 io.flutter.flutter.app 0x0000000110408b34 kDartVmSnapshotInstructions + 31604\ 21 io.flutter.flutter-macos 0x0000000102cf6d54 0x10242c000 + 9219412\ 22 io.flutter.flutter-macos 0x0000000102cf7480 0x10242c000 + 9221248\ 23 io.flutter.flutter-macos 0x0000000102e6b9d4 0x10242c000 + 10746324\ 24 io.flutter.flutter-macos 0x0000000102be7e38 0x10242c000 + 8109624\ 25 io.flutter.flutter-macos 0x000000010249b8e4 0x10242c000 + 456932\ 26 io.flutter.flutter-macos 0x00000001024a3c14 0x10242c000 + 490516\ 27 com.apple.CoreFoundation 0x0000000188c50c68 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32\ 28 com.apple.CoreFoundation 0x0000000188c50864 __CFRunLoopDoTimer + 1076\ 29 com.apple.CoreFoundation 0x0000000188c502ec __CFRunLoopDoTimers + 392\ 30 com.apple.CoreFoundation 0x0000000188c354f8 __CFRunLoopRun + 1944\ 31 com.apple.CoreFoundation 0x0000000188c345e8 CFRunLoopRunSpecific + 600\ 32 io.flutter.flutter-macos 0x00000001024a3eac 0x10242c000 + 491180\ 33 io.flutter.flutter-macos 0x000000010249b6b0 0x10242c000 + 456368\ 34 io.flutter.flutter-macos 0x00000001024a2824 0x10242c000 + 485412\ 35 libsystem_pthread.dylib 0x0000000188b37878 _pthread_start + 320\ 36 libsystem_pthread.dylib 0x0000000188b325e0 thread_start + 8\ ```
greenrobot commented 3 weeks ago

"obx_model_property": so there seems something wrong with one of the properties.

If you can reproduce the issue, could you try to isolate the "offending" property?

MegatronKing commented 3 weeks ago

@greenrobot Thanks for your reply. Unfortunately I cannot reproduce the issue, I got this report by a user. According to him, historical versions of the app are working(objectbox v1.7.2), but the latest app will crash (objectbox v2.5.1). I don't know if it is caused by upgrading the objectbox version.

greenrobot-team commented 2 weeks ago

@MegatronKing Not sure if possible, but can you ask the user to provide the full crash report from macOS (https://support.apple.com/guide/console/reports-cnsl664be99a/mac)? The snippet above is lacking an error code and additional details, similar to the report attached to this comment.

MegatronKing commented 2 weeks ago

Attached crash.log

greenrobot-team commented 2 weeks ago

@MegatronKing Thanks! Managed to symbolicate it: dart-crash-gh-626_symbolicated.txt

Notable parts:

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [29499]

Thread 5 Crashed:: io.flutter.ui
0   ???                             000000000000000000 0 + 0
1   io.objectbox.ObjectBox          0x0000000102060294 obx_dart_query_find_ptr (in ObjectBox) + 192096 + 574100
2   io.objectbox.ObjectBox          0x000000010206208c obx_dart_query_find_ptr (in ObjectBox) + 199768 + 581772
3   io.objectbox.ObjectBox          0x0000000102061e6c obx_dart_query_find_ptr (in ObjectBox) + 199224 + 581228
4   io.objectbox.ObjectBox          0x0000000102061da0 obx_dart_query_find_ptr (in ObjectBox) + 199020 + 581024
5   io.objectbox.ObjectBox          0x0000000102013c84 obx_model_property + 200
6   io.flutter.flutter.app          0x00000001104064b8 kDartVmSnapshotInstructions + 21752
7   io.flutter.flutter.app          0x0000000110e85f98 kDartIsolateSnapshotInstructions + 10988696

Two issues:

It should not be possible to ship an incompatible C library when building with Flutter, which would explain the likely incorrect function names. Even if, the Dart code enforces a minimum version throwing before a Store could even be initialized.

So not sure what is happening here.

greenrobot-team commented 2 weeks ago

Update: after some internal discussion it might currently not be possible to correctly symbolize crash reports because the needed info is stripped from our release library included in the ObjectBox Pod. Hence the nonsensical method names.

This leaves obx_model_property and EXC_BAD_ACCESS (SIGSEGV) as the only pieces of info. This method is called when creating a Store instance. Any expected exception thrown should be re-thrown as a Dart exception though, so I don' think it's an issue with the model itself.

This might be another weird Dart SDK bug, so I suggest building with the latest version of the Flutter/Dart SDK if possible.