-
Notifications
You must be signed in to change notification settings - Fork 120
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
EXC_BAD_ACCESS fatal crash on iOS 17 when accessing store from within isolate #654
Comments
Thanks for this detailed report! Based on the crash log this looks exactly like a plugin issue on iOS 17 as described in #561 (comment), which is flutter/flutter#67624. For the ObjectBox library this was resolved in 2.4.0 though, see the current implementation. Maybe there is another plugin that is affected? In any case, the workaround seems to be to always launch the app from Flutter tooling. Note: labeled this issue with "more info required" so it will auto-close in a few days if there are no follow-up comments. |
I did create an issue report to Flutter for the path_provider plugin, but they immediately closed it: flutter/flutter#151072 (flutter/flutter#151072 (comment)). Looking at the implementation of their registration function: ... they don't seem to use the workaround suggested in your linked issue - although they might, I don;t really know enough about plugins: flutter/flutter#67624 (comment) Could the issue still actually be in path_provider? (Whilst I can't be certain it is exactly the same as OP, the pubspec.lock (https://pastebin.com/1vejE0p3) suggests that they don't really use any other plugins (besides standard core ones). FMTC doesn't make use of any other plugins - and the bug only triggers here.) |
Yes, the path_provider plugin seems to be "affected". But note that even if they apply the recommended workaround, the plugin registration would just not work instead of crash. I remembered the solution wrong until reading the current state of flutter/flutter#67624 again, to quote:
In any case, I think we should add a note about this in our docs. |
This issue has been confirmed to occur without path_provider involvement: https://pastebin.com/gcMkiGcM. It possibly looks a little different to the original log - but I would've thought it's the same issue, and either way, it's still an issue. It's still a "KERN_INVALID_ADDRESS", but at a different address, and no longer seems to point at registration. |
@JaffaKetchup Thanks for the update. Unfortunately thread 30 does not have any symbols. And as this is using the ObjectBox Swift library behind the scenes I'm not sure I can symbolize it (we will have to research this more, there is also an open, internal, bug that debug symbols are missing). Do I remember this right that this can be reproduced (looks like it crashed on an iOS simulator, which I have access to)? Can you give me some coarse steps on how? Maybe I can use an internal debug build of ObjectBox Swift that has symbols to analyze the crash. |
I believe this can be produced on an emulator using the FMTC app (according to the OP, but I never followed this up) - but I can't verify of course. The initial steps are the same as #656:
Screen.Recording.2024-07-22.092145.mp4I'm not certain which combination of actions is required to produce the issue. The red delete button clears the tiles first, same as the grey delete button, so there shouldn't be any extra info gained by using the red button. |
This comment was marked as outdated.
This comment was marked as outdated.
It looks like the issue is indeed streaming. I've converted it to use Here's the change I made: JaffaKetchup/flutter_map_tile_caching@ |
Thanks for the update! I had no time to look into this, yet. Given these changes, I wonder if the Store somehow gets closed while the results are streamed (so as per #379 the new attach API does not prevent this). Something to look into. |
I guess that might make sense, but then why wouldn't the issue occur on all platforms? |
Is there an existing issue?
Build info
Steps to reproduce
This report is based on a report to a library I own: JaffaKetchup/flutter_map_tile_caching#159. Therefore, some information is limited as a 3rd party suffered the issue. I am providing as much information as possible, please let me know if more is required.
Code A
This code is inside an isolate, and is called also from within the same isolate, with the following arguments:
Code B
This looks similar to #379 (which was also related to usage in isolates), but it may not be. To open the stores in the new isolate, we use the new
attach
API, notfromReference
. Maybe the issue is streaming in an isolate?If more code is needed, all code is available on the FMTC repo. I can help filter out whatever is needed.
FMTC also uses the term 'store' to mean something different to an ObjectBox Store.
Expected behavior
The provided code should execute successfully, deleting the specified 'tiles' from the specified 'stores'.
Actual behavior
The application fatally crashes with the exception shown in the logs below.
Code
As I cannot reproduce the issue myself, I cannot provide an MRE without flutter_map_tile_caching.
However, the original reporter provided an MRE that uses the flutter_map_tile_caching dependency: JaffaKetchup/flutter_map_tile_caching#159 (comment). It may be that more specific circumstances are required.
I can try to provide more information if possible, but given that I don't think I can reproduce this bug as it is, that's difficult.
The log below is produced on FMTC's example application.
Logs, stack traces
Basic error snippet: DartWorker (177): EXC_BAD_ACCESS (code=1, address=0x12ab68010)
iOS Platform Log: pastebin.com/qQCwULRb
pubspec.lock (please note that this is a reproduction on my machine, not from the original reporter (see below)): pastebin.com/1vejE0p3
The text was updated successfully, but these errors were encountered: