Illegal instruction: 4 when referencing a header file by absolute path
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 2.4k
- Forks
- 237
- PR merge metrics
- No merged PRs in 30d
Description
I'm using SourceKitten 0.12.1 from jazzy master with Xcode 7.3.1.
Given the following file /tmp/foo.h:
#import <UIKit/UIKit.h>
@interface UISearchController (Baz)
@property NSString *foo;
@end
When I call sourcekitten with:
sourcekitten doc --objc /tmp/foo.h -- -x objective-c -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk --verbose
it crashes with
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
InstalledDir:
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.3.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/System/Library/Frameworks (framework directory)
End of search list.
sourcekit: [1:connection-event-handler:9731: 0.0000] Connection interrupt
sourcekit: [1:pingService:9731: 0.0009] pinging service
Illegal instruction: 4
cd-ing to /tmp and calling it with foo.h as argument doesn't crash (?).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the sourcekitten doc --objc /tmp/foo.h -- ... command from the report, then compare it with running from /tmp using foo.h. Trace the CLI handling of absolute versus relative header paths; done means both forms process the header without an illegal-instruction crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c, swift
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100