XCode debugger not helping find device-only issue - iphone

So, I have an iOS tabbed app (live and free in the store [http://itunes.com/apps/iphoundyou]). One tab is a grouped tableview, with the number of groups (1 or 2) dependent on some JSON that a web service returns. The JSON is valid and straightforward. Handling it seems to be easy, and, when run in the simulator, behaves as expected. However, I just found that when run on the device, if the two section reaction is needed...it crashes.
"ok" I thought "I'll just hook up my device, launch the debugger, replicate the crash, and figure out where I have a bug"
However, when I did that, I get the most unhelpful response I could expect:
So, given that it works in the simulator, is there any suggestions as to how else to track down the flaw? The code for the tableview is nothing special, along the lines of "if this JSON key exists, number of sections=2...with the number of rows of that section equal to the number of items in another array within the JSON"
Another note: I recently started seeing a dozen or so of these when launching an app:
unable to read unknown load command 0x25
unable to read unknown load command 0x26
Thanks so much.

In my case it turned out that it was just my own error: I'd updated my device OS but didn't have that SDK (I was behind in updating XCode)

Related

VSCode exits while debugging a flutter app

It seems like vscode is trying to present data in the Locals and/or Watch for a large object but after about 10 seconds, it will kill the app and give the message "Exited (sigterm)" in the debug console. I can pinpoint it to one example where I break on a line immediately after this line:
Uint8List inputBytes = Uint8List.fromList(List.filled(100000000, 0));
I can see "Locals" spinning around but nothing happens and then the app terminates. Is there a setting that can prevent this somehow? Maybe it can cap the represented data at a certain length instead of trying to print it all out?
(I believe this is a vscode specific problem because when I repeat these steps in Android Studio, it doesn't have this issue)
Thanks.
This is a bug in the debug adapter. It should know this is a list and fetch a paged view of the elements, but it's currently fetching them all. For me it doesn't crash, but it also doesn't respond within several minutes.
I'm working on a fix that will let VS Code page through the data:
This will ship in an upcoming Dart/Flutter SDK release.

iOS 10 simulator not working

I have a set of UI automation test cases for my iPhone app.
These tests run fine on the iOS 9 and 8 simulator however when I change to the most recent simulator (10.2) I get this error in my terminal
objc[8642]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x11f55b998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x11f37d880). One of the two will be used. Which one is undefined.
2017-01-06 10:50:51.918 myAPP[8642:947316] -canOpenURL: failed for URL: "gplus://" - error: "This app is not allowed to query for scheme gplus"
2017-01-06 10:50:52.142 MyAPP[8642:947316] [Crashlytics] Version 3.7.3 (114)
Any idea why this is happening? Has anyone else experienced this?
The messages you're showing seem to indicate two distinct problems. The first is that you have two definitions of PLBuildVersion. The second is the "This app is not allowed to query..." issue.
The likely cause of the second problem is that you need to declare the schemes your app uses in your Info.plist. Use the key LSApplicationQueriesSchemes and list the schemes you want to look for. Without that, your call to -canOpenURL: will fail as you've seen.
The first problem is nicely described in Class PLBuildVersion is implemented in both frameworks, and from what I read there it doesn't seem to be anything to worry about.

what is bus error ? when it comes?

in my application bus error is showing and application crash ..i want to know when this error comes . what mean by bus error ?
in my application page on diffrent id i have to calling libxml parsing . in many times calling, ones it crash .
Usually bus error occurs when you are trying to access a deallocated object. Set NSZombieEnabled to check which object get released.
As getluky states in his answer on Unity Answers:
I've seen SIGBUS often occur on NULL reference exceptions that occur
at runtime. They are usually fairly straightforward to track down via
the XCode debugger - hit the Continue button a couple times while
monitoring the XCode debug console output. It usually will give a hint
as to what file and line number the null reference was in.
Not sure why recreating the XCode project would fix it - it's usually
an issue that recurs unless I can fix the underlying problem

Debugging SIGABRT within NSManagedObjectContext -save:

From inside NSManagedObjectContext -save: I am getting this message:
Assertion failed: (_Unwind_SjLj_Resume() can't return), function _Unwind_SjLj_Resume, file /SourceCache/libunwind/libunwind-24.1/src/Unwind-sjlj.c, line 326.
Program received signal: “SIGABRT”.
warning: Unable to read symbols for
/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1
(8C148)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib
(file not found).
This happens when I delete an Experiment object with to-many with Run which has to-many with Sample which has to-one with Data. Experiment also has to-many with Page which has to-many with Display which has to-many to Run. I mention this to point out the cyclical nature of the graph. Here is a simplified graph of model:
An Experiment a top level entity with which the user interacts. An Experiment contains multiple Run objects. A Run is a collection of data starting at a particular time and ending at a later time. Since data can be collected from multiple sources simultaneously, there is a Sample for each source for each Run. An Experiment contains data and this data needs to be viewed and interacted with. So, each Experiment has some number of Page objects and each Page contains some number of Displays (e.g., graphs, meters). A Display is configured to display some subset of the Runs that belong to the Experiment. So, while an Experiment may contains dozens of Runs, one of its Pages will only display a few of those Runs at a time. The Display entity maintains this list. A Display is not a view. A view will reference a Display object and be notified of changes to the Display object.
I had been using Delete Rules but have now switched to "No Action" delete rules in combination with -prepareForDeletion methods for all of these classes. This change made no difference. In both cases, the error message is the same.
Interestingly, when I relaunch the app, all the objects that were marked for deletion have been deleted.
Also, if an Experiment has no Run objects, then deletion works without incidence. For that matter, deleting a single Run from an Experiment also works.
I am hoping that someone has seen something like this and can offer advice on what would cause this. Or, if someone has advice on how to get libXcodeDebuggerSupport.dylib for iOS 4.2.1, that might also be helpful.
Update: I followed advice found here and was able to get Xcode to find libXcodeDebuggerSupport.dylib for iOS 4.2.1. But this did not help at all in diagnosing problem - which persists.
Update 2: After reading a bit and downloading a version of unwind-sjlj.c, it seems that I am dealing with something like an uncaught exception. I am not sure how this helps me...
Update 3: Thanks to Kamchatka, I did something I probably should have done a few days ago: turned on "Stop on Objective-C Exceptions". This allowed me to see that a reference to a deleted object was still being held - and, worse, was key-value observing the deleted object. Fixing this fixed problem and I was able to revert to using delete rules rather than -prepareForDeletion methods.
You should try to activate "Run > Stop on Objective-C exception". It allowed me to find the place where there was an access to an object turned into fault which was the root cause of the problem.

iphone core data app crash

I'm able to complete my iphone app using core data internally.
But for the first time when I'm running in simulator or on device its crashing with following error:
2010-03-18 10:55:41.785 CrData[1605:4603] Unresolved error Error Domain=NSCocoaErrorDomain Code=513 UserInfo=0x50448d0 "Operation could not be completed. (Cocoa error 513.)", {
NSUnderlyingException = Error validating url for store;
}
When I run the app again in simulator or on device, its running perfectly. I'm not able to identify the exact problem. Can some one guide me on how to proceed further???
You need to unroll the errors and see what is going on. Inside of that error (which you can set a break point on objc_exception_thrown to catch it) is the userInfo dictionary which you can interrogate to see what the underlying errors are.
update
What does your NSPersistentStoreCoordinator creation code look like?
Did you add a break point and do a po [error userInfo] so see if there were any additional errors in the userInfo?
Core Data can and does send you a hierarchy of errors and frequently on a small amount of information is exposed at the top error. Unrolling the errors via the debugger is best to determine the underlying causes.
update
Code error 513 means, write permissions for creating store in core data app failed. But the same piece of code is running well from next time. So, what might be the actual problem is not known to me..... how to proceed here.
Again, what does your persistent store creation code look like? You need to post some code so that I can take a look at it. Otherwise I am just guessing which is no fun.
8.2 has become more strict on the location (and permissions) of your persistent store. I've just seen the "513" error appear when the database was stored in the bundle and used with a read only option. Using a device with 8.1 it worked without failing, but on 8.2 the error and exception appeared causing a crash. On the simulator the exception did not occur and happily continued to work.
The solution that worked to copy the database into the application documents directory at start up.
NSFileManager copyItemAtURL:toURL:error will come in useful.