[vm/ffi] Pointer.asTypedList
shared across isolates causes use after free
#55800
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
library-ffi
triaged
Issue has been triaged by sub team
The native finalizers in
asTypedList
are bound to an isolate, not an isolate group:sdk/sdk/lib/ffi/ffi.dart
Lines 368 to 373 in 4dd6ee6
sdk/sdk/lib/_internal/vm/lib/ffi_native_finalizer_patch.dart
Line 115 in 4dd6ee6
Hypothesis: The TypedData we create out of Pointer is marked unmodifiable.
We need to either mark the typed data as mutable so that the view does not consider the typed data as unmodifiable, and we copy instead of share the object.
Or, we need to attach finalizers in the isolate group instead of the isolate.
Context:
TODO: verify hypothesis. (Filing issue so that I don't forget.)
The text was updated successfully, but these errors were encountered: