Xcode 7 Playground execution EXC_BAD_ACCESS - swift-playground

Running the simplest, default code in Xcode 7 playgrounds... get the following error
Playground execution failed: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x8).
* thread #1: tid = 0x351bc3, 0x00000001062019ca libicucore.A.dylib`utext_clone + 22, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
* frame #0: 0x00000001062019ca libicucore.A.dylib`utext_clone + 22
frame #1: 0x000000010633ac42 libicucore.A.dylib`icu::RegexMatcher::reset(UText*) + 54
frame #2: 0x0000000106375414 libicucore.A.dylib`uregex_setText + 222
frame #3: 0x0000000103d1b445 Foundation`-[NSRegularExpression(NSMatching) enumerateMatchesInString:options:range:usingBlock:] + 2325
frame #4: 0x0000000103d65d7e Foundation...
Cannot run anything in playgrounds basically.
Running beta 4 (7A165t)
I also have Xcode 6.2 running playgrounds just fine on the same mac.

Complete reinstall of all versions of Xcode plus deleting folder Library/Developer fixes the issues (see https://forums.developer.apple.com/thread/13969).

I just had this issue - before a fresh install check you haven't got IOS simulator running in the background anywhere from another xcode project or previous session. Once I closed the IOS simulator, closed xcode and re-launched and opened the playground again it worked fine. Seems I had a problem with xcode trying to open multiple simulators.

EXC_BAD_ACCESS Exception thrown when you try to send a message to already released object.
Apple provides mechanics with special class NSZombie which replace every released object in memory.
You could find more details on following links:
http://www.touch-code-magazine.com/how-to-debug-exc_bad_access/
http://loufranco.com/blog/understanding-exc_bad_access

Related

Xcode 13.4 Simulator / preview not working: TimeoutError: Timed out waiting for connection to DTServiceHub after 15.0 seconds

Getting this error every time I try to simulate on Xcode. "TimeoutError: Timed out waiting for connection to DTServiceHub after 15.0 seconds."
Updated 2017 iMac to Monterey 12.5 on Monday - 4 days ago. Downloaded Xcode 13.4.1 onto it.
Since then, have not been able to run simulator even once as pop up - or resume auto preview. Zero simulation success even with an empty 'hello world' app.
Every time I try to preview the machine grinds to a near halt, everything else stops too. After around 30 minutes the wheel stops spinning and it generates the error message - but it is taking that long to even show the error message.
If I 'try again' it instantly red x's and shows error message again instantly without even trying to preview.
The dialogs show that it is building successfully, but it is in the preview space that the fail happens.
I have the diagnostic logs but can't see anything that leaps out at me (but to be fair I don't know what Im looking for.)
I have uninstalled Xcode, and reinstalled it. It seems to have taken, and everything works but this.
Any help greatly appreciated. Thanks
I'm seeing the same behavior in the brand new Version 14.0 (14A309) release. I was working in iPhone 14 Pro most of the day today.
So what fixed it for me was changing the simulator type. For some reason my iPhone14Pro went sideways and I got stuck on this error. My guess is when I rebooted earlier today the simulator persisted something in a weird state.
Setting the iOS Device simulator to a different iPhone model, caused it to refresh and build and it's now working for me.
It looks like picking from RECENT in the menu has a weird state bug. Pulling from the device list below that I was able to bounce to iPhone 11 and then back to iPhone 14 Pro as LONG AS I did not pick from 'recent' list.
I got the same error after updating Xcode to version 14.2
Before that I used an Xcode 14.0 beta 6. Fortunately, this beta version is still working, and the preview is still working well too.
I found a workaround for my problem - I downloaded the latest version (14.2) of Xcode from this page https://developer.apple.com/download/applications/, and it works well with preview. The version from AppStore still doesn't work, but that doesn't matter to me now.
The timeout issue got away after changing preview from iphone 14 pro to SE. I guess the issue was because of low system memory. However, running separately on iPhone 14 pro simulator it is working quite well. So I switch between preview and run.

Xcode 10 won't start / crashes on launch

Just updated to macOS Mojave and then from Xcode 9 to Xcode 10 (via App Store). But when I start Xcode 10, it starts for a second and then immediately closes, no error messages or crash report dialogs are shown.
I opened the Console app and saw some log messages that might be related:
CODE SIGNING: cs_invalid_page(0x1048a3000): p=6061[Xcode] final status 0x23006a00, denying page sending SIGKILL
CODE SIGNING: process 6061[Xcode]: rejecting invalid page at address 0x1048a3000 from offset 0x282000 in file "/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/DVTKit" (cs_mtime:1536705076.0 == mtime:1536705076.0) (signed:1 validated:1 tainted:1 nx:0 wpmapped:0 dirty:0 depth:0)
I solved it by deleting Xcode 10 (and also Xcode 10 beta that I had installed as well). Then reinstalled Xcode 10 from the App Store. Also restarted computer. Then it worked.
I deleted xcuserdata from within the xcworkspace and it fixed it for me... much faster than re-downloading xcode.

Xcode crashes when creating a new project

Every time I try to create a new project in Xcode, the first window, which asks me for the kind of project I want to create, comes up, but after 5
seconds Xcode completely crashes:
Dyld Error Message: Library not loaded:
#rpath/IBCocoaTouchToolFoundation.framework/IBCocoaTouchToolFoundation
Referenced from:
/Volumes/VOLUME/executable_path=/*/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Overlays/Interface
Builder Cocoa Touch Tool Reason: image not found
Creating a playground works, but when Xcode tries to compile it, it fails:
Playground execution terminated because the playground process exited
unexpectedly.
Also my previously working project doesn't build anymore with following error:
Please file a bug at http://bugreport.apple.com with this warning
message and any useful information you can provide. Command
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool
failed with exit code 255
When selecting the main.storyboard or launchscreen.xib in the navigator, it also crashes immediately without any error-message afterwards.
I already re-installed Xcode multiple times, which didn't change anything.
I'm running OS 10.11 Public Beta 3 on a MacBook Pro mid 2014

Crashes after updating to XCode 6 beta

I've just upgraded to XCode 6 (iOS 8 SDK) and I am getting the following warning and error in the console that did not occur in XCode 5 (iOS 7 SDK):
2014-06-08 08:58:57.266 ColorChaos[3250:138871] SetAppThreadPriority: setpriority failed with error 45
2014-06-08 08:59:27.303 ColorChaos[3250:138871] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSSetM addObject:]: object cannot be nil'
The SetAppThreadPriority seems to be just a warning because the app continues to run, but a few seconds/touches in it crashes with the NSInvalidArgumentException error.
Has anyone else experienced anything similar after updating? The error is not occurring in my code (I don't think), it highlights the line in main.m with Thread 1: signal SIGABRT.
Thanks in advance.
EDIT: I should note I've just realised XCode 5 is still installed along side XCode 6 and I can still compile and run my code in that so it's not really an issue any more but it would still be nice to know if it can be fixed.
I was running into a similar problem. If you're running off an iOS simulator make sure it's set to iPhone 5 or above. Swift code won't run on iOS 4 which, I believe, is the default emulator device for XCode 6.

Xcode 4 line of crash in code

Xcode 3 would show me the line that caused a crash when debugging.
How do you turn this feature on in Xcode 4 ??
I have added an Exception Breakpoint as suggested here but no joy:
How to display the exact line of code causing application crash in xcode 4 debugger like in xcode 3.2

Resources