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-14755] Assertion failure (!assign->isFolded() && "already folded assign expr in sequence?!") during completion #57105

Closed
ahoppen opened this issue Jun 10, 2021 · 1 comment
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion found by stress tester Flag: An issue found by the SourceKit stress tester source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@ahoppen
Copy link
Contributor

ahoppen commented Jun 10, 2021

Previous ID SR-14755
Radar rdar://79136653
Original Reporter @ahoppen
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug, FoundByStressTester
Assignee @ahoppen
Priority Medium

md5: 7cd7ed2415c309ed3027a5ee54ecb894

Issue Description:

The following test case crashes with an assertion failure:

// RUN: %swift-ide-test --code-completion --source-filename %s --code-completion-token=COMPLETE

Foo.#^COMPLETE^#bar ?? baz(_) = baba

Stack trace

Assertion failed: (!assign->isFolded() && "already folded assign expr in sequence?!"), function makeBinOp, file /Users/alex/swift-src/swift/lib/Sema/TypeCheckExpr.cpp, line 366.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.  Program arguments: /Users/alex/swift-src/nbuild/Release+Asserts/bin/swift-ide-test -module-cache-path /Users/alex/swift-src/nbuild/Release+Asserts/swift-test-results/x86_64-apple-macosx10.9/clang-module-cache -completion-cache-path /Users/alex/swift-src/nbuild/Release+Asserts/swift-test-results/x86_64-apple-macosx10.9/completion-cache -swift-version 4 --code-completion --source-filename /Users/alex/swift-src/swift/test/SourceKit/test.swift --code-completion-token=COMPLETE
1.  While performing new completion
2.  While evaluating request CodeCompletionSecondPassRequest(source_file "/Users/alex/swift-src/swift/test/SourceKit/test.swift", )
3.  While code-completion expression at [/Users/alex/swift-src/swift/test/SourceKit/test.swift:3:1 - line:3:22] RangeText="Foo.bar ?? baz(_) = "
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-ide-test           0x0000000106df83e7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1  swift-ide-test           0x0000000106df72e8 llvm::sys::RunSignalHandlers() + 248
2  swift-ide-test           0x0000000106df8a16 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff204c9d7d _sigtramp + 29
4  libsystem_platform.dylib 000000000000000000 _sigtramp + 18446603339974271648
5  libsystem_c.dylib        0x00007fff203d9411 abort + 120
6  libsystem_c.dylib        0x00007fff203d87e8 err + 0
7  swift-ide-test           0x00000001073455f3 makeBinOp(swift::ASTContext&, swift::Expr*, swift::Expr*, swift::Expr*, swift::PrecedenceGroupDecl*, bool) (.cold.6) + 35
8  swift-ide-test           0x0000000103319851 makeBinOp(swift::ASTContext&, swift::Expr*, swift::Expr*, swift::Expr*, swift::PrecedenceGroupDecl*, bool) + 593
9  swift-ide-test           0x0000000103318522 swift::TypeChecker::foldSequence(swift::SequenceExpr*, swift::DeclContext*) + 82
10 swift-ide-test           0x0000000103267230 (anonymous namespace)::PreCheckExpression::walkToExprPost(swift::Expr*) + 272
11 swift-ide-test           0x000000010242ac23 swift::Expr::walk(swift::ASTWalker&) + 115
12 swift-ide-test           0x0000000103265c3c swift::constraints::ConstraintSystem::preCheckExpression(swift::Expr*&, swift::DeclContext*, bool) + 332
13 swift-ide-test           0x00000001032aa15b swift::TypeChecker::typeCheckForCodeCompletion(swift::constraints::SolutionApplicationTarget&, bool, llvm::function_ref<void (swift::constraints::Solution const&)>) + 763
14 swift-ide-test           0x00000001032ab41e swift::DotExprTypeCheckCompletionCallback::fallbackTypeCheck() + 190
15 swift-ide-test           0x0000000102716e52 (anonymous namespace)::CodeCompletionCallbacksImpl::doneParsing() + 482
16 swift-ide-test           0x000000010362d878 swift::Parser::performCodeCompletionSecondPassImpl(swift::CodeCompletionDelayedDeclState&) + 888
17 swift-ide-test           0x000000010362d3f8 swift::CodeCompletionSecondPassRequest::evaluate(swift::Evaluator&, swift::SourceFile*, swift::CodeCompletionCallbacksFactory*) const + 232
18 swift-ide-test           0x0000000103637aef llvm::Expected<swift::CodeCompletionSecondPassRequest::OutputType> swift::Evaluator::getResultUncached<swift::CodeCompletionSecondPassRequest>(swift::CodeCompletionSecondPassRequest const&) + 271
19 swift-ide-test           0x000000010362d207 swift::CodeCompletionSecondPassRequest::OutputType swift::evaluateOrDefault<swift::CodeCompletionSecondPassRequest>(swift::Evaluator&, swift::CodeCompletionSecondPassRequest, swift::CodeCompletionSecondPassRequest::OutputType) + 55
20 swift-ide-test           0x000000010273c481 swift::ide::CompletionInstance::performNewOperation(llvm::Optional<llvm::hash_code>, swift::CompilerInvocation&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, llvm::MemoryBuffer*, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, swift::DiagnosticConsumer*, llvm::function_ref<void (swift::CompilerInstance&, bool)>) + 529
21 swift-ide-test           0x000000010273c918 swift::ide::CompletionInstance::performOperation(swift::CompilerInvocation&, llvm::ArrayRef<char const*>, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, llvm::MemoryBuffer*, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, swift::DiagnosticConsumer*, llvm::function_ref<void (swift::CompilerInstance&, bool)>) + 680
22 swift-ide-test           0x0000000102340300 doCodeCompletionImpl(swift::CodeCompletionCallbacksFactory*, swift::CompilerInvocation const&, llvm::StringRef, llvm::StringRef, llvm::StringRef, bool) + 1376
23 swift-ide-test           0x0000000102332d00 main + 26144
24 libdyld.dylib            0x00007fff2049ff3d start + 1
25 libdyld.dylib            0x000000000000000b start + 18446603339974443215
@ahoppen
Copy link
Contributor Author

ahoppen commented Jul 28, 2021

Fixed by #38474

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the source tooling Area: IDE support, SourceKit, and other source tooling label Feb 6, 2023
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. code completion Area → source tooling: code completion found by stress tester Flag: An issue found by the SourceKit stress tester source tooling Area: IDE support, SourceKit, and other source tooling
Projects
None yet
Development

No branches or pull requests

2 participants