sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[vm/ffi] Requesting isolate shutdown in a callback

Open dcharkes opened this issue 6 years ago • 5 comments

We should check that the FFI does not swallow isolate shutdown requests.

It should probably return the error value to C, let C unwind its stack, and continue unwinding the dart stack upon returning to Dart.

dcharkes avatar Nov 22 '19 02:11 dcharkes

@rmacnak-google @liamappelbe based on the test that we added, is anyone working on this? Or did we simply add a test for documentation?

dcharkes avatar May 09 '23 12:05 dcharkes

I'm not working on a fix, I just wanted to added the test while it was fresh in my mind.

rmacnak-google avatar May 09 '23 17:05 rmacnak-google

I'm not working on it at the moment.

liamappelbe avatar May 09 '23 20:05 liamappelbe

Propagating unwind error will need checking on return from non-leaf ffi calls. In some sense this is similar to b113fffb65a002accf53724e5d57110ad215b5f7 which has added checking whether return values are exceptions and need to be propagated.

@dcharkes maybe you can add this issue to your list?

mkustermann avatar May 17 '23 12:05 mkustermann

The ffi/callback_unwind_error_test flaked again today.

The work to make flutter hot-restart work better will require shutting the entire isolate group down on flutter hot-restart, which will send kill messages to isolates, which in return will require solving this issue.

mkustermann avatar Aug 22 '24 08:08 mkustermann

Ran into this in our fork, went to fix it, and then tried it in stable dart and realized it fails there too. (Testing on Mac ARM64 dart 3.7.0)

eseidel avatar Mar 08 '25 20:03 eseidel