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-427] non-canonical or unchecked type #43044

Closed
dabrahams opened this issue Dec 31, 2015 · 2 comments
Closed

[SR-427] non-canonical or unchecked type #43044

dabrahams opened this issue Dec 31, 2015 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software SILGen Area → compiler: The SIL generation stage

Comments

@dabrahams
Copy link
Collaborator

Previous ID SR-427
Radar None
Original Reporter @dabrahams
Type Bug
Status Closed
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, SILGen
Assignee @gregomni
Priority Medium

md5: cc4963cf4aa3a5294f04d93015f0068a

Issue Description:

Compile the attached in b71e919 for this crash:

['/Users/dave/src/s/build/Ninja-RelWithDebInfoAssert+stdlib-DebugAssert/swift-macosx-x86_64/bin/swiftc', '-sdk', '/Applications/Bots/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk', 'x.swift', '-o', '/tmp/x']
non-canonical or unchecked type
UNREACHABLE executed at /Users/dave/src/s/swift/include/swift/AST/CanTypeVisitor.h:41!
0  swift                    0x0000000106a7c2bb llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  swift                    0x0000000106a7b576 llvm::sys::RunSignalHandlers() + 70
2  swift                    0x0000000106a7c962 SignalHandler(int) + 322
3  libsystem_platform.dylib 0x00007fff9c36a52a _sigtramp + 26
4  swift                    0x00000001074ccc35 FirstTarget + 70813
5  swift                    0x0000000106a7c776 abort + 22
6  swift                    0x0000000106a28c6d llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 493
7  swift                    0x00000001043f64a2 llvm::Value* swift::CanTypeVisitor<(anonymous namespace)::EmitTypeMetadataRef, llvm::Value*>::visit<>(swift::CanType) + 5154
8  swift                    0x00000001043f7f1e llvm::Value* llvm::function_ref<llvm::Value* (swift::irgen::IRGenFunction&)>::callback_fn<getTypeMetadataAccessFunction(swift::irgen::IRGenModule&, swift::CanType, swift::ForDefinition_t)::$_1>(long, swift::irgen::IRGenFunction&) + 30
9  swift                    0x00000001043e9062 swift::irgen::emitLazyCacheAccessFunction(swift::irgen::IRGenModule&, llvm::Function*, llvm::GlobalVariable*, llvm::function_ref<llvm::Value* (swift::irgen::IRGenFunction&)> const&) + 626
10 swift                    0x00000001043e949d getTypeMetadataAccessFunction(swift::irgen::IRGenModule&, swift::CanType, swift::ForDefinition_t) + 173
11 swift                    0x00000001043e9264 emitCallToTypeMetadataAccessFunction(swift::irgen::IRGenFunction&, swift::CanType, swift::ForDefinition_t) + 68
12 swift                    0x00000001043f6ee7 emitNominalMetadataRef(swift::irgen::IRGenFunction&, swift::NominalTypeDecl*, swift::CanType) + 919
13 swift                    0x00000001043f51d9 llvm::Value* swift::CanTypeVisitor<(anonymous namespace)::EmitTypeMetadataRef, llvm::Value*>::visit<>(swift::CanType) + 345
14 swift                    0x00000001043f7f1e llvm::Value* llvm::function_ref<llvm::Value* (swift::irgen::IRGenFunction&)>::callback_fn<getTypeMetadataAccessFunction(swift::irgen::IRGenModule&, swift::CanType, swift::ForDefinition_t)::$_1>(long, swift::irgen::IRGenFunction&) + 30
15 swift                    0x00000001043e9062 swift::irgen::emitLazyCacheAccessFunction(swift::irgen::IRGenModule&, llvm::Function*, llvm::GlobalVariable*, llvm::function_ref<llvm::Value* (swift::irgen::IRGenFunction&)> const&) + 626
16 swift                    0x00000001043e949d getTypeMetadataAccessFunction(swift::irgen::IRGenModule&, swift::CanType, swift::ForDefinition_t) + 173
17 swift                    0x00000001043e9264 emitCallToTypeMetadataAccessFunction(swift::irgen::IRGenFunction&, swift::CanType, swift::ForDefinition_t) + 68
18 swift                    0x00000001044412ad swift::irgen::emitPolymorphicArguments(swift::irgen::IRGenFunction&, swift::CanTypeWrapper<swift::SILFunctionType>, swift::CanTypeWrapper<swift::SILFunctionType>, llvm::ArrayRef<swift::Substitution>, swift::irgen::WitnessMetadata*, swift::irgen::Explosion&) + 813
19 swift                    0x00000001044952d4 (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 1396
20 swift                    0x0000000104480cab (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 10171
21 swift                    0x000000010447e1b9 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 985
22 swift                    0x00000001043bc71c swift::irgen::IRGenModuleDispatcher::emitGlobalTopLevel() + 428
23 swift                    0x0000000104463366 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 1110
24 swift                    0x0000000104463906 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 70
25 swift                    0x0000000104322b62 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 11922
26 swift                    0x000000010431bd87 main + 2855
27 libdyld.dylib            0x00007fff908785ad start + 1
28 libdyld.dylib            0x000000000000000e start + 1870166626
Stack dump:
0.  Program arguments: /Users/dave/src/s/build/Ninja-RelWithDebInfoAssert+stdlib-DebugAssert/swift-macosx-x86_64/bin/swift -frontend -c -primary-file x.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Bots/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -module-name x -o /var/folders/f0/90cxfysd21bgzmg8k9hlkzpm0000gn/T/x-8af6dd.o 
1.  While emitting IR SIL function @_TTWV1x3Fibs12SequenceTypeS_FS1_18underestimateCountfT_Si for 'underestimateCount' at <invalid loc>
<unknown>:0: error: unable to execute command: Illegal instruction: 4
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
Traceback (most recent call last):
  File "/Users/dave/bin/sc", line 38, in <module>
    subprocess.check_call(args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Users/dave/src/s/build/Ninja-RelWithDebInfoAssert+stdlib-DebugAssert/swift-macosx-x86_64/bin/swiftc', '-sdk', '/Applications/Bots/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk', 'x.swift', '-o', '/tmp/x']' returned non-zero exit status 254
@gregomni
Copy link
Collaborator

gregomni commented Jan 6, 2016

Pull request for fixing the crash and outputting reasonable looking error messages at: <https://github.com/apple/swift/pull/899\>. The error messages complain that it can't use Slice<Fib> as CollectionType.SubSequence because Fib isn't Indexable. This is in the middle of figuring out that Fib is a CollectionType which is Indexable, so I think we're running afoul of the existing limits on recursive definitions, which is outside of the scope of this particular issue, hopefully.

@dabrahams
Copy link
Collaborator Author

Thanks

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 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 crash Bug: A crash, i.e., an abnormal termination of software SILGen Area → compiler: The SIL generation stage
Projects
None yet
Development

No branches or pull requests

3 participants