Skip to content

macOS library validation fails for FFI  #39231

Closed
@johnpryan

Description

@johnpryan

It looks like #38288 has started happening again.

  1. Clone https://github.com/dart-lang/samples
  2. open the ffi/hello_world sample
  3. run cd c && make dylib
  4. run cd .. && dart hello.dart
  5. observe "Failed to load dynamic library" exception
dart hello.dart 
Unhandled exception:
Invalid argument(s): Failed to load dynamic library (dlopen(hello_world.dylib, 1): no suitable image found.  Did find:
	hello_world.dylib: code signature in (hello_world.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.)
#0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:10:55)
#1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:17:12)
#2      main (file:///Users/ryjohn/code/github/dart-lang/samples/ffi/hello_world/hello.dart:17:36)
#3      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:305:19)
#4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)

cc: @mit-mit @mjohnsullivan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions