Hello,
Running into an issue trying to build my project in release config (works fine in debug). Anyone run into this, or have suggestions for workarounds/ places to look in my code to build a make a reproducible sample?
Assertion failed: Buffer.empty() && "didn't claim all values out of buffer", file C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain\llvm-project\llvm\..\clang\include\clang/CodeGen/ConstantInitBuilder.h, line 75
opened 08:04PM - 21 Oct 24 UTC
bug
crash
triage needed
### Description
As of swift 6 toolchain, the following assert is thrown in rele… ase builds (the same project compiles and runs successfully in debug builds)
```
Assertion failed: Buffer.empty() && "didn't claim all values out of buffer", file C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain\llvm-project\llvm\..\clang\include\clang/CodeGen/ConstantInitBuilder.h, line 75
```
### Reproduction
```swift
```
### Stack dump
```text
0. Program arguments: C:\\Users\\mike\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\bin\\swift-frontend.exe -frontend -c C:\\Users\\mike\\hermes-swift\\Sources\\HermesFormatSupport\\HMSMovieReaderArriRAW.swift C:\\Users\\mike\\hermes-swift\\Sources\\HermesFormatSupport\\HMSMovieReaderBRAW.swift C:\\Users\\mike\\hermes-swift\\Sources\\HermesFormatSupport\\HMSMovieReaderCanonRAW.swift C:\\Users\\mike\\hermes-swift\\Sources\\HermesFormatSupport\\HMSMovieReaderFFmpeg.swift C:\\Users\\mike\\hermes-swift\\Sources\\HermesFormatSupport\\HMSMovieReaderFactory.swift C:\\Users\\mike\\hermes-swift\\Sources\\HermesFormatSupport\\HMSMovieReaderPhantom.swift C:\\Users\\mike\\hermes-swift\\Sources\\HermesFormatSupport\\HMSMovieReaderR3D.swift C:\\Users\\mike\\hermes-swift\\Sources\\HermesFormatSupport\\HMSMovieReaderTest.swift C:\\Users\\mike\\hermes-swift\\Sources\\HermesFormatSupport\\HMSMovieReaderXOCN.swift C:\\Users\\mike\\hermes-swift\\Sources\\HermesFormatSupport\\ProResRAWDecoder.swift C:\\Users\\mike\\hermes-swift\\Sources\\HermesFormatSupport\\Utils\\HMSCppInteropUtils.swift -supplementary-output-file-map C:\\Users\\mike\\AppData\\Local\\Temp\\TemporaryDirectory.7rlkX6\\supplementaryOutputs-1 -target x86_64-unknown-windows-msvc -disable-objc-interop -cxx-interoperability-mode=default -sdk C:\\Users\\mike\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\SDKs\\Windows.sdk\\ -I C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\Modules -I C:\\Users\\mike\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows -I C:\\Users\\mike\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows\\x86_64 -I C:\\Users\\mike\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\Testing-development\\usr\\lib\\swift\\windows -color-diagnostics -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\ModuleCache -swift-version 5 -O -D SWIFT_PACKAGE -load-plugin-executable C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\CasePathsMacros-tool.exe#CasePathsMacros -empty-abi-descriptor -Xcc -working-directory -Xcc C:\\Users\\mike\\hermes-swift -resource-dir C:\\Users\\mike\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\lib\\swift -file-compilation-dir C:\\Users\\mike\\hermes-swift -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\.build\\checkouts\\swift-syntax\\Sources\\_SwiftSyntaxCShims\\include\\module.modulemap -Xcc -I -Xcc C:\\Users\\mike\\hermes-swift\\.build\\checkouts\\swift-syntax\\Sources\\_SwiftSyntaxCShims\\include -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\HERMES_Cpp\\include\\module.modulemap -Xcc -I -Xcc C:\\Users\\mike\\hermes-swift\\Sources\\HERMES_Cpp\\include -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\XOCNlib\\include\\module.modulemap -Xcc -I -Xcc C:\\Users\\mike\\hermes-swift\\Sources\\XOCNlib\\include -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\smdk\\module.modulemap -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\SonyRawDev\\module.modulemap -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\BRAWlib\\include\\module.modulemap -Xcc -I -Xcc C:\\Users\\mike\\hermes-swift\\Sources\\BRAWlib\\include -Xcc "-fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\BRAW\\Blackmagic RAW SDK\\Win\\module.modulemap" -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\Phantomlib\\include\\module.modulemap -Xcc -I -Xcc C:\\Users\\mike\\hermes-swift\\Sources\\Phantomlib\\include -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\Phantom.build\\module.modulemap -Xcc -I -Xcc C:\\Users\\mike\\hermes-swift\\Sources\\Phantom\\source\\include -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\ArriRAWlib\\include\\module.modulemap -Xcc -I -Xcc C:\\Users\\mike\\hermes-swift\\Sources\\ArriRAWlib\\include -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\Codex\\CodexHDE-5.2.0-windows-cuda-decoder\\module.modulemap -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\ArriMXF\\install\\win\\module.modulemap -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\ArriRAW\\ARRI_Image_SDK_8.2.1_win_msvc192_x64\\module.modulemap -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\R3Dlib\\include\\module.modulemap -Xcc -I -Xcc C:\\Users\\mike\\hermes-swift\\Sources\\R3Dlib\\include -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\R3D\\R3DSDKv8_5_1\\module.modulemap -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\CanonRAWlib\\include\\module.modulemap -Xcc -I -Xcc C:\\Users\\mike\\hermes-swift\\Sources\\CanonRAWlib\\include -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\CanonRAW\\CRMSDK_2.7\\CRMSDK27\\CRMSDK\\module.modulemap -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\FFmpeglib\\include\\module.modulemap -Xcc -I -Xcc C:\\Users\\mike\\hermes-swift\\Sources\\FFmpeglib\\include -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\FFmpeg\\module.modulemap -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\FFmpeg\\module.modulemap -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\FFmpeg\\module.modulemap -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\FFmpeg\\module.modulemap -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\FFmpeg\\module.modulemap -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\ProResRAWlib\\include\\module.modulemap -Xcc -I -Xcc C:\\Users\\mike\\hermes-swift\\Sources\\ProResRAWlib\\include -Xcc -fmodule-map-file=C:\\Users\\mike\\hermes-swift\\Sources\\ProResRAW\\module.modulemap -Xcc -std=c++14 -Xcc -IC:\\Users\\mike\\hermes-swift\\Sources\\ProResRAW\\ProResRAW_SDK_Windows_20240502\\ -Xcc -IC:\\Users\\mike\\hermes-swift\\vendor\\opencl\\include\\ -Xcc -D_MT -Xcc -D_DLL -Xcc -Xclang -Xcc --dependent-lib=msvcrt -Xcc -gdwarf -module-name HermesFormatSupport -package-name hermes_swift -in-process-plugin-server-path C:\\Users\\mike\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\bin\\SwiftInProcPluginServer.dll -plugin-path C:\\Users\\mike\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\bin -plugin-path C:\\Users\\mike\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\local\\bin -enable-default-cmo -parse-as-library -num-threads 8 -o C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\HermesFormatSupport.build\\HMSMovieReaderArriRAW.swift.o -o C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\HermesFormatSupport.build\\HMSMovieReaderBRAW.swift.o -o C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\HermesFormatSupport.build\\HMSMovieReaderCanonRAW.swift.o -o C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\HermesFormatSupport.build\\HMSMovieReaderFFmpeg.swift.o -o C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\HermesFormatSupport.build\\HMSMovieReaderFactory.swift.o -o C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\HermesFormatSupport.build\\HMSMovieReaderPhantom.swift.o -o C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\HermesFormatSupport.build\\HMSMovieReaderR3D.swift.o -o C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\HermesFormatSupport.build\\HMSMovieReaderTest.swift.o -o C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\HermesFormatSupport.build\\HMSMovieReaderXOCN.swift.o -o C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\HermesFormatSupport.build\\ProResRAWDecoder.swift.o -o C:\\Users\\mike\\hermes-swift\\.build\\x86_64-unknown-windows-msvc\\release\\HermesFormatSupport.build\\HMSCppInteropUtils.swift.o
1. Swift version 6.1-dev (LLVM 89ccf4b8a46135a, Swift aa7ff59a136091c)
2. Compiling with effective version 5.10
Exception Code: 0x80000003
#0 0x00007ff6dee57835 (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x6317835)
#1 0x00007ffe4fb2e6d5 (C:\WINDOWS\System32\ucrtbase.dll+0x7e6d5)
#2 0x00007ffe4fb2f6e1 (C:\WINDOWS\System32\ucrtbase.dll+0x7f6e1)
#3 0x00007ffe4fb3108e (C:\WINDOWS\System32\ucrtbase.dll+0x8108e)
#4 0x00007ffe4fb312d1 (C:\WINDOWS\System32\ucrtbase.dll+0x812d1)
#5 0x00007ff6d948d7bd (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x94d7bd)
#6 0x00007ff6d96a42cc (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0xb642cc)
#7 0x00007ff6d9695927 (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0xb55927)
#8 0x00007ff6d949d723 (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x95d723)
#9 0x00007ff6d942969e (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x8e969e)
#10 0x00007ff6d9426f4a (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x8e6f4a)
#11 0x00007ff6d90c43f1 (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x5843f1)
#12 0x00007ff6d90c49b3 (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x5849b3)
#13 0x00007ff6d90c3768 (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x583768)
#14 0x00007ff6d90c3cfb (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x583cfb)
#15 0x00007ff6d90c5b45 (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x585b45)
#16 0x00007ff6d8f1e36c (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x3de36c)
#17 0x00007ff6d8f1df3c (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x3ddf3c)
#18 0x00007ff6deeb7bfc (C:\Users\mike\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\swift-frontend.exe+0x6377bfc)
#19 0x00007ffe5086257d (C:\WINDOWS\System32\KERNEL32.DLL+0x1257d)
#20 0x00007ffe527caf08 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x5af08)
```
### Expected behavior
the program should compile as it does without optimizations
### Environment
Swift version 6.1-dev (LLVM 89ccf4b8a46135a, Swift aa7ff59a136091c)
Target: x86_64-unknown-windows-msvc
### Additional information
_No response_
Thanks,
mike
I'm totally stuck here... does anyone have any ideas? The build logs (even with -vv) don't offer any clues. I'd love to pare this down to an easily reproducible sample, but I don't even know where to start looking.
Right now this is blocking a release for us.