-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Steps to Reproduce
You can have a look at the issue we've already filed some time back in Dart SDK, it was fixed there: dart-lang/sdk#38141
Or you can reproduce it yourself, using package objectbox
- Run
flutter config --enable-linux-desktop - Run
flutter create bug. - Update the files as follows:
-
add
objectbox: 0.10.0andobjectbox_flutter_libs: anydependencies -
you'll need to install
libobjectbox.so:bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh)or get it from this conan package on Bintray if you don't want to run the shell script -
Replace
main.dartwith the following code (everything beforeclass MyAppdeclaration)import 'package:flutter/material.dart'; import 'package:objectbox/src/bindings/bindings.dart'; import 'package:objectbox/src/bindings/helpers.dart'; import 'dart:ffi' as ffi; void main() { runApp(MyApp()); bindings.obx_store_open(ffi.nullptr); print(latestNativeError()); }
-
- run as a native Linux (desktop) app
I've also prepared a ready project reproducing this, just check it out and install ObjectBox native lib. Or see the latest commit to see the changes I've described above.
- https://github.com/vaind/flutter-ffi-crash
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh)
Expected results:
This works on platforms other than Linux:
Console prints: ObjectBoxException: 10002 Argument "opt" must not be null (L53)
Actual results:
App crashes immediately (segfault), see coredumpctl info -1