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-8666] Segmentation fault: 11 (related to dynamically querying conditional conformance?) #51181
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
run-time crash
Bug → crash: Swift code crashed during execution
runtime
The Swift Runtime
Comments
@belkadan The linked SR covers the behaviour OP gets under 4.1, but not the runtime crash they get in 4.2. Here's a reduced example: protocol Q {
associatedtype Wrapped
}
struct R<Wrapped> : Q {}
protocol P {}
protocol Z {}
struct S<T> {}
extension S : P where T : Q, T.Wrapped : Z {}
let s: Any = S<R<Int>>()
print(s is P) // boom. Backtrace: 0. Program arguments: /Users/Hamish/Desktop/swift-dev/build/Ninja-ReleaseAssert/swift-macosx-x86_64/bin/swift -frontend -interpret /Users/Hamish/Desktop/newplayground/newplayground/main.swift -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -color-diagnostics -module-name main
0 swift 0x0000000107237b08 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift 0x0000000107236ae8 llvm::sys::RunSignalHandlers() + 248
2 swift 0x0000000107238122 SignalHandler(int) + 258
3 libsystem_platform.dylib 0x00007fff7bd01f5a _sigtramp + 26
4 libsystem_platform.dylib 0x0000000111dd9088 _sigtramp + 2517463368
5 libsystem_platform.dylib 0x000000010b638388 _sigtramp + 2408801352
6 libswiftCore.dylib 0x000000010b210110 swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, llvm::function_ref<swift::TargetMetadata<swift::InProcess> const* (unsigned int)>, llvm::function_ref<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>) + 304
7 libswiftCore.dylib 0x000000010b20ff3c swift::TargetProtocolConformanceDescriptor<swift::InProcess>::getWitnessTable(swift::TargetMetadata<swift::InProcess> const*) const + 396
8 libswiftCore.dylib 0x000000010b21123b swift_conformsToProtocolImpl(swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptor<swift::InProcess> const*)::$_4::operator()(swift::TargetProtocolConformanceDescriptor<swift::InProcess> const&, swift::TargetMetadata<swift::InProcess> const*) const + 75
9 libswiftCore.dylib 0x000000010b210cb1 swift_conformsToProtocolImpl(swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptor<swift::InProcess> const*) + 817
10 libswiftCore.dylib 0x000000010b1ec2ed swift::_conformsToProtocol(swift::OpaqueValue const*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptorRef<swift::InProcess>, swift::TargetWitnessTable<swift::InProcess> const**) + 29
11 libswiftCore.dylib 0x000000010b1f07e7 _conformsToProtocols(swift::OpaqueValue const*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetExistentialTypeMetadata<swift::InProcess> const*, swift::TargetWitnessTable<swift::InProcess> const**) + 231
12 libswiftCore.dylib 0x000000010b1ef896 _dynamicCastToExistential(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetExistentialTypeMetadata<swift::InProcess> const*, swift::DynamicCastFlags) + 502
13 libswiftCore.dylib 0x000000010b6380ca _dynamicCastToExistential(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetExistentialTypeMetadata<swift::InProcess> const*, swift::DynamicCastFlags) + 4491818
14 swift 0x00000001040a53ad llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) + 461
15 swift 0x00000001040a8e31 llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, char const* const*) + 1329
16 swift 0x0000000103502615 swift::RunImmediately(swift::CompilerInstance&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, swift::IRGenOptions&, swift::SILOptions const&) + 3621
17 swift 0x00000001034aed9c performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 14828
18 swift 0x00000001034aa364 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2932
19 swift 0x000000010345f56d main + 685
20 libdyld.dylib 0x00007fff7b9f3015 start + 1
fish: 'xcrun ./swift /Users/Hamish/Desk…' terminated by signal SIGSEGV (Address boundary error) Using: Swift version 4.2-dev (LLVM 2157f50b75, Clang 257fa19143, Swift b72d7e2cf9)
Target: x86_64-apple-darwin17.7.0 |
Ah, sorry, I saw the error message and jumped to dup it. Good catch. |
@swift-ci create |
This is already fixed on master. I'm pulling the original test case into #19754 |
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
run-time crash
Bug → crash: Swift code crashed during execution
runtime
The Swift Runtime
Environment
Xcode 10.0 beta 6 (10L232m)
swiftc 4.2
Additional Detail from JIRA
md5: b2587dfbc014710348b508e12c07fc00
duplicates:
Issue Description:
The following code produces Segmentation fault: 11 on runtime after building with swiftc 4.2:
When building with swiftc 4.1.2, running produces the warning
and typecasting fails
The text was updated successfully, but these errors were encountered: