[ffi] Data corruption from native thread #59635
Labels
area-native-interop
Used for native interop related issues, including FFI.
triage-automation
See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Hi,
I'm having an issue where a NativeCallable.listener callback is receiving garbled data.
My callback is
void Function(Pointer<Char> json) => json.cast<Utf8>().toDartString();
This fails ~80% of the time as it fails to decode the UTF-8 in the call to toDartString(). This string should always be valid UTF-8, and indeed in the remaining 20% of the time it succeeds and behaves as expected.
I believe it is similar to the issue described here.
Is there a workaround for this? I think the proposed NativeCallable.blocking might solve it but in the meantime is there anything I can do from the dart side?
Dart SDK version: 3.4.4
Thanks
The text was updated successfully, but these errors were encountered: