Crash on wake from sleep
Almost everytime my mac wakes from sleep ControlPlane crashes.
OS X 10.8.4, CP 1.4.0-beta
What information do you need from me?
Hi Timo,
At the very minimum, please, send us the crash report. And if you also don't mind providing us with all the details on your actual configuration for CP (by sending file ~/Library/Preferences/com.dustinrue.ControlPlane.plist), it would be helpful.
Here's the info you asked for https://gist.github.com/deiga/dcff0aa881ba04455e88
Thanks, Timo. Based on the crash report it is a problem with the Wi-Fi evidence source. And I can see why the problem is likely happening. It is related to the situation when the Wi-Fi interface is already active after the system has woken up, but has not yet joined -- or cannot join for whatever reason -- the currently selected Wi-Fi network. In some rare cases such an effect may also be caused by a bad network SSID string, but it's unlikely you'd see that in practice, unless you do something very special with the Wi-Fi configurations. ;)
Anyways, before I commit the fix to the main CP branch, I certainly need to test it more in an appropriate environment (where the actual problem does happen). And yours seems to be the only one that I know of right now. (And in mine it's all good anyways...)
I can create an unofficial (developer's) build and send it to you so that you can test it on your system. Would you be okay with that?
I looked at this one a bit and it's certainly in doUpdate and I think it's at line 111 when apList has a count performed. It could also be line 106 but I feel like that would show up in the stack trace. Being a catchable exception we could just wrap those lines in some try/catch blocks and see which is failing.
Of course long term we need to know what's causing the issue from sleep but as a work around this might work.
From my perspective, the problem actually happens when the self.linkActive is YES and thus we attempt to create the dictionary with the string values for "WiFi SSID" and "WiFi BSSID": In some (rare) cases the nil value is passed instead of a string object. Thus we have an exception from NSDictionary.
Apple's documentation for developers confirms that both the ssid and bssid properties of a CWInterface's instance can have the nil value. It happens "in the case of an error, or if the interface is not participating in a network, or if the SSID can not be encoded as a valid UTF-8 or WinLatin1 string". For the problem that Timo observed the first and third cases are quite unlikely. But the situation where, right after waking up the system, the Wi-Fi interface needs some extra time to actually restore the active Wi-Fi connection is really possible. And in that case we will have the nil value for ssid and bssid (before the connection is fully restored).
I am ready to submit the fix, but as I pointed to Timo, I'd appreciate if he could try the developer's build with that fix on his system first and confirm that it is effective -- I want to be double check with a test on Timo's system that after we have correctly handled the situation in doUpdate, we will eventually get the notification from the interface as the connection is restored and the actual SSID and BSSID parameters are available.
Thus looking forward to Timo's reply. Other than that the commit is ready.
Sure, send me the build and I'll test it :)
Thanks, Timo. Just sent the build to your e-mail address (taken from your GitHub profile).
I am having this issue too, nearly every wake. Here's a crashlog:
http://cl.ly/text/1z013e1y1046
Happy to test a fix as well - email address is here:
http://cl.ly/image/1t3K2h0V2Y3m
Hi Michael,
Just sent a custom build with the fix to your e-mail address. Please, check (and confirm) if you have received and installed it.
I am looking forward to your and Timo's feedback.
Thanks - just installed it, will see if I can get this one to crash. Hope not!
On Sat, Jul 13, 2013 at 6:32 AM, VladimirTechMan [email protected]:
Hi Michael,
Just sent a custom build with the fix to your e-mail address. Please, check (and confirm) if you have received and installed it.
I will be looking forward to your and Timo's feedback.
— Reply to this email directly or view it on GitHubhttps://github.com/dustinrue/ControlPlane/issues/276#issuecomment-20917958 .
How did we go with this? I'm experiencing the same thing here - and looking at the crash report it seems to be the same issue.
Do you need more testers for the build? Or do we have a codepatch I can apply to my tree here?
The patched binary that VladimirTechMan sent me seems to have solved the problem.
Ah, excellent - I guess they haven't had time to commit the patch to the tree yet.
You don't happen to have the binary handy do you?
Not that I don't have time to commit. But I certainly wanted to test the fix more, to be sure Timo and Michael would not observe the issue again. If it goes well for them, for another day or two, I will proceed with submitting the code changes. [If waiting for a few more days is not acceptable in your situation, you may join Timo and Mike with the "pre-release" testing of the fix. I will be asking for your explicit feedback in that case. For that, let me know your e-mail address.]
Hi there,
Explicit feedback is certainly something I can provide - I dev in ObjectiveC by day, so I'd be happy to help.
My email is [email protected]
Cheers, Alex
On 15/07/2013, at 7:23 PM, VladimirTechMan [email protected] wrote:
Not that I don't have time to commit. But I certainly wanted to test the fix more, to be sure Timo and Michael would not observe the issue again. If it goes well for them, for another day or two, I will proceed with submitting the code changes. [If waiting for a few more days is not acceptable in your situation, you may join Timo and Mike with the "pre-release" testing of the fix. I will be asking for your explicit feedback in that case. For that, let me know your e-mail address.]
— Reply to this email directly or view it on GitHub.
Same problem for me, you can find my log here (http://pastebin.com/C05E81bn)
Ask anything, I'll do my best to help!
Email is [email protected]
Pat
Hi Pat,
Many thanks for offering help. Based on the (so-far) positive results from the other folks who were testing the custom build recently, I now plan to merge my fix into the main branch today or early tomorrow. After that, Dustin will likely be able to spin a new beta build for the public in a matter of a day or a few days. And then you will be able to officially download and use it. I hope you can tolerate a short delay here so that we can proceed with an official beta build.
(Shall it happen that there will be a longer delay with the new public build, I will send you a custom build then. Also if the delay for a few more days is not acceptable in your current situation, let me know and I will send you the custom build ahead of the next beta.)
Vladimir
Good day Vladimir,
Thank you for your reply. I'm happy to see how quick and easy it is to communicate with the team behind ControlPlane.
I appreciate your concern but from what I can see, CP now always crashes on me. So, if it's not too complicated, I would appreciate to have access to the dev build so I can perform more testing. My skills in Quality Assurance might be helpful after all!
Regards,
Pat
Quality Assurance is a good thing. And your feedback is very welcome.
I have just sent you a custom build. Please, check your e-mails.
Thank you Vladimir, I'll keep you updated with my feedback.