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
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
Swift version 5.4 (swift-5.4-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug, CompilerCrash
Assignee
None
Priority
Medium
md5: e1057da7f5049c466a656c6dfb4b9043
Issue Description:
Summary
The compiler crashes when the following code is being compiled where all the conditions below are met:
OS is Ubuntu (non-Darwin)
Swift 5.4
Optimization is enabled (-O)
// over-consume.swift
import Foundation
import XCTest
letqueryItems:[URLQueryItem]?=[]XCTAssertNil(queryItems?.first(where:{ _ in false }))
Result
Begin Error in Function: '$s4mainypSgyKXEfu_'
Found over consume?!
Value: %20 = argument of bb3 :$Optional<URLQueryItem> // users: %27, %26
User: br bb7(%20 :$Optional<URLQueryItem>) // id: %27
Block: bb3
Consuming Users:
br bb7(%20 :$Optional<URLQueryItem>) // id: %27
switch_enum %20 :$Optional<URLQueryItem>, case#Optional.some!enumelt: bb5, case #Optional.none!enumelt: bb4 // id: %26
End Error in Function: '$s4mainypSgyKXEfu_'
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 project and the crash backtrace.
Stack dump:
0. Program arguments: /usr/bin/swift-frontend -frontend -c -primary-file over-consume.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -color-diagnostics -O -module-name main -o /tmp/over-consume-6d3f5b.o
1. Swift version 5.4 (swift-5.4-RELEASE)
2. While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, Serialize, MidLevel,Function, ClosureSpecialize, LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for main.main)
3. While running pass #​5068 SILFunctionTransform "OwnershipModelEliminator" on SILFunction "@$s4mainypSgyKXEfu_".forexpression at [over-consume.swift:5:14 - line:5:53] RangeText="queryItems?.first(where: { _infalse }"4. Found verification error when verifying before lowering ownership. Please re-run with -sil-verify-all to identify the actual pass that introduced the verification error.5. While verifying SIL function "@$s4mainypSgyKXEfu_". for expression at [over-consume.swift:5:14 - line:5:53] RangeText="queryItems?.first(where: { _ infalse }"/usr/bin/swift-frontend[0x55f5064]/usr/bin/swift-frontend[0x55f2c5e]/usr/bin/swift-frontend[0x55f5245]/lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f76761203c0]/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f7675bc818b]/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f7675ba7859]/usr/bin/swift-frontend[0x5547a01]/usr/bin/swift-frontend[0x12889de]/usr/bin/swift-frontend[0x1285a75]/usr/bin/swift-frontend[0x1286bb7]/usr/bin/swift-frontend[0x1291a4c]/usr/bin/swift-frontend[0x1293af0]/usr/bin/swift-frontend[0x1293900]/usr/bin/swift-frontend[0x12b89d1]/usr/bin/swift-frontend[0x129e2aa]/usr/bin/swift-frontend[0x129cbb6]/usr/bin/swift-frontend[0x129547d]/usr/bin/swift-frontend[0xf6dd3a]/usr/bin/swift-frontend[0xaec232]/usr/bin/swift-frontend[0xaed147]/usr/bin/swift-frontend[0xaea648]/usr/bin/swift-frontend[0xaea5fb]/usr/bin/swift-frontend[0xb0aada]/usr/bin/swift-frontend[0xaf50e3]/usr/bin/swift-frontend[0xaea825]/usr/bin/swift-frontend[0xaf775f]/usr/bin/swift-frontend[0x69a8d2]/usr/bin/swift-frontend[0x51bda1]/usr/bin/swift-frontend[0x51b6e6]/usr/bin/swift-frontend[0x50ffbe]/usr/bin/swift-frontend[0x49cb51]/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f7675ba90b3]/usr/bin/swift-frontend[0x49c66e]<unknown>:0: error: unable to execute command: Aborted<unknown>:0: error: compile command failed due to signal 6 (use -v to see invocation)
Notes
The compiler doesn't crash where one of the conditions below is met:
Swift 5.3.x
OS is macOS
Optimization is disabled
URLQueryItem is changed to other type such as Data
XCTAssertNil is changed to other function such as print
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
Ubuntu 20.04
Swift version 5.4 (swift-5.4-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional Detail from JIRA
md5: e1057da7f5049c466a656c6dfb4b9043
Issue Description:
Summary
The compiler crashes when the following code is being compiled where all the conditions below are met:
OS is Ubuntu (non-Darwin)
Swift 5.4
Optimization is enabled (
-O
)Result
Notes
The compiler doesn't crash where one of the conditions below is met:
Swift 5.3.x
OS is macOS
Optimization is disabled
URLQueryItem
is changed to other type such asData
XCTAssertNil
is changed to other function such asprint
The text was updated successfully, but these errors were encountered: