swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.63k stars 10.37k forks source link

Crash building swift-toolchain-sqlite in release on Windows aarch64 #76105

Open dschaefer2 opened 2 months ago

dschaefer2 commented 2 months ago

Description

With the latest available Windows ARM toolchain, I'm building the swift-toolchain-sqlite project in release mode and get the compiler crash. It builds fine in debug.

Reproduction

git checkout https://github.com/swiftlang/swift-toolchain-sqlite
cd swift-toolchain-sqlite
swift build -c release

Stack dump

[0/1] Planning build
Building for production...
Assertion failed: N1.getValueType().bitsGT(VT) && "Invalid truncate node, src < dst!", file C:\Users\swift-ci\jenkins\workspace\swift-6.0-windows-toolchain-arm64\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAG.cpp, line 5739
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: C:\\Users\\dschaefer2\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\bin\\clang.exe -target aarch64-unknown-windows-msvc -O2 -DSWIFT_PACKAGE=1 -fblocks -I C:\\Users\\dschaefer2\\swift\\src\\swift-toolchain-sqlite\\Sources\\CSQLite\\include -D_MT -D_DLL -Xclang --dependent-lib=msvcrt -gdwarf -MD -MT dependencies -MF C:\\Users\\dschaefer2\\swift\\src\\swift-toolchain-sqlite\\.build\\aarch64-unknown-windows-msvc\\release\\SwiftToolchainCSQLite.build\\sqlite3.c.d -c C:\\Users\\dschaefer2\\swift\\src\\swift-toolchain-sqlite\\Sources\\CSQLite\\sqlite3.c -o C:\\Users\\dschaefer2\\swift\\src\\swift-toolchain-sqlite\\.build\\aarch64-unknown-windows-msvc\\release\\SwiftToolchainCSQLite.build\\sqlite3.c.o
1.  <eof> parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module 'C:\Users\dschaefer2\swift\src\swift-toolchain-sqlite\Sources\CSQLite\sqlite3.c'.
4.  Running pass 'AArch64 Instruction Selection' on function '@sqlite3VdbeExec'
Exception Code: 0x80000003
 #0 0x00007ff7a635bb10 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x167bb10)
 #1 0x00007ffe32175f08 (C:\Windows\System32\ucrtbase.dll+0x75f08)
 #2 0x00007ffe32176ebc (C:\Windows\System32\ucrtbase.dll+0x76ebc)
 #3 0x00007ffe321786dc (C:\Windows\System32\ucrtbase.dll+0x786dc)
 #4 0x00007ffe321788d8 (C:\Windows\System32\ucrtbase.dll+0x788d8)
 #5 0x00007ff7a71b3204 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x24d3204)
 #6 0x00007ff7a71b7f08 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x24d7f08)
 #7 0x00007ff7a7319d3c (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x2639d3c)
 #8 0x00007ff7a730e1f0 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x262e1f0)
 #9 0x00007ff7a730db9c (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x262db9c)
#10 0x00007ff7a71e1548 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x2501548)
#11 0x00007ff7a71e11b0 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x25011b0)
#12 0x00007ff7a71ec794 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x250c794)
#13 0x00007ff7a5aa5dec (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0xdc5dec)
#14 0x00007ff7a5e67364 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x1187364)
#15 0x00007ff7a5e675e8 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x11875e8)
#16 0x00007ff7a5e67954 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x1187954)
#17 0x00007ff7a5e6709c (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x118709c)
#18 0x00007ff7a6643fd4 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x1963fd4)
#19 0x00007ff7a6643294 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x1963294)
#20 0x00007ff7a6643974 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x1963974)
#21 0x00007ff7a9849964 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x4b69964)
#22 0x00007ff7a7db20c8 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x30d20c8)
#23 0x00007ff7a6e35950 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x2155950)
#24 0x00007ff7a9848818 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x4b68818)
#25 0x00007ff7a6e35788 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x2155788)
#26 0x00007ff7a6de6d84 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x2106d84)
#27 0x00007ff7a6eb56dc (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x21d56dc)
#28 0x00007ff7a4d5a248 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x7a248)
#29 0x00007ff7a4d51ad8 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x71ad8)
#30 0x00007ff7a6cf4af4 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x2014af4)
#31 0x00007ff7a6349648 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x1669648)
#32 0x00007ff7a6cf50ec (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x20150ec)
#33 0x00007ff7a6c47884 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x1f67884)
#34 0x00007ff7a6c47a88 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x1f67a88)
#35 0x00007ff7a6c2b888 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x1f4b888)
#36 0x00007ff7a4d53d0c (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x73d0c)
#37 0x00007ff7a4d65624 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x85624)
#38 0x00007ff7a90b7c58 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x43d7c58)
#39 0x00007ff7a90b7cf4 (C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\clang.exe+0x43d7cf4)
#40 0x00007ffe35002310 (C:\Windows\System32\KERNEL32.DLL+0x12310)
#41 0x00007ffe365f5b2c (C:\Windows\SYSTEM32\ntdll.dll+0x75b2c)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 17.0.6
Target: aarch64-unknown-windows-msvc
Thread model: posix
InstalledDir: C:\Users\dschaefer2\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: C:\Users\DSCHAE~1\AppData\Local\Temp\sqlite3-10511f.c
clang: note: diagnostic msg: C:\Users\DSCHAE~1\AppData\Local\Temp\sqlite3-10511f.sh
clang: note: diagnostic msg: 

********************
[0/3] Compiling SwiftToolchainCSQLite sqlite3.c

Expected behavior

No crash?

Environment

Swift version 6.0-dev (LLVM c3efe9282719c35, Swift b163fed2b3101e0) Target: aarch64-unknown-windows-msvc

Additional information

No response

rjmansfield commented 2 months ago

Looks like https://github.com/llvm/llvm-project/issues/76734 and fixed by https://github.com/llvm/llvm-project/pull/76791

dschaefer2 commented 2 months ago

This blocks building SwiftPM main using the 6.0 toolchain for Windows ARM64.