Track down source of "eroneous" Xcode breakpoint trigger - xcode

I am getting several (annoying) triggered breakpoints for my project that don't seem to correlate with any real actionable exceptions. I have removed all breakpoints from my project, the only one being the "exception breakpoint." The issue is, is that when I run my project, it is being triggered in the main function and does not provide much detail about where the exception occurred...I can usually just skip over it (usually a couple times) without any issue. This has only recently started happening, but I am having trouble tracking down the source of what's actually triggering the breakpoint. I'm running Xcode 6.1.1, but the issue hasn't always occurred with the particular version I am using. I have included some screenshots of my configuration/the triggered break point:

The issue was that I was listing a font in my Info.plist (Fonts provided by application) that was not part of the application bundle.

Related

Running unit tests in Xcode 8 causes error "could not load inserted library '.../IDEBundleInjection' because image not found"

I am suddenly running into the error when testing my iOS 10 app in Xcode 8.
dyld: could not load inserted library
'__PLATFORMS__/iPhoneOS.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection'
because image not found
The app's tests ran successfully before. I had then deleted the skeleton UI Test Case class that was created together with the project, so this may have caused the problem (somehow). I have since recreated that class, but the problem remains.
What exactly does the error message indicate and how can I overcome the problem, i.e. successfully run the app's unit tests again.
UPDATE There must be another root case, for if I create another (empty) Single View Application project in Xcode and run its unit tests, the same error occurs.
The error only occurs when running unit tests on a device, not on simulators.
UPDATE This response from Apple to a similar report suggests the error is related to code signing. The app itself runs fine on the same device, so how could there be a code signing issue in my case?
Try these one by one:
Try to create a new UnitTest target, copying everything over, and removing the old one.
In General Tab Panel, do not leave the Team to "None". Select your team. And select the correct Code Signing Identity from Settings. It was set to a non default - changed to 'IOS Developer' for the Debug setting entry.
Disable "Enable guard Malloc" from diagnostics to run app in device.
This may be because Xcode mount wrong DeveloperImage. If you open the Settings-> Developer you will see that the "Enable UIAutomation» and others are missing. To fix:
(A) move all folders from "/Applications/Xcode8.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport" except "10.0 (12A4297e)" to safe place
(B) reboot the phone
(C) connect your phone to xCode 8
(D) restore folders in DeviceSupport
This is the only thing that helped me. Even re-flashing on ios10 does not helps.
This is old, but it may help you: In the target's General tab, there is an Embedded Binaries field. When you add the framework there the crash is resolved.
Reference is https://devforums.apple.com/message/991384#991384 on Apple Developer Forums.
Best of luck!
There is a restart mechanism in Xcode testing infrastructure that detects crashes during tests and attempts to restart testing to complete any remaining tests. There may be an issue with how that mechanism is setting up DYLD_INSERT_LIBRARIES following a crash in your tests - please file a report at https://bugreport.apple.com and attach your project if possible.

Xcode 6.4 crashes in Swift breakpoint

In one project I'm using I can't set breakpoints in Swift code, Xcode always crashes when reaching one of them, doesn't matter if it's a "manual" or an exception breakpoint.
In other projects everything works as expected, only for one project Xcode 6.4 (6E35b) always crashes.
I tried cleaning, deleting derived data, resetting simulator, restarting Xcode/Mac - nothing helped at all.
Anyone else experiencing this problem and hopefully knows what helps?
EDIT
Seems only to be the case on one machine (Xcode 6.4, 10.10.5), but not on the other (Xcode 6.4, El Capitan). But as I mentioned in the comments, reinstalling Xcode didn't help, are there some other preferences I could reset/delete?
EDIT2
Here's the Xcode crash log file:
https://dl.dropboxusercontent.com/u/119600/Xcode_2015-08-12-074655_Stefans-iMac.crash
I would try uninstalling and reinstalling Xcode to see if it helps... I've heard of successes with this technique for similar issues.
Just delete the entire Xcode.app from /Applications, and reinstall from the .dmg. If you're not certain of the binaries and have time / bandwidth, consider re-downloading the .dmg.
If that doesn't work, try the following source control tricks (substitute "your favorite revision control" for "git"):
Try purging all objects not in source code control
Another approach: Check out the app again into a fresh repository (this will get even the files that may have been committed but ignored later).
If not under source code control, grab a .gitignore from here and add it to git, then check out into another directory (this will leave everything but source, interface builder, project files and resources/assets behind).
I'd suggest moving the breakpoint code to another location (such as making a function call and breaking either before or inside the function). However, if all Swift code has this problem, that may not work.
Finally, after making an interim commit (to roll back to), try it in Xcode 7 beta. Bit of a hassle because you have to upgrade to Swift 2.0, but if you keep the deployment target the same no iOS target changes are needed.
If this really is a burden and/or it's a small project, you could try creating a new project and migrating the files and storyboard over, but likely this is too much effort.
Either way, since you note it's pretty much all breakpoints in Swift code, file a bug with Apple's bug reporter. They really need to hear about issues such as this, since you don't seem to be alone in having this issue.
EDIT: Where are others seeing this issue?
Maybe we can see commonality -- since this is only reported in Swift projects (so far). A colleague has seen this problem with breakpoints (as well as stepping through code) in Xcode 6.4 on 10.10.4. (I've seen Xcode 6.4 crashes in the past as well).
I see OS version 10.10.5 mentioned as a target where this happens (#swalkner); is this a beta? If OS 10.10.4/5 is the only place we see this, it might be significant. If it's a project/OS interaction, it might be tricky to reproduce / fix, but I'd encourage everyone to submit detailed bug reports to Apple (maybe even link this post).
Some points to note if you're seeing this:
Operating System Version
Hardware
Target: Simulator vs. Hardware; iOS vs WatchKit app.
Target SDK version(s)
Swift only? Or on an Objective-C only project? Mixed?
Only one project, or several?
It's a longshot, but let me know if it's working:
uncheck the "Always show Dissasembly" check
Debug > Debug Workflow > Always Show Disassembly
In older versions of Xcode (<6.1):
Product > Debug Workflow > Show Disassembly When Debugging
I've just spent the past few hours trying to solve exactly the same issue.
I thought at first, it had started due to installing Xcode 7 on the same machine as Xcode 6.4. The problem certainly coincided.
However, due to having version control, I could look and see what files had changed since opening the project with Xcode 7.
The images.xcassets file had changed. Reverting this file back has stopped Xcode from crashing each time it hit a breakpoint.
I'm not sure whether this helps at all, but definitely look at images.xcassets and if needs be, delete it, recreate it and ensure it's setup 100%. It certainly fixed my issue.

Scintilla error message on unrelated code

First off, ScintillaNET v2.6 was installed as a control and I have been able to use it and compile, so I assume the installation is ok:
This app is targeting the full .NET 4.0 framework, not the client profile)
Environment variable
ScintillaNT folder content
The error message:
The code triggering the error:
The error happens on the second line when I "step-in" the load method. Looks completely unrelated, but highly reproducible: the error always happens at that exact step.
The problem turned out to be a corrupted XML file. I still don't know why the crash page was all about ScintillaNET, but it appears this had nothing to do with Scintilla.
I am not deleting this question because I could not find any indication that this could happen (errors in different parts of the code triggering a Scintilla error page) and it would have saved me a lot of time trying to track back the "scintilla" problem.

Compile Failed Storyboard

Output in Log:
ibtoold(1642,0x7fff78b64960) malloc: error for object 0x7fbf38056a08: incorrect checksum for freed object - object was probably modified after being freed.
set a breakpoint in malloc_error_break to debug
Command /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool failed with exit code 255
The setup:
The project was received through git. I had tried to compiled the project, but got the eror. Nothing was changed before, but used the new version of Xcode 4.3 instead of 4.2.
Things I tried:
Clean and Rebuild
Create new project and import files and sources into new project
Restart Computer & Xcode
Conclusion
There were people that have similar problems, but not the exact problem. Please forgive me if I don't see the obvious problem, I can't figure out what is the cause of the problem.
This is a reported bug already filed with Apple. I have tried duplicating the issue and the error occurred randomly when creating iPad storyboards only (for me). My iPhone storyboard has 30+ views with zero issues. Makes it pretty tough to complete a Universal app as of right now. It appears to be a memory issue since I can make the error occur by simply removing the last view I added (view contains a lot of UILabels also)
YMMV but closing and opening the Xcode project resolved the issue for me. It occurred after I git stash popped some storyboard changes.

ILCrashreporter breaks Sparkle updates

I have just added ILCrashReporter-NG to my application to log application crashes. Unfortunately it seems to have broken my Sparkle updates (Sparkle gives an error when the appcast has downloaded and the Install button is clicked). I have added the ILCrashReporter launchReporterForCompany: report addr: method to applicationDidFinishLaunching. Does anyone have any experience of implementing these two frameworks together and if so, is this a problem that you encountered.
I use the two together without any problems. What's the error that you get? Did you change anything else besides adding Sparkle?
The only time I've had the update fail, as you describe, was after changing my bundle id so that the bundle id in the update and the application didn't match.

Resources