Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-1406] Xcode crashes indexing with swift-DEVELOPMENT-SNAPSHOT-2016-05-03-a.xctoolchain #44015

Closed
tjw opened this issue May 4, 2016 · 12 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@tjw
Copy link
Contributor

tjw commented May 4, 2016

Previous ID SR-1406
Radar None
Original Reporter @tjw
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Mac OS X 10.11.4

Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug
Assignee @shahmishal
Priority Medium

md5: 40c2c65df4be2c7fa7c9aead4aa16b60

Issue Description:

Open the attached project and wait a few seconds for Xcode to index it, and it crashes.

Thread 18 Crashed:: Dispatch queue: com.apple.xcode.swift.indexer
0 sourcekitd 0x0000000116a68360 abort + 32 (Signals.inc:440)
1 sourcekitd 0x0000000116a68331 __assert_rtn + 81
2 sourcekitd 0x00000001169e58f0 sourcekitd_send_request + 912 (sourcekitd.cpp:186)
3 com.apple.dt.IDELanguageSupportCore 0x0000000111f4dbc7 -[IDEIndexSwiftDataSource issueSourceKitRequest:requestBlock:responseBlock:] + 235
4 com.apple.dt.IDELanguageSupportCore 0x0000000111f4fe33 __46-[IDEIndexSwiftDataSource generateDataForJob:]_block_invoke + 479
5 com.apple.dt.DVTFoundation 0x000000010ad29667 __DVTDispatchAsync_block_invoke + 293
6 libdispatch.dylib 0x00007fff8e4f593d _dispatch_call_block_and_release + 12
7 libdispatch.dylib 0x00007fff8e4ea40b _dispatch_client_callout + 8
8 libdispatch.dylib 0x00007fff8e4ef03b _dispatch_queue_drain + 754
9 libdispatch.dylib 0x00007fff8e4f5707 _dispatch_queue_invoke + 549
10 libdispatch.dylib 0x00007fff8e4edd53 _dispatch_root_queue_drain + 538
11 libdispatch.dylib 0x00007fff8e4edb00 _dispatch_worker_thread3 + 91
12 libsystem_pthread.dylib 0x00007fff9bb294de _pthread_wqthread + 1129
13 libsystem_pthread.dylib 0x00007fff9bb27341 start_wqthread + 13

@tjw
Copy link
Contributor Author

tjw commented May 13, 2016

Just tried with the 2016-05-09 snapshot and I'm still getting crashes when the indexer kicks in.

@akyrtzi
Copy link
Member

akyrtzi commented May 14, 2016

I was not able to reproduce with 2016-05-09 snapshot and Xcode 7.3.1.
Do you see any messages from launchd in your system log ?
What's the output if you run Xcode from terminal like this:

SOURCEKIT_LOGGING=2 /Applications/Xcode.app/Contents/MacOS/Xcode 2>&1 | tee /tmp/log.txt
and attach log.txt

@tjw
Copy link
Contributor Author

tjw commented May 14, 2016

I've attached a log from Xcode, and the corresponding console logs.

@tjw
Copy link
Contributor Author

tjw commented May 14, 2016

One odd thing I noticed last night is that if I do a local toolchain build (with testing disabled since that is failing too on my machine), and I symlink ~/Library/Developer/Toolchains/swift-LOCAL-2016-05-13-a.xctoolchain to the copy that is built in my ~/Source/Swift/swift/swift-nightly-install/Library/Developer/Toolchains/swift-LOCAL-2016-05-13-a.xctoolchain, then it works.

It also seems to work to un-tar the no-symbols version now (I'd tried the symbols version first hoping that I would get more info in the crash).

But if I `tar zxvf ~/Source/Swift/swift/swift-LOCAL-2016-05-13-a-osx-symbols.tar.gz` the package into my home directly, and copy the Info.plist from the non-symbol version (no idea why the version with symbols didn't get one), then that crashes.

@akyrtzi
Copy link
Member

akyrtzi commented May 14, 2016

Ah, I can reproduce with the 2016-05-09 symbols version (but not with the no-symbols one).
Also note this isn't restricted to indexing, this crashes with any sourcekitd request, since the XPC service fails to load for some reason.

@akyrtzi
Copy link
Member

akyrtzi commented May 14, 2016

The no-symbols package:

$ ls -l ~/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a.xctoolchain/usr/lib/sourcekitd.framework
total 40
lrwxr-xr-x 1 argiris staff 24 May 14 13:37 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 argiris staff 24 May 14 13:37 Modules -> Versions/Current/Modules
lrwxr-xr-x 1 argiris staff 26 May 14 13:37 Resources -> Versions/Current/Resources
drwxr-xr-x 4 argiris staff 136 May 14 13:37 Versions
lrwxr-xr-x 1 argiris staff 28 May 14 13:37 XPCServices -> Versions/Current/XPCServices
lrwxr-xr-x 1 argiris staff 27 May 14 13:37 sourcekitd -> Versions/Current/sourcekitd

$ ls -l ~/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a.xctoolchain/usr/lib/sourcekitd.framework/Versions/A/XPCServices/SourceKitService.xpc/Contents
total 8
rw-rr- 1 argiris staff 763 May 9 12:20 Info.plist
drwxr-xr-x 3 argiris staff 102 May 9 13:18 MacOS

The symbols package:

$ ls -l ~/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a.xctoolchain/usr/lib/sourcekitd.framework
total 0
drwxr-xr-x 3 argiris staff 102 May 9 13:16 Versions
$ ls -l ~/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a.xctoolchain/usr/lib/sourcekitd.framework/Versions/A/XPCServices/SourceKitService.xpc/Contents
total 0
drwxr-xr-x 4 argiris staff 136 May 9 13:16 MacOS

There is a packaging issue here. @shahmishal could you take a look why the symbols package is incomplete ?

@akyrtzi
Copy link
Member

akyrtzi commented May 14, 2016

@tjw, it occurred to me that the intention may be that the symbols package is installed on top of the non-symbols one (though I don't see why it includes the binaries then).
Could you verify that:

  • The no-symbols package works without crashing.

  • Installing no-symbols package and then installing symbols package as well on top, works fine.

@tjw
Copy link
Contributor Author

tjw commented May 14, 2016

Good call @akyrtzi! This would explain why the symbols version doesn't have a Info.plist too.

Un-tarring the no-symbols of my local toolchain worked, and un-tarring the symbols atop it continued to work.

But, given that the no-symbols snapshot isn't present on swift.org, it seems like either both packages should be present with explicit instructions to install them both, or the symbols package should have the pre-overlay work done.

(Edit: Oh, silly me – I assumed that the "Xcode (Debugging Symbols)" link was just one file instead of "Xcode" linking on place and "(Debugging Symbols)" another).

@swift-ci
Copy link
Collaborator

Comment by Michael Koukoullis (JIRA)

I've been scratching my head for the last two days trying to figure out where to download the no-symbols version of the toolchain from swift.org. @tjw last comment gave me a clue and there it was, there are actually two links on swift.org but they appear to be just one :/ See attached screenschot.

@akyrtzi
Copy link
Member

akyrtzi commented May 21, 2016

I've passed along to the right people the feedback that the download page is not clear.

@hassila
Copy link

hassila commented May 29, 2016

It actually caught me too, I thought the latest snapshot was broken... :-)

@Dante-Broggi
Copy link
Contributor

I believe the above comments are saying this bug is caused by failing to download the correct files from swift.org.

The downloads page has been improved, so I believe this can be closed.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

5 participants