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-15040] The 5.5 snapshot compiler for linux crashes with "SIL memory lifetime failure" when compiling the NIO tests #57367

Closed
finagolfin opened this issue Aug 7, 2021 · 10 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@finagolfin
Copy link
Contributor

Previous ID SR-15040
Radar None
Original Reporter @buttaface
Type Bug
Status Resolved
Resolution Done
Environment

Fedora Core 33

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

md5: 541806f85ff0c7ce6dab0fad72ded8d3

is duplicated by:

  • SR-15350 SwiftNIO tests do not build on linux (main branch)

Issue Description:

I've been seeing this on my Android CI, so I had to disable building NIO with Swift 5.5, and I just tried reproducing on Fedora x64 with the latest official prebuilt Swift 5.5 snapshot.

First, I had to remove some test files because of another 5.5 bug with rm Tests/NIOTests/SocketAddressTest*.swift, then I built the tests:

> ~/swift-5.5-DEVELOPMENT-SNAPSHOT-2021-08-05-a-centos8/usr/bin/swift build --build-tests

It fails on linux too with pretty much the same error:

error: compile command failed due to signal 6 (use -v to see invocation)SIL memory lifetime failure in @$s8NIOTests7SALTestPAAE15assertSetOption13expectedLevel0fE04file4line_y7NIOCore12NIOBSDSocketO0eG0V_AK0E0Vs12StaticStringVSuSbypXEtKFSbAA12UserToKernelOXEfU_: memory is initialized, but shouldn't
memory location: %49 = tuple_element_addr %16 : $*(NIOBSDSocket.OptionLevel, NIOBSDSocket.Option, Any), 2 // user: %50
at instruction: dealloc_stack %9 : $*UserToKernel // id: %30

in function:
// closure #​1 in SALTest.assertSetOption(expectedLevel:expectedOption:file:line::)
sil private [ossa] @$s8NIOTests7SALTestPAAE15assertSetOption13expectedLevel0fE04file4line_y7NIOCore12NIOBSDSocketO0eG0V_AK0E0Vs12StaticStringVSuSbypXEtKFSbAA12UserToKernelOXEfU
: $@convention(thin) (@in_guaranteed UserToKernel, NIOBSDSocket.OptionLevel, NIOBSDSocket.Option, @NoEscape @callee_guaranteed (@in_guaranteed Any) -> Bool) -> Bool {
// %0 "syscall" // users: %10, %4
// %1 "expectedLevel" // users: %21, %5
// %2 "expectedOption" // users: %37, %6
// %3 "valueMatcher" // users: %53, %7
bb0(%0 : $*UserToKernel, %1 : $NIOBSDSocket.OptionLevel, %2 : $NIOBSDSocket.Option, %3 : $@NoEscape @callee_guaranteed (@in_guaranteed Any) -> Bool):
debug_value_addr %0 : $*UserToKernel, let, name "syscall", argno 1 // id: %4
debug_value %1 : $NIOBSDSocket.OptionLevel, let, name "expectedLevel", argno 2 // id: %5
debug_value %2 : $NIOBSDSocket.Option, let, name "expectedOption", argno 3 // id: %6
debug_value %3 : $@NoEscape @callee_guaranteed (@in_guaranteed Any) -> Bool, let, name "valueMatcher", argno 4 // id: %7
%8 = alloc_stack $Any, let, name "value" // users: %55, %54, %53, %50, %47, %31, %14
%9 = alloc_stack $UserToKernel // users: %52, %46, %30, %16, %13, %12, %11, %10
copy_addr %0 to [initialization] %9 : $*UserToKernel // id: %10
switch_enum_addr %9 : $*UserToKernel, case #UserToKernel.setOption!enumelt: bb2, default bb1 // id: %11

bb1: // Preds: bb0
destroy_addr %9 : $*UserToKernel // id: %12
dealloc_stack %9 : $*UserToKernel // id: %13
dealloc_stack %8 : $*Any // id: %14
br bb8 // id: %15

bb2: // Preds: bb0
%16 = unchecked_take_enum_data_addr %9 : $*UserToKernel, #UserToKernel.setOption!enumelt // users: %49, %33, %17
%17 = tuple_element_addr %16 : $*(NIOBSDSocket.OptionLevel, NIOBSDSocket.Option, Any), 0 // user: %18
%18 = load [trivial] %17 : $*NIOBSDSocket.OptionLevel // users: %23, %19
debug_value %18 : $NIOBSDSocket.OptionLevel, let, name "$match" // id: %19
%20 = alloc_stack $NIOBSDSocket.OptionLevel // users: %27, %25, %21
store %1 to [trivial] %20 : $*NIOBSDSocket.OptionLevel // id: %21
%22 = alloc_stack $NIOBSDSocket.OptionLevel // users: %26, %25, %23
store %18 to [trivial] %22 : $*NIOBSDSocket.OptionLevel // id: %23
// function_ref ~= infix(::)
%24 = function_ref @$ss2teoiySbx_xtSQRzlF : $@convention(thin) <τ_0_0 where τ_0_0 : Equatable> (@in_guaranteed τ_0_0, @in_guaranteed τ_0_0) -> Bool // user: %25
%25 = apply %24<NIOBSDSocket.OptionLevel>(%20, %22) : $@convention(thin) <τ_0_0 where τ_0_0 : Equatable> (@in_guaranteed τ_0_0, @in_guaranteed τ_0_0) -> Bool // user: %28
dealloc_stack %22 : $*NIOBSDSocket.OptionLevel // id: %26
dealloc_stack %20 : $*NIOBSDSocket.OptionLevel // id: %27
%28 = struct_extract %25 : $Bool, #Bool._value // user: %29
cond_br %28, bb4, bb3 // id: %29

bb3: // Preds: bb2
dealloc_stack %9 : $*UserToKernel // id: %30
dealloc_stack %8 : $*Any // id: %31
br bb8 // id: %32

bb4: // Preds: bb2
%33 = tuple_element_addr %16 : $*(NIOBSDSocket.OptionLevel, NIOBSDSocket.Option, Any), 1 // user: %34
%34 = load [trivial] %33 : $*NIOBSDSocket.Option // users: %39, %35
debug_value %34 : $NIOBSDSocket.Option, let, name "$match" // id: %35
%36 = alloc_stack $NIOBSDSocket.Option // users: %43, %41, %37
store %2 to [trivial] %36 : $*NIOBSDSocket.Option // id: %37
%38 = alloc_stack $NIOBSDSocket.Option // users: %42, %41, %39
store %34 to [trivial] %38 : $*NIOBSDSocket.Option // id: %39
// function_ref ~= infix(::)
%40 = function_ref @$ss2teoiySbx_xtSQRzlF : $@convention(thin) <τ_0_0 where τ_0_0 : Equatable> (@in_guaranteed τ_0_0, @in_guaranteed τ_0_0) -> Bool // user: %41
%41 = apply %40<NIOBSDSocket.Option>(%36, %38) : $@convention(thin) <τ_0_0 where τ_0_0 : Equatable> (@in_guaranteed τ_0_0, @in_guaranteed τ_0_0) -> Bool // user: %44
dealloc_stack %38 : $*NIOBSDSocket.Option // id: %42
dealloc_stack %36 : $*NIOBSDSocket.Option // id: %43
%44 = struct_extract %41 : $Bool, #Bool._value // user: %45
cond_br %44, bb6, bb5 // id: %45

bb5: // Preds: bb4
dealloc_stack %9 : $*UserToKernel // id: %46
dealloc_stack %8 : $*Any // id: %47
br bb8 // id: %48

bb6: // Preds: bb4
%49 = tuple_element_addr %16 : $*(NIOBSDSocket.OptionLevel, NIOBSDSocket.Option, Any), 2 // user: %50
copy_addr [take] %49 to [initialization] %8 : $*Any // id: %50
br bb7 // id: %51

bb7: // Preds: bb6
dealloc_stack %9 : $*UserToKernel // id: %52
%53 = apply %3(%8) : $@NoEscape @callee_guaranteed (@in_guaranteed Any) -> Bool // user: %56
destroy_addr %8 : $*Any // id: %54
dealloc_stack %8 : $*Any // id: %55
br bb9(%53 : $Bool) // id: %56

bb8: // Preds: bb5 bb3 bb1
%57 = integer_literal $Builtin.Int1, 0 // user: %60
%58 = metatype $@thin Bool.Type // user: %60
// function_ref Bool.init(_builtinBooleanLiteral:)
%59 = function_ref @$sSb22_builtinBooleanLiteralSbBi1__tcfC : $@convention(method) (Builtin.Int1, @thin Bool.Type) -> Bool // user: %60
%60 = apply %59(%57, %58) : $@convention(method) (Builtin.Int1, @thin Bool.Type) -> Bool // user: %61
br bb9(%60 : $Bool) // id: %61

// %62 // user: %63
bb9(%62 : $Bool): // Preds: bb8 bb7
return %62 : $Bool // id: %63
} // end sil function '$s8NIOTests7SALTestPAAE15assertSetOption13expectedLevel0fE04file4line_y7NIOCore12NIOBSDSocketO0eG0V_AK0E0Vs12StaticStringVSuSbypXEtKFSbAA12UserToKernelOXEfU_'

Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0. Program arguments: /home/butta/swift-5.5-DEVELOPMENT-SNAPSHOT-2021-08-05-a-centos8/usr/bin/swift-frontend -frontend -c /home/butta/swift-nio/Tests/NIOTests/AcceptBackoffHandlerTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/AcceptBackoffHandlerTest.swift /home/butta/swift-nio/Tests/NIOTests/BaseObjectsTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/BaseObjectsTest.swift /home/butta/swift-nio/Tests/NIOTests/BlockingIOThreadPoolTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/BlockingIOThreadPoolTest.swift /home/butta/swift-nio/Tests/NIOTests/BootstrapTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/BootstrapTest.swift /home/butta/swift-nio/Tests/NIOTests/ByteBufferLengthPrefixTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/ByteBufferLengthPrefixTests.swift /home/butta/swift-nio/Tests/NIOTests/ByteBufferTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/ByteBufferTest.swift /home/butta/swift-nio/Tests/NIOTests/ChannelNotificationTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/ChannelNotificationTest.swift /home/butta/swift-nio/Tests/NIOTests/ChannelOptionStorageTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/ChannelOptionStorageTest.swift /home/butta/swift-nio/Tests/NIOTests/ChannelPipelineTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/ChannelPipelineTest.swift /home/butta/swift-nio/Tests/NIOTests/ChannelTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/ChannelTests.swift /home/butta/swift-nio/Tests/NIOTests/CircularBufferTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/CircularBufferTests.swift /home/butta/swift-nio/Tests/NIOTests/CodecTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/CodecTest.swift /home/butta/swift-nio/Tests/NIOTests/ControlMessageTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/ControlMessageTests.swift /home/butta/swift-nio/Tests/NIOTests/CustomChannelTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/CustomChannelTests.swift /home/butta/swift-nio/Tests/NIOTests/DatagramChannelTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/DatagramChannelTests.swift /home/butta/swift-nio/Tests/NIOTests/DispatchQueue+WithFutureTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/DispatchQueue+WithFutureTest.swift /home/butta/swift-nio/Tests/NIOTests/EchoServerClientTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/EchoServerClientTest.swift /home/butta/swift-nio/Tests/NIOTests/EmbeddedChannelTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/EmbeddedChannelTest.swift /home/butta/swift-nio/Tests/NIOTests/EmbeddedEventLoopTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/EmbeddedEventLoopTest.swift /home/butta/swift-nio/Tests/NIOTests/EventLoopFutureTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/EventLoopFutureTest.swift /home/butta/swift-nio/Tests/NIOTests/EventLoopTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/EventLoopTest.swift /home/butta/swift-nio/Tests/NIOTests/FileRegionTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/FileRegionTest.swift /home/butta/swift-nio/Tests/NIOTests/GetAddrInfoResolverTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/GetAddrInfoResolverTest.swift /home/butta/swift-nio/Tests/NIOTests/HappyEyeballsTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/HappyEyeballsTest.swift /home/butta/swift-nio/Tests/NIOTests/HeapTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/HeapTests.swift /home/butta/swift-nio/Tests/NIOTests/IOErrorTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/IOErrorTest.swift /home/butta/swift-nio/Tests/NIOTests/IdleStateHandlerTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/IdleStateHandlerTest.swift /home/butta/swift-nio/Tests/NIOTests/IntegerBitPackingTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/IntegerBitPackingTests.swift /home/butta/swift-nio/Tests/NIOTests/IntegerTypesTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/IntegerTypesTest.swift /home/butta/swift-nio/Tests/NIOTests/LinuxTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/LinuxTest.swift /home/butta/swift-nio/Tests/NIOTests/MarkedCircularBufferTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/MarkedCircularBufferTests.swift /home/butta/swift-nio/Tests/NIOTests/MulticastTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/MulticastTest.swift /home/butta/swift-nio/Tests/NIOTests/NIOAnyDebugTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/NIOAnyDebugTest.swift /home/butta/swift-nio/Tests/NIOTests/NIOCloseOnErrorHandlerTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/NIOCloseOnErrorHandlerTest.swift /home/butta/swift-nio/Tests/NIOTests/NIOThreadPoolTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/NIOThreadPoolTest.swift /home/butta/swift-nio/Tests/NIOTests/NonBlockingFileIOTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/NonBlockingFileIOTest.swift /home/butta/swift-nio/Tests/NIOTests/PendingDatagramWritesManagerTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/PendingDatagramWritesManagerTests.swift /home/butta/swift-nio/Tests/NIOTests/PipeChannelTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/PipeChannelTest.swift /home/butta/swift-nio/Tests/NIOTests/PriorityQueueTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/PriorityQueueTests.swift /home/butta/swift-nio/Tests/NIOTests/RecvByteBufAllocatorTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/RecvByteBufAllocatorTest.swift /home/butta/swift-nio/Tests/NIOTests/SALChannelTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/SALChannelTests.swift /home/butta/swift-nio/Tests/NIOTests/SALEventLoopTests+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/SALEventLoopTests.swift /home/butta/swift-nio/Tests/NIOTests/SelectorTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/SelectorTest.swift /home/butta/swift-nio/Tests/NIOTests/SingleStepByteToMessageDecoderTest+XCTest.swift /home/butta/swift-nio/Tests/NIOTests/SingleStepByteToMessageDecoderTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/SocketChannelTest+XCTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/SocketChannelTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/SocketOptionProviderTest+XCTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/SocketOptionProviderTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/StreamChannelsTest+XCTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/StreamChannelsTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/SyscallAbstractionLayer.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/SystemCallWrapperHelpers.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/SystemTest+XCTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/SystemTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/TestUtils.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/ThreadTest+XCTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/ThreadTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/TimeAmountTests+XCTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/TimeAmountTests.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/TypeAssistedChannelHandlerTests+XCTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/TypeAssistedChannelHandlerTests.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/UniversalBootstrapSupportTest+XCTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/UniversalBootstrapSupportTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/UtilitiesTest+XCTest.swift -primary-file /home/butta/swift-nio/Tests/NIOTests/UtilitiesTest.swift -supplementary-output-file-map /tmp/TemporaryDirectory.YNOcq1/supplementaryOutputs-1 -target x86_64-unknown-linux-gnu -disable-objc-interop -I /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug -color-diagnostics -enable-testing -g -module-cache-path /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /home/butta/swift-5.5-DEVELOPMENT-SNAPSHOT-2021-08-05-a-centos8/usr/bin/swift-driver -resource-dir /home/butta/swift-5.5-DEVELOPMENT-SNAPSHOT-2021-08-05-a-centos8/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=/home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/CNIOHTTPParser.build/module.modulemap -Xcc -I -Xcc /home/butta/swift-nio/Sources/CNIOHTTPParser/include -Xcc -fmodule-map-file=/home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/CNIOAtomics.build/module.modulemap -Xcc -I -Xcc /home/butta/swift-nio/Sources/CNIOAtomics/include -Xcc -fmodule-map-file=/home/butta/swift-nio/Sources/CNIOWindows/include/module.modulemap -Xcc -I -Xcc /home/butta/swift-nio/Sources/CNIOWindows/include -Xcc -fmodule-map-file=/home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/CNIODarwin.build/module.modulemap -Xcc -I -Xcc /home/butta/swift-nio/Sources/CNIODarwin/include -Xcc -fmodule-map-file=/home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/CNIOLinux.build/module.modulemap -Xcc -I -Xcc /home/butta/swift-nio/Sources/CNIOLinux/include -module-name NIOTests -parse-as-library -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/SocketChannelTest+XCTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/SocketChannelTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/SocketOptionProviderTest+XCTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/SocketOptionProviderTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/StreamChannelsTest+XCTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/StreamChannelsTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/SyscallAbstractionLayer.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/SystemCallWrapperHelpers.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/SystemTest+XCTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/SystemTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/TestUtils.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/ThreadTest+XCTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/ThreadTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/TimeAmountTests+XCTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/TimeAmountTests.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/TypeAssistedChannelHandlerTests+XCTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/TypeAssistedChannelHandlerTests.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/UniversalBootstrapSupportTest+XCTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/UniversalBootstrapSupportTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/UtilitiesTest+XCTest.swift.o -o /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/NIOTests.build/UtilitiesTest.swift.o -index-store-path /home/butta/swift-nio/.build/x86_64-unknown-linux-gnu/debug/index/store -index-system-modules

  1. Swift version 5.5-dev (LLVM ae27a3137002358, Swift e94440a)
  2. While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "/home/butta/swift-nio/Tests/NIOTests/SyscallAbstractionLayer.swift")
  3. While silgen emitFunction SIL function "@$s8NIOTests7SALTestPAAE15assertSetOption13expectedLevel0fE04file4line_y7NIOCore12NIOBSDSocketO0eG0V_AK0E0Vs12StaticStringVSuSbypXEtKF".
    for 'assertSetOption(expectedLevel:expectedOption:file:line:_:)' (at /home/butta/swift-nio/Tests/NIOTests/SyscallAbstractionLayer.swift:722:5)
  4. While silgen closureexpr SIL function "@$s8NIOTests7SALTestPAAE15assertSetOption13expectedLevel0fE04file4line_y7NIOCore12NIOBSDSocketO0eG0V_AK0E0Vs12StaticStringVSuSbypXEtKFSbAA12UserToKernelOXEfU_".
    for expression at [/home/butta/swift-nio/Tests/NIOTests/SyscallAbstractionLayer.swift:727:89 - line:733:9] RangeText="{ syscall in
    if case .setOption(expectedLevel, expectedOption, let value) = syscall {
    return valueMatcher(value)
    } else {
    return false
    }
    "
  5. While verifying SIL function "@$s8NIOTests7SALTestPAAE15assertSetOption13expectedLevel0fE04file4line_y7NIOCore12NIOBSDSocketO0eG0V_AK0E0Vs12StaticStringVSuSbypXEtKFSbAA12UserToKernelOXEfU_".
    for expression at [/home/butta/swift-nio/Tests/NIOTests/SyscallAbstractionLayer.swift:727:89 - line:733:9] RangeText="{ syscall in
    if case .setOption(expectedLevel, expectedOption, let value) = syscall {
    return valueMatcher(value)
    } else {
    return false
    }
    "
    Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var LLVM_SYMBOLIZER_PATH to point to it):

@eeckstein, maybe you know what's going on. @weissi and @Lukasa, you may be interested too.

@finagolfin
Copy link
Contributor Author

A little more info: I can't reproduce with the official build of the Swift 5.4.2 compiler for linux, but the same compiler crash recurs with the official trunk snapshot builds, implying this has regressed since 5.4 branched.

@weissi
Copy link
Member

weissi commented Aug 9, 2021

CC @gottesmm

Yes, Swift 5.5/main fails to build NIO's tests since at least February: https://bugs.swift.org/browse/SR-14590 / https://bugs.swift.org/browse/SR-14268 . I have no idea why this isn't being looked at. CC @tomerd

@Lukasa
Copy link
Contributor

Lukasa commented Aug 9, 2021

I’m surprised that our CI is not reporting this.

@finagolfin
Copy link
Contributor Author

I’m surprised that our CI is not reporting this.

The tests are turned off on the NIO CI for Swift 5.5/trunk because of the bugs Johannes reported earlier. If you were to turn it back on, then remove the two files above as I did to avoid that bug, you would hit this one.

@finagolfin
Copy link
Contributor Author

Just tried again with the latest official snapshot builds for Sep. 9: I can still reproduce with the latest Swift 5.5 snapshot build but not the trunk one.

@finagolfin
Copy link
Contributor Author

It appears this was fixed by @gottesmm in the following trunk pull and 5.5 cherrypick:

#39037
#39252

@finagolfin
Copy link
Contributor Author

The fix was reverted in trunk, so reopening:

#39545

@Lukasa
Copy link
Contributor

Lukasa commented Oct 4, 2021

We should probably double check that it actually affects NIO: we added a bunch of code that I suspect worked around the issue.

@finagolfin
Copy link
Contributor Author

I reopened because the revert broke building the NIO tests on my Android CI again, I'm guessing it broke the official NIO CI too.

@finagolfin
Copy link
Contributor Author

This appears to be fixed in the latest trunk and 5.5 snapshots, probably by these pulls from @gottesmm:

#39582
#39600

@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