dart-archive / wasm

Utilities for loading and running WASM modules from Dart code
https://pub.dev/packages/wasm
BSD 3-Clause "New" or "Revised" License
309 stars 25 forks source link

Debugging CI failure #122

Closed liamappelbe closed 1 year ago

liamappelbe commented 2 years ago

Can't repro locally, so I'll have to use CI. #90

liamappelbe commented 2 years ago

Looks like it's not always import_error_test that crashes, and it doesn't always crash in the same way. Something so flaky might be one of the finalizers.

https://github.com/dart-lang/wasm/actions/runs/3610853246/jobs/6169686961 https://github.com/dart-lang/wasm/actions/runs/3610853246/jobs/6170594797

liamappelbe commented 2 years ago

The crash doesn't seem to be in the finalizers. I think it's in one of the FFI trampolines in WasmRuntime.compile.

@dcharkes We're seeing a flaky seg fault in these tests that call some FFI functions. The stack trace (see below) indicates the crash is in FfiTrampoline_initBindings. I can't find this function in the VM. Do you know where I can find that function? Any idea how why it would be crashing?

https://github.com/dart-lang/wasm/actions/runs/3653124911/jobs/6172233435

liamappelbe commented 2 years ago

The crash doesn't seem to be in the finalizers.

Nevermind, it's definitely one of the finalizers.

liamappelbe commented 2 years ago

I think migrating to the official NativeFinalizers is probably a good idea. Might fix this issue. I'll do that now. #95

liamappelbe commented 2 years ago

Migrated to NativeFinalizers, but it has exactly the same crash 🤦

dcharkes commented 2 years ago

@dcharkes We're seeing a flaky seg fault in these tests that call some FFI functions. The stack trace (see below) indicates the crash is in FfiTrampoline_initBindings. I can't find this function in the VM. Do you know where I can find that function? Any idea how why it would be crashing?

initBindings is the name of the function wrapping an ffi-trampoline builder. FfiTrampoline_ is prepended in runtime/vm/compiler/ffi/call.cc when making the trampoline. I see that your initBindings does many lookupFunction calls, it's one of these.

I'm not sure why compiling a trampoline would be influenced by native finalizers.

It sounds similar to b/261224444, did it start recently?

liamappelbe commented 2 years ago

It sounds similar to b/261224444, did it start recently?

@dcharkes I get access denied when I try to view that bug, but yeah, it started a couple of weeks ago.

dcharkes commented 1 year ago

It sounds similar to b/261224444, did it start recently?

@dcharkes I get access denied when I try to view that bug, but yeah, it started a couple of weeks ago.

This is being tracked in: