Updated to Xcode 5.1.1 causes strange crash of iOS app - ios

Unfortunately I auto-updated Xcode to Version 5.1.1 (5B1008), and now one of my apps crashes in a very strange way.
The app is a PhoneGap 3.4 (+ jQuery Mobile 1.3.1) hybrid app, the crash happens when I try to open a JQM page that contains ~20 JQM checkbox.
The crash happens in CoreGraphics CGPathAddLineToPoint called by WebCore WebCore::RenderThemeIOS::paintCheckboxDecorations in the WebThread, I guess when WebCore attempts to render the checkboxes on then JQM page.
The console reads:
Assertion failed: (CGFloatIsValid(x) && CGFloatIsValid(y)), function void CGPathAddLineToPoint(CGMutablePathRef, const CGAffineTransform *, CGFloat, CGFloat), file Paths/CGPath.cc, line 224.
(lldb)
Any other JQM page NOT containing checkboxes is displayed properly, and it does not crash the app.
EDIT: interestingly, the crash is triggered by this line of Javascript:
$('#my_checkbox').prop("checked", my_boolean_value).checkboxradio("refresh");
If I disable it, the JQM page shows up. But then, even if the above line is disabled, if I click on any checkbox, it crashes again, with the same above Assertion failed message. (I guess because JQM toggles the check/unchecked class.)
I already performed all the tricks I could think of (clean, disable debugger, reboot, reinstalled Xcode), with no luck.
Any ideas on how to solve this issue?

I discovered the following very irritating fact: the crash is triggered by a
opacity:.01
directive, attached to the JQM .ui-checkbox class in my CSS.
Changing it to:
opacity:0
prevents the crash (which I still do not know if it is due to an Xcode bug or an iOS bug).
Interestingly, setting any value greater than 0 triggers the crash.

I had a similar issue,but it was caused by an attributed text link. I ended up having to change "Continue..." to "Continue"

Related

Causes of CFDictionaryGetValue crash?

I'm having random crashes within my swift app and they are all throwing a similar error around CFDictionaryGetValue
Here are two screenshots from my Google Crashlytics showing the error and that its effecting to different URLs, Note these are from two separate crashes
Then here is also a screenshot directly from within Xcode where I was able to reproduct the error:
There doesn't seem to be any specific action that causes this issue and it occurs at random times.
And advise for trying to trace it and debug would be much appreciated!
Thanks
Oliver
As it turns out this issue was caused by a bug within the Firebase Performance SDK. After removing the SDK everything is working as expected
https://github.com/firebase/firebase-ios-sdk/issues/6734?fbclid=IwAR0L5U4dsBjyUGmklr8qEohlKTyY7P6zJwzWUnU3dUTnFmb0aclK4-rt5os
Try setting up an Exception breakpoint, it would probably give you more information to help you debug it:
In Xcode:
Go to Breakpoint Navigator (CMD+8)
Click the + button in the bottom left corner of the navigator and then choose Exception Breakpoint...
Select All in the Exception field
Re-run your app and you should get clearer information in the debugger

Swift keyboard extension SIGQUIT, Execution was interrupted, reason: EXC_BREAKPOINT

When I try to build and run my keyboard extension, it sometimes just crashes with a Thread 1: signal SIGQUIT.
I am not able to reproduce the error. Sometimes I can build and run my app but most of the time the keyboard just quits. This happens on an actual device. In the simulator it does not open my keyboard and says Waiting to Attach.
The console does not output any errors at first. However, if I change the dropdown to View UI Hierachy in the Debug navigator I get the following description:
Details: No plist data for fetching view hierarchy: error evaluating expression “(id)[(Class)objc_getClass("DBGViewDebuggerSupport_iOS") fetchViewHierarchyWithOptions:(id)[(Class)objc_getClass("NSDictionary") dictionaryWithObjects:(id)[(id)[(id)[(Class)objc_getClass("NSArray") arrayWithObject:(id)[(Class)objc_getClass("NSNumber") numberWithBool:1]] arrayByAddingObject:(id)[(id)[(Class)objc_getClass("NSArray") arrayWithObject:#"_UIVisualEffectBackdropView"] arrayByAddingObject:#"_UIBackdropEffectView"]] arrayByAddingObject:(id)[(Class)objc_getClass("NSNumber") numberWithBool:0]] forKeys:(id)[(id)[(id)[(Class)objc_getClass("NSArray") arrayWithObject:#"DBGViewDebuggerUseLayersAsSnapshots"] arrayByAddingObject:#"DBGViewDebuggerEffectViewsToSnapshotAsImage"] arrayByAddingObject:#"DBGViewDebuggerAlwaysEncodeLayers"]]]”: error: Execution was interrupted, reason: EXC_BREAKPOINT (code=1, subcode=0x18daddc34).
The process has been returned to the state before expression evaluation.
Method: -[DBGAbstractViewDescriber handleFetchedViewInfo:fetchError:resultHandler:]
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
I also took a screenshot of the processes.
Am I doing something wrong and how could I prevent that my keyboard extension quits all the time when running it? Is it actually a bug as it says in the description?
DISCLAIMER
It seems like something in xCode 8.2.1 is broken and the debugger is not correctly attaching to the correct process or the hosting process is not properly loading the new code.
This is a not a permanent solution but a temporary workaround.
WORKAROUND
I have been able to work around this issue by following the steps below.
Kill any process that is using your keyboard (important!)
Launch the application using the debugger so the latest code is deployed to the device
Navigate to Settings > General > Keyboards > etc.
Remove your custom keyboard
Re-add your custom keyboard
Debug the application once again
The reason this works is because removing the keyboard kills the process that is hosting the extension allowing Xcode to attach to the new binary.
As I understand this is a bug in Xcode 8.2.1. because before update my custom keyboard was working very well.
this is a temporary solution.
Run your code like always!
Bring up your keyboard until the error (SIGQUIT) appear!
Goto xcode > debug > detach
Goto again Xcode > debug > Attach to Process: attach the keyboard (it should be first process)
now, your breakpoints will work. but there are no log output unfortunately! I hope it temporary solve your problem

WKWebView error calling any javascript in iOS 10 while debugging

Fun error that ONLY happens in iOS 10, when debugging on a physical device. It does not happen in the simulator, or when running on the physical device (while not debugging). It also does not happen on an iOS 9 device in any situation...only iOS 10 while debugging and after any javascript call has been executed.
I have a hybrid web app, written in Swift 2.3, after the xwebview loads I call various javascript methods...actually, any in this case. Anyway, after the javascript method has finished I get a malloc error saying I'm trying to free a pointer.
malloc: *** error for object 0x1740b5060: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
So I set the break point...and it never breaks on the breakpoint, it just keeps telling me to set a breakpoint.
If I remove all of my javascript calls, the error never happens. I've tried enabling them one by one, it doesn't matter, they all break after the callback returns.
I've been after this for about 2 weeks, I'm out of extra hair to pull out. At this point I'd love to hear if someone else is seeing the same thing.
It looks like its a safari bug and therefore only appears when you are debugging your webview with safari. In Safari under Develop->Your_Device_Name uncheck "Automatically Show Web Inspector for JSContexts".
This should resolve your issue.

App crashes without reason with xCode 4

Something weird is going on here.
My app crashes on this line of code:
int end = NSMaxRange(endRange);
but I don't get any error message, and everything is fine: endRange. The app just freezes in the iPhone and that's it.
1.
The weird thing is that the same code was working before, and I've reversed from repository to see what's wrong but it still doesn't work.
2.
Also xCode removes the breakpoint every time the app crashes. I add it again, I run the app, I step over, the app crashes and Xcode removes the breakpoint.
3.
I've cleaned the build, restarted xCode, restarted the iPhone, removed the app from the iPhone. Same issues.
4.
If I don't use breakpoints, the app doesn't crash, but the code right after that line is "skipped", but it was working before. At least the app doesn't freeze without breakpoint.
What the hell ?
I've had similar problems with the debugger in the past too. Try switching from LLDB back to GDB (From the Product / Edit Scheme menu). I've found LLDB to do exactly what you are describing with breakpoints.

iOS UI Automation deactivateAppForDuration failure

I'm working on my first UI Automation script and am encountering a failure at the deactivateAppForDuration line below:
// Verify password field is shown when app is moved to the foreground
UIALogger.logMessage("move app to background");
target.deactivateAppForDuration(10);
UIALogger.logMessage("move app to foreground");
The error I get from Instruments is:
Script threw an uncaught JavaScript error: Cannot perform action on invalid element: UIAElementNil from target.frontMostApp().switcherScrollView().buttons()["TimeClock"]
What I see on the test device is that the app has been switched to the background and the iOS app switcher is showing. I can see my app (TimeClock). It appears from both the error message and the device screen that UI Automation isn't able to select my app for transition to the foreground.
Has anyone else encountered this problem? Is there a work-around?
Thanks.
I have tried your code and it works fine here. If you run the following code (nothing else) in a new Instruments file, does that work?
var target = UIATarget.localTarget();
UIALogger.logMessage("move app to background");
target.deactivateAppForDuration(1);
UIALogger.logMessage("move app to foreground");
Please note: Instruments is not always showing you exactly where an error happens. Sometimes its a few lines above or below the line it's showing.
BUT: the reason why the error happens is correct. I admit that you have a bug in this line, that I guess you are calling after coming back from the Springboard:
Script threw an uncaught JavaScript error: Cannot perform action on invalid element: UIAElementNil from target.frontMostApp().switcherScrollView().buttons()["TimeClock"]
Are you sure the element switcherScrollView().buttons()["TimeClock"] exists in your app and are accessible?
I have had the same problem. Rebooting my device solved it for me.

Resources