Skip to content
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

Mac app was crashed by objectbox #626

Open
1 task done
MegatronKing opened this issue Apr 24, 2024 · 10 comments
Open
1 task done

Mac app was crashed by objectbox #626

MegatronKing opened this issue Apr 24, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@MegatronKing
Copy link

Is there an existing issue?

Build info

  • objectbox version: 2.5.1
  • Flutter/Dart version: 3.16.5
  • Build OS: macOS 14.2.1 (23C71) arm64
  • Deployment OS or device: macOS 11.4 (20F71) arm64
Logs
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\
@MegatronKing MegatronKing added the bug Something isn't working label Apr 24, 2024
@greenrobot
Copy link
Member

"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
Copy link
Author

@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
Copy link
Member

@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.

@greenrobot-team greenrobot-team added the more info required Needs more info to become actionable. Auto-closed if no response. label Apr 29, 2024
@MegatronKing
Copy link
Author

Attached crash.log

@github-actions github-actions bot removed the more info required Needs more info to become actionable. Auto-closed if no response. label Apr 30, 2024
@greenrobot-team
Copy link
Member

greenrobot-team commented Apr 30, 2024

@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:

  • the actual location of the crash is still unknown,
  • the obx_dart_query_find_ptr function (or any nearby) is currently not used by the ObjectBox Dart library (and only was used internally to test an alternative stream implementation, but that was never released).

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
Copy link
Member

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.

@greenrobot-team greenrobot-team added the more info required Needs more info to become actionable. Auto-closed if no response. label Apr 30, 2024
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue. Therefore this issue has been automatically closed. Feel free to comment with additional details and we can re-open this issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
@MegatronKing
Copy link
Author

@greenrobot-team

I have tested the latest version 4.0.3, still has this issue. And I add some logs in objectbox-dart library, app crashed in adding property uid.

Adding entity CaptureRecordHistory
Adding property id
property type 6 id 1 uid 6040167676980227669
property flags 1
Adding property uid
property type 9 id 2 uid 3451062823193510338
// Crashed here

Generated dart code

obx_int.ModelEntity(
      id: const obx_int.IdUid(11, 513),
      name: 'CaptureRecordHistory',
      lastPropertyId: const obx_int.IdUid(5, 7822886344423758990),
      flags: 0,
      properties: <obx_int.ModelProperty>[
        obx_int.ModelProperty(
            id: const obx_int.IdUid(1, 6040167676980227669),
            name: 'id',
            type: 6,
            flags: 1),
        obx_int.ModelProperty(
            id: const obx_int.IdUid(2, 3451062823193510338),
            name: 'uid',
            type: 9,
            flags: 34848,
            indexId: const obx_int.IdUid(7, 9031217690624826865)),
        obx_int.ModelProperty(
            id: const obx_int.IdUid(3, 6042425634497518656),
            name: 'timestamp',
            type: 10,
            flags: 0),
        obx_int.ModelProperty(
            id: const obx_int.IdUid(4, 5370782675607767186),
            name: 'dbData',
            type: 9,
            flags: 0),
        obx_int.ModelProperty(
            id: const obx_int.IdUid(5, 7822886344423758990),
            name: 'dbUniqueId',
            type: 9,
            flags: 0)
      ],
      relations: <obx_int.ModelRelation>[],
      backlinks: <obx_int.ModelBacklink>[]),

Crash report file: Reqable_2025-01-02-164929_zhangyqMacBookPro.txt

@MegatronKing
Copy link
Author

It is reproducible on some devices, but not on others. A small number of my users have experienced this kind of crash, and I hope to be able to resolve it or provide further troubleshooting solutions.

@greenrobot-team
Copy link
Member

greenrobot-team commented Jan 13, 2025

@MegatronKing Thanks for the details! Is this running on the same macOS version and architecture, and using the same Flutter version as noted in the original comment? Have you tried using a recent Flutter version?

Also if you can, please share the code of the entity class. It would make it much faster for me to reproduce this!

Anyhow, we'll have a look once there is time.

@greenrobot-team greenrobot-team added more info required Needs more info to become actionable. Auto-closed if no response. and removed more info required Needs more info to become actionable. Auto-closed if no response. labels Jan 13, 2025
@greenrobot-team greenrobot-team self-assigned this Jan 13, 2025
@github-actions github-actions bot removed the more info required Needs more info to become actionable. Auto-closed if no response. label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants