Open
Description
Description
this errors with “this is a compiler bug” on 5.10, and crashes on main.
Reproduction
actor A
{
nonisolated
let x:Int
init()
{
self.x = 0
}
}
struct AWrapper:~Copyable
{
let a:A
var x:Int { self.a.x }
}
Stack dump
Begin Error in Function: '$s4main8AWrapperV1xSivg'
Non trivial values, non address values, and non guaranteed function args must have at least one lifetime ending use?!
Value: %2 = begin_borrow %0 : $AWrapper
// user: %3
End Error in Function: '$s4main8AWrapperV1xSivg'
Found ownership error?!
triggering standard assertion failure routine
UNREACHABLE executed at /home/build-user/swift/lib/SIL/Verifier/LinearLifetimeCheckerPrivate.h:211!
Stack dump:
0. Program arguments: /usr/bin/swift-frontend -frontend -interpret - -disable-objc-interop -color-diagnostics -enable-bare-slash-regex -empty-abi-descriptor -Xcc -working-directory -Xcc /app -resource-dir /usr/lib/swift -module-name main -plugin-path /usr/lib/swift/host/plugins -plugin-path /usr/local/lib/swift/host/plugins
1. Swift version 6.0-dev (LLVM 57177aa1b91540b, Swift 8be62863326595c)
2. Compiling with effective version 5.10
3. While verifying SIL function "@$s4main8AWrapperV1xSivg".
for getter for x (at <stdin>:14:9)
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):
0 swift-frontend 0x000056795151b5a7
1 swift-frontend 0x00005679515192fe
2 swift-frontend 0x000056795151bc1a
3 libc.so.6 0x00007074e4f3f520
4 libc.so.6 0x00007074e4f939fc pthread_kill + 300
5 libc.so.6 0x00007074e4f3f476 raise + 22
6 libc.so.6 0x00007074e4f257f3 abort + 211
7 swift-frontend 0x0000567951470c6f
8 swift-frontend 0x000056794ba676ee
9 swift-frontend 0x000056794ba6baba
10 swift-frontend 0x000056794ba69df2
11 swift-frontend 0x000056794ba69a41
12 swift-frontend 0x000056794ba6c1cc
13 swift-frontend 0x000056794ba6c049
14 swift-frontend 0x000056794ba97dae
15 swift-frontend 0x000056794ba9b593
16 swift-frontend 0x000056794ba80261
17 swift-frontend 0x000056794ba77770
18 swift-frontend 0x000056794ba75cbb
19 swift-frontend 0x000056794ba6dd0f
20 swift-frontend 0x000056794ba719a8
21 swift-frontend 0x000056794ba71861
22 swift-frontend 0x000056794aa91922
23 swift-frontend 0x000056794a7637e3
24 swift-frontend 0x000056794a7629ea
25 swift-frontend 0x000056794a779605
26 swift-frontend 0x000056794a766717
27 swift-frontend 0x000056794a764a9c
28 swift-frontend 0x000056794a514e6e
29 libc.so.6 0x00007074e4f26d90
30 libc.so.6 0x00007074e4f26e40 __libc_start_main + 128
31 swift-frontend 0x000056794a513f15
timeout: the monitored command dumped core
Aborted
Expected behavior
it should not crash
Environment
Swift version 6.0-dev (LLVM 57177aa1b91540b, Swift 8be6286)
Target: x86_64-unknown-linux-gnu
Additional information
No response
Metadata
Metadata
Assignees
Labels
Area → compiler: SIL optimization passesA deviation from expected or documented behavior. Also: expected but undesirable behavior.The Swift compiler itselfBug: A crash, i.e., an abnormal termination of softwareFeature → type declarations: Move-only type declarationsFeature: Ownership modifiers and semantics