-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-native-interopUsed for native interop related issues, including FFI.Used for native interop related issues, including FFI.triage-automationSee https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
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
Metadata
Metadata
Assignees
Labels
area-native-interopUsed for native interop related issues, including FFI.Used for native interop related issues, including FFI.triage-automationSee https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)