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-4314] Assertion failed: ((HadError || !M.is<SourceFile*>() || M.get<SourceFile*>()->ASTStage < SourceFile::TypeChecked) && "UnresolvedDot" "in wrong phase") #46897

Closed
dabrahams opened this issue Mar 22, 2017 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@dabrahams
Copy link
Collaborator

Previous ID SR-4314
Radar None
Original Reporter @dabrahams
Type Bug
Status Closed
Resolution Duplicate

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 684b1f128e3a875425dfa45b5dee706d

duplicates:

  • SR-4272 Assertion failed: ((HadError || !M.is<SourceFile*>() || M.get<SourceFile*>()->ASTStage < SourceFile::TypeChecked) && "UnresolvedDot" "in wrong phase"

relates to:

  • SR-1725 Assertion failed: ((HadError || !M.is<SourceFile*>() || M.get<SourceFile*>()->ASTStage < SourceFile::TypeChecked) && "UnresolvedDot" "in wrong phase")
  • SR-3053 UnresolvedDotExpr not resolved by type checking (leads to crash)
  • SR-4272 Assertion failed: ((HadError || !M.is<SourceFile*>() || M.get<SourceFile*>()->ASTStage < SourceFile::TypeChecked) && "UnresolvedDot" "in wrong phase"

Issue Description:

$ git fetch https://github.com/dabrahams/swift refs/bugs/SR-unresolved-dot-in-wrong-phase-2:BUG && git checkout BUG

Build the compiler, then compile the attached file:

xcrun --toolchain default --sdk /Applications/Xcode-8W109m.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/./bin/swiftc -target x86_64-apple-macosx10.9  -module-cache-path '/var/folders/8v/9769m3ps7ds7h9pg23lzcls00000gn/T/swift-testsuite-clang-module-cacheS6xlDD' -F /Applications/Xcode-8W109m.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/../../../Developer/Library/Frameworks -Xlinker -rpath -Xlinker /Applications/Xcode-8W109m.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/../../../Developer/Library/Frameworks  -swift-version 3  /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/Prototypes/Output/AU3.swift.gyb.tmp/out.swift -o /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/Prototypes/Output/AU3.swift.gyb.tmp/a.out -Onone && /Users/Shared/dabrahams/s/swift/utils/line-directive /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/Prototypes/Output/AU3.swift.gyb.tmp/out.swift --  /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/Prototypes/Output/AU3.swift.gyb.tmp/a.out
Assertion failed: ((HadError || !M.is<SourceFile*>() || M.get<SourceFile*>()->ASTStage < SourceFile::TypeChecked) && "UnresolvedDot" "in wrong phase"), function walkToExprPre, file /Users/Shared/dabrahams/s/swift/include/swift/AST/ExprNodes.def, line 87.
0  swift                    0x00000001037717b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x0000000103771e66 SignalHandler(int) + 454
2  libsystem_platform.dylib 0x00007fffaac77bba _sigtramp + 26
3  swift                    0x0000000104042008 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 183290
4  libsystem_c.dylib        0x00007fffaaafe420 abort + 129
5  libsystem_c.dylib        0x00007fffaaac5893 basename_r + 0
6  swift                    0x0000000101388ef7 (anonymous namespace)::Verifier::walkToExprPre(swift::Expr*) + 263
7  swift                    0x000000010139b694 (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) + 36
8  swift                    0x000000010139ba68 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 216
9  swift                    0x000000010139e240 (anonymous namespace)::Traversal::visitAbstractFunctionDecl(swift::AbstractFunctionDecl*) + 1232
10 swift                    0x0000000101397b38 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 376
11 swift                    0x000000010139dcf4 (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 900
12 swift                    0x0000000101397b27 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 359
13 swift                    0x00000001013979ab swift::Decl::walk(swift::ASTWalker&) + 27
14 swift                    0x0000000101416ada swift::SourceFile::walk(swift::ASTWalker&) + 170
15 swift                    0x000000010138888b swift::verify(swift::SourceFile&) + 59
16 swift                    0x00000001013103df swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 2047
17 swift                    0x0000000100f0e850 swift::CompilerInstance::performSema() + 3616
18 swift                    0x000000010047a7bd swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 4765
19 swift                    0x0000000100437ce0 main + 3312
20 libdyld.dylib            0x00007fffaaa6a255 start + 1
Stack dump:
0.  Program arguments: /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/bin/swift -frontend -c -primary-file /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/Prototypes/Output/AU3.swift.gyb.tmp/out.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Xcode-8W109m.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -F /Applications/Xcode-8W109m.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/../../../Developer/Library/Frameworks -module-cache-path /var/folders/8v/9769m3ps7ds7h9pg23lzcls00000gn/T/swift-testsuite-clang-module-cacheS6xlDD -swift-version 3 -Onone -module-name a -o /var/folders/8v/9769m3ps7ds7h9pg23lzcls00000gn/T/out-b5ca79.o 
1.  While walking into decl 'AnyUInt16UnicodeView' at /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/Prototypes/Output/AU3.swift.gyb.tmp/out.swift:496:8
2.  While walking into body of 'formIndex' at /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/Prototypes/Output/AU3.swift.gyb.tmp/out.swift:539:10
<unknown>:0: error: unable to execute command: Abort trap: 6
<unknown>:0: error: compile command failed due to signal 6 (use -v to see invocation)

See also the line labeled "UNCOMMENT TO SUPPRESS ERROR"

Other hashes

clang                              ec61374e55 Merge remote-tracking branch 'origin/swift-4.0-branch' into stable
cmark                              d875488 Merge pull request #&#8203;4 from llvm-beanz/generate-cmark-exports
compiler-rt                        572336a0b Merge remote-tracking branch 'origin/swift-4.0-branch' into stable
llbuild                            68b2954 Merge pull request #&#8203;131 from ddunbar/directory-contents-recomputation-take-2
lldb                               9ca9758f9 Merge pull request #&#8203;149 from bitjammer/swift-typealias-equal-sourceloc
llvm                               a95654d8878 Merge remote-tracking branch 'origin/swift-4.0-branch' into stable
Traceback (most recent call last):
@belkadan
Copy link
Contributor

I'm going to assume this is the same as the previous one you filed.

@rudkx
Copy link
Member

rudkx commented May 22, 2017

Like SR-4272, this no longer appears to reproduce.

@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. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants