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-8474] Code completion crashes in inactive #if #50995

Open
nathawes opened this issue Aug 7, 2018 · 1 comment
Open

[SR-8474] Code completion crashes in inactive #if #50995

nathawes opened this issue Aug 7, 2018 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@nathawes
Copy link
Collaborator

nathawes commented Aug 7, 2018

Previous ID SR-8474
Radar rdar://problem/43057060
Original Reporter @nathawes
Type Bug
Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: fe538403ebabeece6a8564c492247fbf

Issue Description:

These are similar to rdar://problem/41234606, but in a different positions. Maybe there's a general fix for these?

#if false
extension Foo {
  static func foo<T: #^COMPLETE^# AnyObject>(x: T?) {}
}
#endif

{code:title=$ swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename /tmp/test.swift}
found code completion token COMPLETE at offset 47
found code completion token COMPLETE at offset 47
0 swift-ide-test 0x00000001075cf8b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift-ide-test 0x00000001075ce826 llvm::sys::RunSignalHandlers() + 198
2 swift-ide-test 0x00000001075cfed2 SignalHandler(int) + 258
3 libsystem_platform.dylib 0x00007fff7dd65f5a _sigtramp + 26
4 libsystem_platform.dylib 0x00007fa982bfc080 _sigtramp + 82403648
5 swift-ide-test 0x000000010405dba6 (anonymous namespace)::CodeCompletionCallbacksImpl::doneParsing() + 7942
6 swift-ide-test 0x0000000104553ff9 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 377
7 swift-ide-test 0x0000000104043fd9 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 1081
8 swift-ide-test 0x0000000104043269 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 505
9 swift-ide-test 0x0000000103fc8212 main + 27554
10 libdyld.dylib 0x00007fff7da63015 start + 1
Stack dump:
0. Program arguments: /Users/nathanhawes/workspace/open-swift-source-compat-suite-master/build/compat_macos/swift-macosx-x86_64/bin/swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename /tmp/test2.swift
Segmentation fault: 11

Another case:
{code:title=$ cat /tmp/test2.swift}
#if false
extension Foo {
  enum Kind {
    case variable
    case globalTestFunctionNext #^COMPLETE^#
    case globalTestFunctionError
    case globalTestFunctionCompleted
  }
}
#endif

{code:title=$ swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename /tmp/test2.swift}
found code completion token COMPLETE at offset 90
found code completion token COMPLETE at offset 90
0 swift-ide-test 0x00000001062918b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift-ide-test 0x0000000106290826 llvm::sys::RunSignalHandlers() + 198
2 swift-ide-test 0x0000000106291ed2 SignalHandler(int) + 258
3 libsystem_platform.dylib 0x00007fff7dd65f5a _sigtramp + 26
4 libsystem_platform.dylib 0x00007f849681b0d8 _sigtramp + 413880728
5 swift-ide-test 0x0000000103302972 swift::NominalTypeDecl::computeType() + 146
6 swift-ide-test 0x0000000103062b16 swift::TypeChecker::validateDecl(swift::ValueDecl*) + 582
7 swift-ide-test 0x00000001030f7732 swift::typeCheckCompletionDecl(swift::Decl*) + 1218
8 swift-ide-test 0x0000000102d1e732 (anonymous namespace)::CodeCompletionCallbacksImpl::doneParsing() + 2706
9 swift-ide-test 0x0000000103215ff9 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 377
10 swift-ide-test 0x0000000102d05fd9 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 1081
11 swift-ide-test 0x0000000102d05269 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 505
12 swift-ide-test 0x0000000102c8a212 main + 27554
13 libdyld.dylib 0x00007fff7da63015 start + 1
Stack dump:
0. Program arguments: /Users/nathanhawes/workspace/open-swift-source-compat-suite-master/build/compat_macos/swift-macosx-x86_64/bin/swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename /tmp/test2.swift

  1. While validating 'Kind' at /tmp/test2.swift:3:3
    Segmentation fault: 11
@nathawes
Copy link
Collaborator Author

nathawes commented Aug 7, 2018

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added crash Bug: A crash, i.e., an abnormal termination of software compiler The Swift compiler in itself labels Dec 12, 2022
@AnthonyLatsis AnthonyLatsis added the source tooling Area: IDE support, SourceKit, and other source tooling label Feb 6, 2023
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. code completion Area → source tooling: code completion compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software source tooling Area: IDE support, SourceKit, and other source tooling
Projects
None yet
Development

No branches or pull requests

2 participants