Skip to content

Desktop (linux) issue with statically linked libc++ #74599

@vaind

Description

@vaind

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

  1. Run flutter config --enable-linux-desktop
  2. Run flutter create bug.
  3. Update the files as follows:
    • add objectbox: 0.10.0 and objectbox_flutter_libs: any dependencies

    • 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.dart with the following code (everything before class MyApp declaration)

      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());
      }
  4. 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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: desktopRunning on desktopc: crashStack traces logged to the consolec: fatal crashCrashes that terminate the processengineflutter/engine related. See also e: labels.found in release: 1.26Found to occur in 1.26has reproducible stepsThe issue has been confirmed reproducible and is ready to work on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions