-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Crash on iOS with cupertino_http #2844
Comments
Felix looked at this in detail today. We were able to reproduce. We know how we're going to fix this, but it will take several days of work, and is currently delayed by other pressing work. We'll update this bug as we know more. The good news is that the fix here will actually make all Flutter apps using Shorebird on iOS a little faster. :) (Our dart:ffi support in Shorebird was written before dart:ffi async support existed, and although we though we had made dart:ffi async work, we clearly missed a case which will require a significant refactor of our ffi support to fix correctly.) |
We are experiencing similar issue (also mentioned on discord). We are using ffi and objective_c (similarly to cupertino_http), and the crash stack trace is quite similar:
This is resolved if we build with We'd be happy to test the fix whenever it's available. |
Thanks. Felix is working on a fix now. Probably will be a few days. |
im facing a similar issue on macos app. will check after the fix |
(internal link): https://admin.shorebird.dev/apps/bc6ee7bb-721d-464f-8075-215362b8f256/releases/168292
Symbolicated crash point:
I believe what is going on is that cupertino_http is calling back into Dart via ffi, possibly via an async ffi callback, and we're not guarding against the case where the Dart Isolate has stopped at that point.
https://github.com/dart-lang/sdk/blob/949eb447a47b49f6db18c7920a0de837b274757b/runtime/vm/compiler/stub_code_compiler_arm64.cc#L587 appears to be how upstream guards this case.
But we wrap that stub with our own and I don't see us checking if the isolate has stopped or the thread is null, etc, and instead just try to get the simulator off the thread which ends up with a low value invalid pointer.
My bet is that if we checked 0x0000000000000838 that would be exactly the value of the Simulator thread offset, thus THR is just null at this point.
Should be a simple fix, the only question is getting a repro (ideally that runs in our Dart vm tests).
The text was updated successfully, but these errors were encountered: