-
Notifications
You must be signed in to change notification settings - Fork 133
Internal ObjectBox exceptions are not reported correctly #1
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
Comments
From dart-lang/sdk#38141 (comment):
Once #9 is done, we should test this on Flutter and report to the Flutter project if required. |
id-array FFI struct & TestEnv
works with dart 2.6(.1) added a test case in 04e1ae0 |
Turns out this doesn't work on Flutter for Linux (desktop), I've filed an issue: flutter/flutter#74599 |
Since our original issue was closed ("fixed and then reverted"), the current one to watch is flutter/flutter#66575. Is there any info we could provide to speed this up on the Flutter side? E.g. a generalized test case? They specifically mention Linux as the broken platform. Do Windows and macOS do not expose the behavior? Could we get around the problem by statically linked libs, e.g. for Linux? |
The issue is specific to the Flutter linux build. A statically linked libstdc++ doesn't help, still crashes during exception throw - we have a test case exactly for that in For completeness, the usual libobjectbox.so dependencies and the ones with static libstdc++ linking:
|
Not for now; has time for later: can we have fully static lib, not just libstdc++? |
not a shared library AFAICT. |
Check if this is still an issue (e.g. the linked Flutter issue is closed). Test our Flutter example app on Linux. E.g. modify task = Task(text, id: -100); |
OK, finally confirmed this is fixed. Tested with Flutter 3.19, but this was probably fixed as early as August 2021. Exception is thrown as expected:
|
Operating system: Ubuntu 16.04 [to be confirmed for other OSs]
Dart version: 2.4.1
When trying to call ObjectBox functions with e.g. invalid parameters, normally the error should be reported on the command line as well as being reflected as an error code retrieved from
obx_last_error_code
. As an example, try creating an entity with ID -1 (@Entity(id: -1, uid: 1)
), which is illegal in ObjectBox. Instead of seeing a meaningful message, the following is output, in other cases with theOBX_ERROR_NO_ERROR_INFO
error code:After some investigation, it became obvious that this issue is due to this problem in the Dart FFI, i.e. something rather fundamental in C++.
The text was updated successfully, but these errors were encountered: