-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.c interopFeature: Interoperability with CFeature: Interoperability with CownershipFeature: Ownership modifiers and semanticsFeature: Ownership modifiers and semantics
Description
Seeing a crash on Linux with swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64
.
I have a C structure containing blocks:
typedef struct avdecc_protocol_interface_block_observer_s
{
/* **** Global notifications **** */
void(LA_AVDECC_BINDINGS_C_CALL_CONVENTION^ onTransportError)(LA_AVDECC_PROTOCOL_INTERFACE_HANDLE const /*handle*/);
...
} avdecc_protocol_interface_block_observer_t, *avdecc_protocol_interface_block_observer_p;
which I'm using like this:
public final class ProtocolInterface {
var blockObserver = avdecc_protocol_interface_block_observer_t()
...
func withObserver(
_ handle: UnsafeMutableRawPointer?,
_ body: @escaping (ProtocolInterface) -> ()
) {
if let handle, let this = LA_AVDECC_ProtocolInterface_getApplicationData(handle) {
body(Unmanaged<ProtocolInterface>.fromOpaque(this).takeUnretainedValue())
}
}
public init(
type: avdecc_protocol_interface_type_e,
interfaceID: String,
executorName: String = DefaultExecutorName
) throws {
...
self.handle = handle
self.blockObserver.onTransportError = onTransportError
}
func onTransportError(handle: UnsafeMutableRawPointer?) {
withObserver(handle) {
$0.observer?.onTransportError($0)
}
}
Compile crashes:
Building for debugging...
error: emit-module command failed due to signal 6 (use -v to see invocation)
Begin Error in Function: '$sSo42avdecc_protocol_interface_block_observer_sVABycfC'
Found an operand with a value that is not compatible with the operand's operand ownership kind map.
Value: %5 = builtin "zeroInitializer"<avdecc_protocol_interface_block_observer_s>() : $avdecc_protocol_interface_block_observer_s // user: %7
Value Ownership Kind: unowned
Instruction:
%5 = builtin "zeroInitializer"<avdecc_protocol_interface_block_observer_s>() : $avdecc_protocol_interface_block_observer_s // user: %7
%6 = begin_access [modify] [unknown] %4 : $*avdecc_protocol_interface_block_observer_s // user: %7
-> assign %5 to %6 : $*avdecc_protocol_interface_block_observer_s // id: %7
Constraint: <Constraint Kind:owned LifetimeConstraint:LifetimeEnding>
End Error in Function: '$sSo42avdecc_protocol_interface_block_observer_sVABycfC'
Found ownership error?!
triggering standard assertion failure routine
UNREACHABLE executed at /home/build-user/swift/lib/SIL/Verifier/LinearLifetimeCheckerPrivate.h:211!
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0. Program arguments: /opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /home/lukeh/CVSRoot/padl/AVDECCSwift/Sources/AVDECCSwift/AVDECC.swift -target aarch64-unknown-linux-gnu -Xllvm -aarch64-use-tbi -disable-objc-interop -I /home/lukeh/CVSRoot/padl/AVDECCSwift/.build/aarch64-unknown-linux-gnu/debug -color-diagnostics -enable-testing -g -module-cache-path /home/lukeh/CVSRoot/padl/AVDECCSwift/.build/aarch64-unknown-linux-gnu/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=/home/lukeh/CVSRoot/padl/AVDECCSwift/Sources/CAVDECC/include/module.modulemap -Xcc -I -Xcc /home/lukeh/CVSRoot/padl/AVDECCSwift/Sources/CAVDECC/include -Xcc -fPIC -module-name AVDECCSwift -package-name avdeccswift -plugin-path /opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/lib/swift/host/plugins -plugin-path /opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/local/lib/swift/host/plugins -emit-module-doc-path /home/lukeh/CVSRoot/padl/AVDECCSwift/.build/aarch64-unknown-linux-gnu/debug/AVDECCSwift.swiftdoc -emit-module-source-info-path /home/lukeh/CVSRoot/padl/AVDECCSwift/.build/aarch64-unknown-linux-gnu/debug/AVDECCSwift.swiftsourceinfo -emit-dependencies-path /home/lukeh/CVSRoot/padl/AVDECCSwift/.build/aarch64-unknown-linux-gnu/debug/AVDECCSwift.build/AVDECCSwift.emit-module.d -parse-as-library -o /home/lukeh/CVSRoot/padl/AVDECCSwift/.build/aarch64-unknown-linux-gnu/debug/AVDECCSwift.swiftmodule
1. Swift version 5.9-dev (LLVM 8e2daa73d613753, Swift 7544686d7b298bf)
2. Compiling with the current language version
3. While evaluating request ASTLoweringRequest(Lowering AST to SIL for module AVDECCSwift)
4. While silgen emitValueConstructor SIL function "@$sSo42avdecc_protocol_interface_block_observer_sVABycfC".
for 'init()' (in module 'CAVDECC')
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):
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x6a08c90)[0xaaaad1ae8c90]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x6a06c80)[0xaaaad1ae6c80]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x6a090ac)[0xaaaad1ae90ac]
linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0xffffb52ae8fc]
/lib/aarch64-linux-gnu/libc.so.6(+0x7f200)[0xffffb475f200]
/lib/aarch64-linux-gnu/libc.so.6(raise+0x1c)[0xffffb471a67c]
/lib/aarch64-linux-gnu/libc.so.6(abort+0xe4)[0xffffb4707130]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x692e710)[0xaaaad1a0e710]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x1dbd474)[0xaaaacce9d474]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x1dc1994)[0xaaaaccea1994]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x1430c6c)[0xaaaacc510c6c]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x1431128)[0xaaaacc511128]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x1486248)[0xaaaacc566248]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x148f924)[0xaaaacc56f924]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x148f800)[0xaaaacc56f800]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x14267f4)[0xaaaacc5067f4]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x1432794)[0xaaaacc512794]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x140b7a8)[0xaaaacc4eb7a8]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x13f4720)[0xaaaacc4d4720]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x146e3a4)[0xaaaacc54e3a4]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x146d4f0)[0xaaaacc54d4f0]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x13ccfe4)[0xaaaacc4acfe4]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x13ae9e8)[0xaaaacc48e9e8]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x13b41f8)[0xaaaacc4941f8]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x146ce90)[0xaaaacc54ce90]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x13b71d0)[0xaaaacc4971d0]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0x13b462c)[0xaaaacc49462c]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0xda0b00)[0xaaaacbe80b00]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0xdb2a0c)[0xaaaacbe92a0c]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0xda3340)[0xaaaacbe83340]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0xda22d0)[0xaaaacbe822d0]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0xc26034)[0xaaaacbd06034]
/lib/aarch64-linux-gnu/libc.so.6(+0x273fc)[0xffffb47073fc]
/lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0x98)[0xffffb47074cc]
/opt/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-08-29-a-ubuntu22.04-aarch64/usr/bin/swift-frontend(+0xc24d30)[0xaaaacbd04d30]
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.c interopFeature: Interoperability with CFeature: Interoperability with CownershipFeature: Ownership modifiers and semanticsFeature: Ownership modifiers and semantics