Skip to content

Getting weird crashes PFObjectSubclassingController.m #980

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

Closed
patpawasantanon opened this issue Jul 19, 2016 · 9 comments
Closed

Getting weird crashes PFObjectSubclassingController.m #980

patpawasantanon opened this issue Jul 19, 2016 · 9 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@patpawasantanon
Copy link

patpawasantanon commented Jul 19, 2016

1644 crashes with only 5 users

PFObjectSubclassingController.m line 355

http://crashes.to/s/d1678763779

anyone know how to solve this?

@pawelkata
Copy link

Same here. My app was sent to a beta review a few hours ago:

http://crashes.to/s/dc1ff26327c

I'm rocking iOS SDK v1.14.1.

@fluidsonic
Copy link
Contributor

fluidsonic commented Jul 19, 2016

Same here. Crash when starting the app in the Simulator.

PFObjectSubclassingController.m:

char potentialPaths[2][PATH_MAX] = { };

strncpy(potentialPaths[0], bundle.executablePath.UTF8String, PATH_MAX); // crash
realpath(potentialPaths[0], potentialPaths[1]);

bundle.executablePath is nil which leads to the crash.

The offending bundle is /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib which was scanned in response to this notification:

NSConcreteNotification 0x7936de00 {name = NSBundleDidLoadNotification; object = NSBundle </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib> (loaded); userInfo = {
    NSLoadedClasses =     (
        AXSpeechAction,
        AXSpeechManager,
        AXEmojiUtilities,
        AXSpeechThread
    );
}}

@fluidsonic
Copy link
Contributor

Why not just use the NSLoadedClasses notification key for a list of all classes instead of examining the executable image? Seems unnecessarily complicated.

@natanrolnik
Copy link
Contributor

I submitted recently an the app to review with 1.14.1, and I got 361 crashes in one device 😨 (apparently they are running the app in some devices before it enters in review):
http://crashes.to/s/e334c371112

@fluidsonic
Copy link
Contributor

fluidsonic commented Jul 19, 2016

We've fixed the issue for us in https://github.com/Widgetlabs/Parse-SDK-iOS-OSX/commit/aaa0632235b0896f5738a234e89a4a377d7eb68c.

You can use it in your Podfile like so:

# https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/980
pod 'Parse', :git => 'https://github.com/Widgetlabs/Parse-SDK-iOS-OSX.git', :branch => 'patch-1'

But I'd recommend to either fork our fix or else use Parse SDK 1.13.0 which is not affected by this bug.

@patpawasantanon
Copy link
Author

Thank you! @fluidsonic

@ProximalPod
Copy link

@fluidsonic This worked for me. My code was crashing anytime I initialized an object in the AVFoundation framework, e.g. [[AVSpeechSynthesizer alloc] init]. I traced it back to this code but was wary of changing it. Thanks!

ProximalPod referenced this issue Jul 19, 2016
This will scan all loaded code bundles for classes which inherit from `PFObject`, and register them upon Parse initialization. Still have opt-in support for manual-only registration, though it shouldn't be necessary for most cases.
@nlutsenko
Copy link
Contributor

This is getting merged in a few moments and release is coming soon.
Thank you everyone for the input and thank you @fluidsonic for a fast fix!

@nlutsenko nlutsenko self-assigned this Jul 19, 2016
@nlutsenko nlutsenko added the type:bug Impaired feature or lacking behavior that is likely assumed label Jul 19, 2016
@acegreen
Copy link

@nlutsenko thats what I was talking about in #975

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

7 participants