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

22941964: Swift: swiftc crash emitting module with type constraint using typealias in constrained type #6284

Open
openradar-mirror opened this issue Oct 1, 2015 · 0 comments

Comments

@openradar-mirror
Copy link

Description

Summary:
N/A

Steps to Reproduce:
This code:
struct A {}
protocol C {
typealias D
}
enum E<F: C where F.D == E.G> {
typealias G = A
}

Expected Results:
shouldn’t crash swiftc when using -emit-module

Actual Results:
but totally does:

rob@Resonance ~/Desktop> swiftc -emit-module boom.swift
0 swift 0x000000010fba337b llvm::sys::PrintStackTrace(sFILE) + 43
1 swift 0x000000010fba3abb SignalHandler(int) + 379
2 libsystem_platform.dylib 0x00007fff83cf752a sigtramp + 26
3 libsystem_platform.dylib 000000000000000000 sigtramp + 2083556080
4 swift 0x000000010e323e9e swift::GenericParamList::addNestedArchetypes(swift::ArchetypeType
, llvm::SmallPtrSetImplswift::ArchetypeType*&, llvm::SmallVectorImplswift::ArchetypeType*&) + 30
5 swift 0x000000010e3240c3 swift::GenericParamList::deriveAllArchetypes(llvm::ArrayRefswift::GenericTypeParamDecl*, llvm::SmallVectorImplswift::ArchetypeType*&) + 339
6 swift 0x000000010dfb8c21 swift::ModuleFile::maybeReadGenericParams(swift::DeclContext
, llvm::BitstreamCursor&, swift::GenericParamList
) + 513
7 swift 0x000000010dfb4306 swift::ModuleFile::getDecl(llvm::Fixnum<31u, unsigned int>, llvm::Optionalswift::DeclContext*) + 11238
8 swift 0x000000010dfb888c swift::ModuleFile::getDeclContext(llvm::Fixnum<31u, unsigned int>) + 316
9 swift 0x000000010dfb48e8 swift::ModuleFile::getDecl(llvm::Fixnum<31u, unsigned int>, llvm::Optionalswift::DeclContext*) + 12744
10 swift 0x000000010dfafd70 swift::ModuleFile::getType(llvm::Fixnum<31u, unsigned int>) + 416
11 swift 0x000000010dfb02a3 swift::ModuleFile::getType(llvm::Fixnum<31u, unsigned int>) + 1747
12 swift 0x000000010dfb141e swift::ModuleFile::getType(llvm::Fixnum<31u, unsigned int>) + 6222
13 swift 0x000000010dfb5329 swift::ModuleFile::getDecl(llvm::Fixnum<31u, unsigned int>, llvm::Optionalswift::DeclContext*) + 15369
14 swift 0x000000010dfb8f19 swift::ModuleFile::maybeReadGenericParams(swift::DeclContext_, llvm::BitstreamCursor&, swift::GenericParamList_) + 1273
15 swift 0x000000010dfb4306 swift::ModuleFile::getDecl(llvm::Fixnum<31u, unsigned int>, llvm::Optionalswift::DeclContext*) + 11238
16 swift 0x000000010dfd198b swift::ModuleFile::getTopLevelDecls(llvm::SmallVectorImplswift::Decl*&) + 955
17 swift 0x000000010dffb246 swift::serialization::Serializer::writeAST(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>) + 646
18 swift 0x000000010dffdf87 swift::serialization::Serializer::writeToStream(llvm::raw_ostream&, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SILModule const_, swift::SerializationOptions const&) + 135
19 swift 0x000000010dffebb2 withOutputFile(swift::ASTContext&, llvm::StringRef, llvm::function_ref<void (llvm::raw_ostream&)>) + 226
20 swift 0x000000010dffea36 swift::serialize(llvm::PointerUnion<swift::ModuleDecl_, swift::SourceFile_>, swift::SerializationOptions const&, swift::SILModule const_) + 214
21 swift 0x000000010dc97828 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&) + 12840
22 swift 0x000000010dc943f3 frontend_main(llvm::ArrayRef<char const*>, char const_, void_) + 2691
23 swift 0x000000010dc90a74 main + 2324
24 libdyld.dylib 0x00007fff937c85ad start + 1
Stack dump:
0. Program arguments: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-module /var/folders/9y/f7n4rvx901nctm_5d16c1wm40000gn/T/boom-94824a.swiftmodule -parse-as-library -target x86_64-apple-darwin15.0.0 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -emit-module-doc-path boom.swiftdoc -color-diagnostics -module-name boom -o boom.swiftmodule

  1. While reading from /var/folders/9y/f7n4rvx901nctm_5d16c1wm40000gn/T/boom-94824a.swiftmodule
  2. While deserializing decl 22108118: Apple Music: No Love Icon On CarPlay #5 (ENUM_DECL)
  3. While deserializing 'F' (GenericTypeParamDecl 22105831: Application windows move erratically with two monitors #13)
  4. While deserializing decl 22105625: Mac OS X 10.11: Battery status alwasy shows "20:00 Remaining" #14 (TYPE_ALIAS_DECL)
  5. While deserializing decl 22108118: Apple Music: No Love Icon On CarPlay #5 (ENUM_DECL)
    :0: error: unable to execute command: Segmentation fault: 11
    :0: error: merge-module command failed due to signal (use -v to see invocation)

Regression:
swiftc doesn’t crash if you omit -emit-module.

Notes:
N/A

Product Version: Xcode 7.0 (7A1001)
Created: 2015-10-01T22:25:15.799050
Originated: 2015-10-01T18:24:00
Open Radar Link: http://www.openradar.me/22941964

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant