Should I be able to set breakpoints inside the Cocoa framework itself?
I've been seeing various crashes in my Mac OS X application, sometimes randomly. Here's part of an example call stack from Xcode:
0 - 0x98ed0e20 in __CFRunLoopRun
1 - 0x98ece464 in CFRunLoopRunSpecific
2 - 0x98ece291 in CFRunLoopRunInMode
3 - 0x96a90004 in RunCurrentEventLoopInMode
4 - 0x96a8fdbb in ReceiveNextEventCommon
5 - 0x96a8fc40 in BlockUntilNextEventMatchingListInMode
6 - 0x925b078d in _DPSNextEvent
7 - 0x925affce in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
8 - 0x92572247 in -[NSApplication run]
9 - 0x021f009c in QEventDispatcherMac::processEvents at qeventdispatcher_mac.mm:591
10 - 0x01e47742 in QEventLoop::processEvents at qeventloop.cpp:149
11 - 0x01e4799e in QEventLoop::exec at qeventloop.cpp:201
12 - 0x01e49a33 in QCoreApplication::exec at qcoreapplication.cpp:1003
13 - 0x02254c54 in QApplication::exec at qapplication.cpp:3581
When I click on lines 0 - 8, Xcode displays disassembly.
I've changed my Xcode project so that it uses the _debug suffix when loading frameworks. This allows me to step through the Qt code in lines 9 - 13, but line 8 is called at startup and crashes can happen at any time after that.
If I can't set breakpoints, are there any tools that might help me debug problems like this?
Thanks in advance.
You can set up a breakpoint so it breaks on code outside your own. But you will not be able to see the source because you don't have the source code.
In xCode (3.x.x)
"Run->Manage Breakpoints->Add Symbolic Breakpoint"
In XCode 4 you can create a symbolic breakpoint with
Product->Debug->Create Symbolic Breakpoint...
In XCode 5
Debug->Breakpoints->Create Symbolic Breakpoint
Related
I am not able to start up XCode. Whenever it starts it just crashes with this error:
Application Specific Information:
ProductBuildVersion: 8E3004b
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-12175.1/IDEKit/Application/IDEDocumentController.m:2136
Details: There can only be one document registered with a given URL. newDocument:<IDEWorkspaceDocument: 0x7ff6612d6cd0>( 0 -[IDEWorkspaceDocument init] (in IDEKit)
1 -[NSDocument initForURL:withContentsOfURL:ofType:error:] (in AppKit)
2 -[IDEWorkspaceDocument initForURL:withContentsOfURL:ofType:error:] (in IDEKit)
3 -[NSDocumentController makeDocumentForURL:withContentsOfURL:ofType:error:] (in AppKit)
4 __104-[NSDocumentController makeDocumentForURL:withContentsOfURL:alternateContents:ofType:completionHandler:]_block_invoke (in AppKit)
5 -[NSDocumentController makeDocumentForURL:withContentsOfURL:alternateContents:ofType:completionHandler:] (in AppKit)
6 __89-[NSDocumentController reopenDocumentForURL:withContentsOfURL:display:completionHandler:]_block_invoke (in AppKit)
How can I get Xcode start again?
EDIT:
Version of the xcode is 8.3.3
For me, the solution was to remove all custom color pickers in:
~/Library/ColorPickers/
Remove this folder
/Users/<your user name>/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState
I upgraded to XCode 8, and I am going through hell of being able to run my tests sometimes... For example, I just was testing some code, and was able to run my tests 3 times in a row... and then the 4th time I got:
dyld: could not load inserted library 'PLATFORMS/iPhoneOS.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection' because image not found
*** If you believe this error represents a bug, please attach the log file at /Users/patrick/Library/Developer/Xcode/DerivedData/MyApp-hjfppqmgxqrprucknvwtakynpqxs/Logs/Test/2B6C2EAE-5C13-40C9-BACE-3A00AA74F3EF/Session-UnitTests-2016-09-20_124123-gk3pW0.log
I have rebooted my iOS device, rebooted my computer, deleted derrived data, etc... It will no longer run tests. ARRRGH!!!!
UPDATE
I should mention, I am trying to run tests on my iPad, I can't run tests on the simulator because I have too much code having to do with NEON intrinsics, and so the simulator wont run.
But what does seem to work is, when this happens, switch to build tests on my iPhone, then it when it builds, it just says "running tests" and the spinner spins forever, but no tests are actually running... I can actually tap on my app and interact with it, which is usually not the behavior I get when running tests... Anyway I then stopped the build, switched back to my iPad and now tests run again.
I get this error consistently with XCode 8.0 running on my iPad (Version 10.0.2 (14A456)) when I run test code that causes an uncaught exception in the code under test. There may be other examples, but it happens any time the code under test fails catastrophically.
When the unit test fails with an exception, XCode does not recover properly.
I believe this is a problem with XCode; this answer provides a workaround. The unit test will fail at the exception, and subsequent runs produce the 'image not found' error.
The simplest recovery I've found is the following:
Set device target to Generic iOS Device
Disconnect my iPad
Reboot the iPad
Connect everything back together
Here is an example failure that demonstrates the problem;
Notice that the core issue in this example is that I have written a bad unit test; I'm passing a nil parameter to a method that is subsequently used to try adding a nil object to a dictionary.
Update: for the sake of accuracy, the issue was that I was passing an immutable dictionary as a parameter when a mutable one was expected, thus producing the 'unrecognized selector' error. In any case, the exception is what causes XCode to behave badly.
Assertions: failed: caught "NSInvalidArgumentException", "-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance 0x1818f200"
(
0 CoreFoundation 0x1dd89e1f <redacted> + 154
1 libobjc.A.dylib 0x1cfef077 objc_exception_throw + 38
2 CoreFoundation 0x1dd8f515 <redacted> + 0
3 CoreFoundation 0x1dd8d589 <redacted> + 700
4 CoreFoundation 0x1dcb2f08 _CF_forwarding_prep_0 + 24
5 tDefense 0x000cd299 +[PlayingPiece addPlayingPiece:atLocation:onBoard:] + 326
6 tDefense 0x000cd5ad +[PlayingPiece addNewPiece:atLocation:onBoard:] + 154
7 tDefenseTests 0x00410777 -[PlayFieldTests testGetNeighbors] + 4594
8 CoreFoundation 0x1dd8e864 <redacted> + 68
9 CoreFoundation 0x1dcaf349 <redacted> + 294
10 XCTest 0x00307de5 __24-[XCTestCase invokeTest]_block_invoke_2 + 472
11 XCTest 0x0033b0dd -[XCTestContext performInScope:] + 312
12 XCTest 0x00307c07 -[XCTestCase invokeTest] + 296
13 XCTest 0x00308439 -[XCTestCase performTest:] + 560
14 XCTest 0x0030578d -[XCTestSuite performTest:] + 520
15 XCTest 0x0030578d -[XCTestSuite performTest:] + 520
16 XCTest 0x0030578d -[XCTestSuite performTest:] + 520
17 XCTest 0x002f1d55 __25-[XCTestDriver _runSuite]_block_invoke + 52
18 XCTest 0x00312325 -[XCTestObservationCenter _observeTestExecutionForBlock:] + 628
19 XCTest 0x002f1bed -[XCTestDriver _runSuite] + 512
20 XCTest 0x002f29b7 -[XCTestDriver _checkForTestManager] + 300
21 XCTest 0x0033c55b _XCTestMain + 690
22 CoreFoundation 0x1dd45bc3 <redacted> + 10
23 CoreFoundation 0x1dd455a7 <redacted> + 230
24 CoreFoundation 0x1dd43a61 <redacted> + 752
25 CoreFoundation 0x1dc93073 CFRunLoopRunSpecific + 486
26 CoreFoundation 0x1dc92e81 CFRunLoopRunInMode + 104
27 GraphicsServices 0x1f43bbfd GSEventRunModal + 156
28 UIKit 0x22e34acf <redacted> + 574
29 UIKit 0x22e2f201 UIApplicationMain + 150
30 tDefense 0x000d690f main + 106
31 libdyld.dylib 0x1d45e50b <redacted> + 2
)
File: <unknown>
I was having exactly the same problem after upgrading to Xcode 8 / Swift 2.3. One of deleting derived data, rebooting the phone and closing and re-opening Xcode just fixed it.
Today I uploaded my first build of first app successfully to App Store for beta testing. After making a few changes, when I tried to submit the new archive again Xcode crashed, and still crashes.
It's the log:
Process: Xcode [36810]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 6.3.2 (7718)
Build Info: IDEFrameworks-7718000000000000~2
App Item ID: 497799835
App External ID: 812404257
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [36810]
User ID: 501
Date/Time: 2015-06-17 21:59:26.432 +0430
OS Version: Mac OS X 10.10.3 (14D136)
Report Version: 11
Anonymous UUID: A70B5585-6ADF-B647-C184-94420293DB9F
Sleep/Wake UUID: 536542A5-38C8-405F-8A5E-28DBE775C033
Time Awake Since Boot: 110000 seconds
Time Since Wake: 18000 seconds
Crashed Thread: 14 Dispatch queue: NSOperationQueue 0x7fdb9771af00 :: NSOperation 0x7fdb97679160 (QOS: USER_INITIATED)
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
ProductBuildVersion: 6D2105
ASSERTION FAILURE in /SourceCache/IDEFrameworks/IDEFrameworks-7718/IDEFoundation/Issues/IDEIssueManager.m:457
Details: This method must only be called on the main thread
Object: <IDEIssueManager>
Method: +_issueProviderInfo
Thread: <NSThread: 0x7fdb971db920>{number = 80, name = (null)}
Hints: None
Backtrace:
0 0x0000000102e28b6a -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
1 0x0000000101b765df _DVTAssertionHandler (in DVTFoundation)
2 0x0000000101b768ce _DVTAssertionFailureHandler (in DVTFoundation)
3 0x00000001024f248e +[IDEIssueManager _issueProviderInfo] (in IDEFoundation)
4 0x00000001024f1b0d -[IDEIssueManager _updateIssueProviders] (in IDEFoundation)
5 0x0000000101b893de __73-[DVTObservingBlockToken observeValueForKeyPath:ofObject:change:context:]_block_invoke (in DVTFoundation)
6 0x0000000101afed5c DVTInvokeWithStrongOwnership (in DVTFoundation)
7 0x00000001019b03e4 -[DVTObservingBlockToken observeValueForKeyPath:ofObject:change:context:] (in DVTFoundation)
8 0x00007fff8a8af0f3 NSKeyValueNotifyObserver (in Foundation)
9 0x00007fff8a8bbd68 NSKeyValueDidChange (in Foundation)
10 0x00007fff8a87497d -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] (in Foundation)
11 0x00007fff8befddaf doSetValuesInSourceWithKVO (in CoreFoundation)
12 0x00007fff8befdc46 _CFXPreferencesReplaceValuesInNamedVolatileSource (in CoreFoundation)
13 0x00007fff8aa4b027 -[NSUserDefaults(NSUserDefaults) setVolatileDomain:forName:] (in Foundation)
14 0x0000000119e34a13 -[NSUserDefaults(ITunesConnectFoundationExtensions) REPLACEMENT_setVolatileDomain:forName:] (in ITunesConnectFoundation)
15 0x0000000119e34f87 -[NSUserDefaults(ITunesConnectFoundationExtensions) synchronizeRegistrationDomains] (in ITunesConnectFoundation)
16 0x0000000119e34d5d -[NSUserDefaults(ITunesConnectFoundationExtensions) registerPriorityDefaults:] (in ITunesConnectFoundation)
17 0x0000000119e2669e -[MZJSONServiceClient processApplicationSettings:] (in ITunesConnectFoundation)
18 0x0000000119e26d7d -[MZJSONServiceClient connectionDidFinishLoading:] (in ITunesConnectFoundation)
19 0x00007fff8846d24d __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke (in CFNetwork)
20 0x00007fff8846d0b1 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] (in CFNetwork)
21 0x00007fff8846cfb7 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] (in CFNetwork)
22 0x00007fff8846df74 ___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke (in CFNetwork)
23 0x00007fff88521703 ___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 (in CFNetwork)
24 0x00007fff883c2cec RunloopBlockContext::_invoke_block(void const*, void*) (in CFNetwork)
25 0x00007fff8bf0e664 CFArrayApplyFunction (in CoreFoundation)
26 0x00007fff883c2bad RunloopBlockContext::perform() (in CFNetwork)
27 0x00007fff883c2998 MultiplexerSource::perform() (in CFNetwork)
28 0x00007fff883c27ba MultiplexerSource::_perform(void*) (in CFNetwork)
29 0x00007fff8bf42a01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ (in CoreFoundation)
30 0x00007fff8bf34b8d __CFRunLoopDoSources0 (in CoreFoundation)
31 0x00007fff8bf341bf __CFRunLoopRun (in CoreFoundation)
32 0x00007fff8bf33bd8 CFRunLoopRunSpecific (in CoreFoundation)
33 0x00007fff8a8fda59 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] (in Foundation)
34 0x00007fff8a91bcce -[NSRunLoop(NSRunLoop) runUntilDate:] (in Foundation)
35 0x0000000119e25d00 -[MZJSONServiceClient getResultDictionary] (in ITunesConnectFoundation)
36 0x0000000119e28eb3 -[MZLabelServiceClient invokeSOAPCall] (in ITunesConnectFoundation)
37 0x0000000119e3097d -[MZWebServiceOperationWorker execute] (in ITunesConnectFoundation)
38 0x0000000119e30e11 -[MZWebServiceWorker run] (in ITunesConnectFoundation)
39 0x0000000119df854d -[MZWorkItem main] (in ITunesConnectFoundation)
40 0x00007fff8a8c6a6c -[__NSOperationInternal _start:] (in Foundation)
41 0x00007fff8a8c6543 __NSOQSchedule_f (in Foundation)
42 0x00007fff89468c13 _dispatch_client_callout (in libdispatch.dylib)
43 0x00007fff8946c365 _dispatch_queue_drain (in libdispatch.dylib)
44 0x00007fff8946decc _dispatch_queue_invoke (in libdispatch.dylib)
45 0x00007fff8946b6b7 _dispatch_root_queue_drain (in libdispatch.dylib)
46 0x00007fff89479fe4 _dispatch_worker_thread3 (in libdispatch.dylib)
47 0x00007fff86f91637 _pthread_wqthread (in libsystem_pthread.dylib)
48 0x00007fff86f8f40d start_wqthread (in libsystem_pthread.dylib)
Note: I can validate the Archive without error.
Will re-installing XCode help me to fix it?
Close any projects or workspace windows you have open in Xcode but leave Organizer window open and re-submit worked for me.
Just got this problem. Seems to work if you close all other Xcode windows but keep the organizer window open.
Had the same problem - uploaded my .ipa through the Application Loader.
The original question is: "Will re-installing XCode help me to fix it?"
The answer is: "No." Re-installation does not help the problem. The bug is pretty serious though, since submitting an app is central to app development. A fix should be in the App Store asap. Hence updating later may help.
Following steps worked for me:
Archive the project.
Open Organizer
Press the top-left cross button of XCode which will close all projects without quiting XCode and Organiser will be opened
Now resubmit the archive from organiser.
Had this problem today. I was only able to successfully upload the Archive when the organizer window was open and all Xcode projects were closed.
I created an .ipa file using the Export utility in Organizer, then ran Application Loader. Selected the 'Deliver Your App' button. Choose the new created ipa file and the file appeared in iTuneConnect under the pre-release tab as expected for TestFlight distribution.
Had the same problem today. Problem turned out I still had the Reveal Framework included in my project. Make sure you don't have any non-public API usage in your archive.
I encountered similar situation. However, my solution was somehow different.
Noticing that you are trying to submit next build, please make sure your previous build is excluded from App Store submit form before uploading new build.
I'm not sure why this has to be an issue, but it seems like that the submit form should be cleared before receiving new build.
You might need to accept some new user agreements, try going to Apple Developer Member Center and see if they're any new agreements you need to accept.
If that doesn't work try this: open Xcode and go to [ Preferences ] -> [ Accounts ], select your Apple ID and click on [ View Details... ]. Once you do that click on the refresh icon at the bottom left. If you're missing anything it will let you know.
If both of those don't work go back to the archive window in XCode and click on export on the right-hand side underneath the submit button. Save it where ever you want but remember the location. Once exported go back to XCode and go to [ Open Developer Tools ] -> [ Application Loader ]. You can submit your new version of your app through that.
If none of those work then I have no idea, maybe someone else knows.
I had the same issue at June 17 night. I reinstalled my Xcode, and had the same issue. Looks like Apple updated something at that day, since I noticed the website of Member Center, the MAC certificate is also there. (YES!!! apple only charge once for iPhone and Mac)
If that doesn't work, than it could also be that the used Certificate has expired. So check if your Certificate is still valid.
Archive using Xcode 6.4, submit using Xcode 7. Submission successful
On Xcode 6.3.1 using a multi-project workspace - two Swift frameworks, the app itself, and Cocoapods. I can successfully build and run the app both on the simulator as well as my iPhones, but when I try to Archive it, I get:
Command failed due to signal: Segmentation fault: 11
This error appears to happen on two of my view controller files, but I have no idea what is wrong with them. Tried building from command line. Fruitless. I've also messed with my build settings, as has been suggested in other questions, to no avail.
Has anyone experienced the same issue? Can't submit anything to app store or make a test IPA :( Here is the stack trace produced:
0 swift 0x0000000109d14a18 llvm::sys::PrintStackTrace(__sFILE*) + 40
1 swift 0x0000000109d14ef4 SignalHandler(int) + 452
2 libsystem_platform.dylib 0x00007fff8fbb0f1a _sigtramp + 26
3 libsystem_platform.dylib 000000000000000000 _sigtramp + 1883566336
4 swift 0x00000001097f0d85 (anonymous namespace)::EmitDFDiagnostics::run() + 469
5 swift 0x00000001097fa55e swift::SILPassManager::runFunctionPasses(llvm::ArrayRef<swift::SILFunctionTransform*>) + 1310
6 swift 0x00000001097fb6a7 swift::SILPassManager::runOneIteration() + 2359
7 swift 0x00000001097fbe1c swift::SILPassManager::run() + 1212
8 swift 0x00000001097f8725 swift::runSILDiagnosticPasses(swift::SILModule&) + 597
9 swift 0x00000001095fdd6f frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 4319
10 swift 0x00000001095fcae6 main + 1814
11 libdyld.dylib 0x00007fff8ff895c9 start + 1
I had the exact same problem. I discovered the thing that was keeping the app from successfully archiving was the fact that i used the find() function to find the index of an item in an array. That function is provided by Swift, but when used in my actual codebase it wouldn't archive. I'm assuming there may be a couple stock functions that are preventing archiving. And keep in mind, these functions build and can run on the simulator, but they will not archive.
Got the new Retina MacBook and it has not been playing nice with xCode. If i make a new project it works, but if i ty triggering the assistant editor it will freeze. If i save a new project and reopen it, it will freeze. I did install the 4.5 DP and uninstalled it and the latest nonbeta version of xcode and the problem still persists. Anyone know what could be the issue? If i make a new user account xcode is behaving normally. Anyone know of a fix? Crash large too large for me to post.
Date/Time: 2012-06-30 03:10:29 -0700
OS Version: 10.7.4 (Build 11E2620)
Architecture: x86_64
Report Version: 9
Command: Xcode
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Version: 4.3.3 (1178)
Build Version: 3
Project Name: IDEApplication
Source Version: 1178000000000000
App Item ID: 497799835
App External ID: 8553856
Parent: launchd [111]
PID: 234
Event: hang
Duration: 1.76s
Steps: 18 (100ms sampling interval)
Pageins: 44
Pageouts: 0
Process: Xcode [234]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Architecture: x86_64
UID: 501
Thread 0x810 DispatchQueue 1
User stack:
18 ??? (in Xcode) [0x107b73eec]
18 NSApplicationMain + 867 (in AppKit) [0x7fff85edf244]
18 -[NSApplication run] + 555 (in AppKit) [0x7fff85c630c6]
18 -[IDEApplication sendEvent:] + 366 (in IDEKit) [0x1085c2dd1]
18 -[NSApplication sendEvent:] + 4282 (in AppKit) [0x7fff85ccc536]
18 -[NSApplication _handleKeyEquivalent:] + 526 (in AppKit) [0x7fff85dd3175]
18 -[NSMenu performKeyEquivalent:] + 281 (in AppKit) [0x7fff85dd4524]
18 -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 125 (in AppKit) [0x7fff85e56932]
18 -[NSMenuItem _corePerformAction] + 399 (in AppKit) [0x7fff85e56bfb]
18 -[IDEApplication sendAction:to:from:] + 154 (in IDEKit) [0x1085c7096]
18 -[DVTApplication sendAction:to:from:] + 318 (in DVTKit) [0x107e76866]
18 -[NSApplication sendAction:to:from:] + 139 (in AppKit) [0x7fff85d69f7e]
18 -[NSObject performSelector:withObject:] + 61 (in CoreFoundation) [0x7fff8a15270d]
18 -[IDEWorkspaceTabController _changeToEditorMode:] + 361 (in IDEKit) [0x108728088]
18 _NSSetIntValueAndNotify + 259 (in Foundation) [0x7fff86f8353f]
18 -[IDEEditorArea setEditorMode:] + 384 (in IDEKit) [0x108604a61]
18 -[IDEEditorArea _refreshEditorContextsAndPreserveCurrentEditorHistoryStack:] + 642 (in IDEKit) [0x108604d8e]
18 +[DVTLayoutView_ML _recursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:] + 108 (in DVTKit) [0x107e858ec]
18 +[DVTLayoutView_ML
For me, the solution was simple:
Close Xcode
Delete the following folders/files from myProject.xcodeproj (or .xcworkspace if you're using cocoapods) (right click on the file and choose “Show Package Contents”)
/xcuserdata
/project.xcworkspace
Reopen Xcode and enjoy
The crash is occurring due to a corruption in project's userdata content.
Also, you should note that after deleting those files, the window size and position will reset and the opened tabs will be all closed.
I experienced similar problems on my Retina MacBook. The workaround is to specify "Open in Low Resolution" for Xcode in the Finder. From http://support.apple.com/kb/HT5266:
Quit the application if it is currently open.
In the Finder, choose Applications from the Go menu.
In the Applications folder that opens, click the application's icon so it is highlighted.
Choose Get Info from the File menu.
Place a checkmark next to "Open in Low Resolution" to enable Low Resolution mode.
Close the window and double click the Application to reopen it.
This does have an impact on text quality, though it's not awful (subjective). Hopefully Apple will update Xcode soon.
I am facing the same problem .... I solve it after make changes as per screenshot -
it works for me.