-
Notifications
You must be signed in to change notification settings - Fork 75
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
EXEC BAD ACCESS. Device only #157
Comments
Do you have any optimisations in build settings? |
I have no optimizations. |
Can you try turning your lazy properties in CoreDataService to optionals and initialise them in init and see if it helps? I think it might cause issues as we try to access those properties for the first time through Mirror. |
I removed all the other app dependencies and left only the CoreDataService. I removed the lazy properties and it worked again. As you thought, that is the issue. |
Don't know to be honest, but there were some issues regarding mirroring types with IUO properties (and lazy is still optional, so it might be related). Maybe it is also affected by the fact that it is CoreData types... Will try to reproduce that on a weekend and probably file a bug for Swift, or I will try to come up with some fix to avoid accessing lazy properties while doing auto-injection, as we already do for IUO properties, probably simply by ignoring any property with optional type. |
Btw you might also try to turn your lazy properties to IUO, that might help as we skip accessing them during auto-injection, so it might work for you without any other fixes on our side |
Thanks for everything @ilyapuchka. Removing the lazy properties fixed the problem. I added some code and created a pull request so you can reproduce the crash if you want to. |
Hi @ilyapuchka I am attaching the stack trace for the crashing thread.
This is the log:
Resolving type DataInitializer with arguments ()
Resolving type Database with arguments () while injecting in type DataInitializer
Resolving type CoreDataService with arguments () while injecting in type Database
AppDelegate.swift.txt
AppDependencies.swift.txt
CoreDataService copy.swift.txt
StackTrace Thread 1.txt
I am still trying to find the issue.
Thanks!
The text was updated successfully, but these errors were encountered: