You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
0xpablo opened this issue
Apr 17, 2018
· 4 comments
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
Hello, I ran into a segfault when overriding in a child class a function with several overloads.
Here is a test case that reproduces the issue:
protocolProto { }
classClass {
funcfoo<A>(callback: (A) -> Void) whereA: Proto {
}
funcfoo<A, B>(callback: (A, B) -> Void) whereA: Proto, B: Proto {
}
}
classChild: Class {
overridefuncfoo<A>(callback: (A) -> Void) whereA : Proto {
}
}
This is happening under Xcode 9.3 (Swift 4.1) I also tried with the latest development snapshot (swift-DEVELOPMENT-SNAPSHOT-2018-04-16-a-osx) and the problem is still there.
Here are the outputs, in case are useful:
Xcode 9.3
0 swift 0x000000010bc58ffa PrintStackTraceSignalHandler(void*) + 42
1 swift 0x000000010bc583b6 SignalHandler(int) + 966
2 libsystem_platform.dylib 0x00007fff78321f5a _sigtramp + 26
3 swift 0x00000001096c3333 substType(swift::Type, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<llvm::Optional<swift::ProtocolConformanceRef> (swift::CanType, swift::Type, swift::ProtocolType*)>, swift::SubstOptions) + 211
4 swift 0x00000001096c1fb8 swift::TypeBase::replaceSelfParameterType(swift::Type) + 24
5 swift 0x00000001096cafad swift::TypeBase::adjustSuperclassMemberDeclType(swift::ValueDecl const*, swift::ValueDecl const*, swift::Type) + 365
6 swift 0x00000001092e1268 (anonymous namespace)::DeclChecker::checkOverrides(swift::TypeChecker&, swift::ValueDecl*) + 2904
7 swift 0x00000001092f022a (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl*) + 6394
8 swift 0x00000001092e519c (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 3788
9 swift 0x00000001092ed86b (anonymous namespace)::DeclChecker::visitClassDecl(swift::ClassDecl*) + 699
10 swift 0x00000001092e465e (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 910
11 swift 0x0000000109381952 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int) + 1714
12 swift 0x0000000109003d67 swift::CompilerInstance::performSema() + 6407
13 swift 0x00000001082b0054 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1892
14 swift 0x00000001082ade64 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7908
15 swift 0x00000001082628b5 main + 18917
16 libdyld.dylib 0x00007fff78013015 start + 1
17 libdyld.dylib 0x0000000000000046 start + 2281623602
1. While type-checking 'Child' at file.swift:21:1
2. While type-checking 'foo(callback:)' at file.swift:22:11
swift-DEVELOPMENT-SNAPSHOT-2018-04-16-a-osx
Assertion failed: (Val && "isa<> used on a null pointer"), function doit, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/llvm/include/llvm/Support/Casting.h, line 106.
0 swift 0x00000001079bcbb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift 0x00000001079bd2c6 SignalHandler(int) + 694
2 libsystem_platform.dylib 0x00007fff78321f5a _sigtramp + 26
3 libsystem_platform.dylib 000000000000000000 _sigtramp + 2278416576
4 libsystem_c.dylib 0x00007fff780bf1ae abort + 127
5 libsystem_c.dylib 0x00007fff780871ac basename_r + 0
6 swift 0x00000001054664aa swift::TypeBase::replaceSelfParameterType(swift::Type) + 330
7 swift 0x0000000105470780 swift::TypeBase::adjustSuperclassMemberDeclType(swift::ValueDecl const*, swift::ValueDecl const*, swift::Type) + 304
8 swift 0x0000000105098b89 (anonymous namespace)::DeclChecker::checkOverrides(swift::TypeChecker&, swift::ValueDecl*) + 1833
9 swift 0x000000010509fc91 swift::TypeChecker::validateDecl(swift::ValueDecl*) + 9905
10 swift 0x00000001050b1b99 (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl*) + 41
11 swift 0x000000010509a75e (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 190
12 swift 0x00000001050afecb (anonymous namespace)::DeclChecker::visitClassDecl(swift::ClassDecl*) + 283
13 swift 0x000000010509a92e (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 654
14 swift 0x000000010509a696 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 38
15 swift 0x00000001051369f8 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int) + 1704
16 swift 0x0000000104d6e087 swift::CompilerInstance::parseAndCheckTypes(swift::CompilerInstance::ImplicitImports const&) + 855
17 swift 0x0000000104d6d8f8 swift::CompilerInstance::performSema() + 472
18 swift 0x00000001041fd5d0 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1904
19 swift 0x00000001041fbe4e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3310
20 swift 0x00000001041ba203 main + 2051
21 libdyld.dylib 0x00007fff78013015 start + 1
1. While type-checking 'Child' at file.swift:21:1
2. While type-checking 'foo(callback:)' at file.swift:22:11
3. While validating 'foo(callback:)' at file.swift:22:11
The text was updated successfully, but these errors were encountered:
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
Environment
macOS Xcode 9.3 (Swift 4.1 - swiftlang-902.0.48 clang-902.0.39.1)
Additional Detail from JIRA
md5: cc146bb190c93b6b3cbedef7ab7475e7
Issue Description:
Hello, I ran into a segfault when overriding in a child class a function with several overloads.
Here is a test case that reproduces the issue:
This is happening under Xcode 9.3 (Swift 4.1) I also tried with the latest development snapshot (swift-DEVELOPMENT-SNAPSHOT-2018-04-16-a-osx) and the problem is still there.
Here are the outputs, in case are useful:
Xcode 9.3
swift-DEVELOPMENT-SNAPSHOT-2018-04-16-a-osx
The text was updated successfully, but these errors were encountered: