-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
Crash in sweepMembers function (avoid unowned ivars) #68
Comments
Interesting, and this happens consistently with those classes? |
It's just "normal" classes (UIViewController / UITableViewController). Maybe the only common pattern: all are "presented" (not pushed in a UINavigationController) |
Interesting, I would love some additional logs to dig into this further. Do you get any additional information if you enable exception breakpoints? Maybe you could trigger the error again and have a look at the last argument when it does crash. For more information, please have a look at https://www.natashatherobot.com/xcode-debugging-trick/ |
This is all i can get right now.
|
@skrew hey mate, you think you could make a small example project for me where this is reproducible? |
It will be hard, but i can open a team viewer session on this mac if it can help you |
Hey @skrew, I've done some investigation here as I ran into a similar issue. https://www.dropbox.com/s/7stoecnf6uubno1/InjectionIII%20-%201.4%20Preview%202.zip?dl=0 |
@skrew Thanks for testing mate! If you highlight the 16 step in the stack trace, |
i can't get any information about the crash in this executable (compiled with debug ?)
|
@skrew would you mind downloading the latest version and enabling |
Hi, Again, by adding |
Just thought I’d check but this project is ARC right? |
@johnno1962 yep |
This sort of problem is going to be very difficult to track down. If possible I’d recommend using the INJECTION_BUNDLE_NOTIFICATION instead of -injected method for your app. |
Which version of Xcode is this? |
Version 10.1 (10B61) |
So you have time for a teamview at the moment? If so email your details through to injection at johnholdsworth.com |
Mail sent. |
In the end the problem was use of unowned ivars which do not mix well with Swift’s Mirror that Injection uses for the sweep. If I can replicate with a small example app I’ll file a radar though I’m not sure what the solution would be. |
At least problem is fixed for me :) |
I’ll leave it open as it is still very much a current issue. I’ve not been able to replicate it as yet. |
Replicated and radar’d you can not inject projects with unowned ivars that may have been dealloc’d. Thanks for persevering on this issue! |
Just for info, changing |
Seems to be a known problem https://bugs.swift.org/browse/SR-5289 |
Right, but it's identified since jun 2017...
MPVHandler is shared instance (singleton) and never get dealloc'ed (i don't think UserDefaults.standard can be released ?) |
Name is wrong. The right name is INJECTION_BUNDLE_NOTIFICATION |
Hi,
I got
EXEC_BAD_ACCESS
atfor (_, value) in mirror!.children {
in functionsweepMembers(_ instance: Any)
It crash when mirror is one of my project Class...
For testing, i have filtered out theses classes, and injection works.
while mirror != nil && mirror?.description != "Mirror for ViewPlayerController" && mirror?.description != "Mirror for VPSettingsSubtitle" && mirror?.description != "Mirror for VPSettingsVideo" && mirror?.description != "Mirror for VPSettingsAudio" {
Note: In my test, i make injection in
VPSettingsSubtitle
class. Even with this class filtered, injection works.The text was updated successfully, but these errors were encountered: