jpsim / jpsim/SourceKitten

Illegal instruction: 4 when referencing a header file by absolute path

Open
#206 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.