I have a swift-winrt based Windows desktop app.
Debugging works fine in the app executable, but when trying to step over the first breakpoint encountered in the Core
package (see Package.swift
below), the debugger crashes with
Assertion failed: Out.empty(), file D:\r\_work\swift-build\swift-build\SourceCache\llvm-project\llvm\lib\Support\ConvertUTFWrapper.cpp, line 85
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: E:\\Swift\\Toolchains\\0.0.0+Asserts\\usr\\bin\\lldb-dap.exe
Exception Code: 0x80000003
#0 0x00007ff7caa94b10 (E:\Swift\Toolchains\0.0.0+Asserts\usr\bin\lldb-dap.exe+0x64b10)
#1 0x00007ffb5b47b030 (C:\WINDOWS\System32\ucrtbase.dll+0x7b030)
#2 0x00007ffb5b47bc3c (C:\WINDOWS\System32\ucrtbase.dll+0x7bc3c)
#3 0x00007ffb5b47d5d4 (C:\WINDOWS\System32\ucrtbase.dll+0x7d5d4)
#4 0x00007ffb5b47cbe0 (C:\WINDOWS\System32\ucrtbase.dll+0x7cbe0)
#5 0x00007ffb5b47d70c (C:\WINDOWS\System32\ucrtbase.dll+0x7d70c)
#6 0x00007ffa86d13628 (E:\Swift\Toolchains\0.0.0+Asserts\usr\bin\liblldb.dll+0xcd3628)
#7 0x00007ffa86a94108 (E:\Swift\Toolchains\0.0.0+Asserts\usr\bin\liblldb.dll+0xa54108)
#8 0x00007ffa862fc978 (E:\Swift\Toolchains\0.0.0+Asserts\usr\bin\liblldb.dll+0x2bc978)
#9 0x00007ff7caa6bfa0 (E:\Swift\Toolchains\0.0.0+Asserts\usr\bin\lldb-dap.exe+0x3bfa0)
#10 0x00007ff7caa520bc (E:\Swift\Toolchains\0.0.0+Asserts\usr\bin\lldb-dap.exe+0x220bc)
#11 0x00007ff7caa5be08 (E:\Swift\Toolchains\0.0.0+Asserts\usr\bin\lldb-dap.exe+0x2be08)
#12 0x00007ff7caa5c220 (E:\Swift\Toolchains\0.0.0+Asserts\usr\bin\lldb-dap.exe+0x2c220)
#13 0x00007ff7caa55240 (E:\Swift\Toolchains\0.0.0+Asserts\usr\bin\lldb-dap.exe+0x25240)
#14 0x00007ff7caaa84e4 (E:\Swift\Toolchains\0.0.0+Asserts\usr\bin\lldb-dap.exe+0x784e4)
#15 0x00007ff7caaa857c (E:\Swift\Toolchains\0.0.0+Asserts\usr\bin\lldb-dap.exe+0x7857c)
#16 0x00007ffb5d4a8740 (C:\WINDOWS\System32\KERNEL32.DLL+0x8740)
#17 0x00007ffb600d0eb4 (C:\WINDOWS\SYSTEM32\ntdll.dll+0xd0eb4)
I don't know if it's related, but shortly after the debugger stops on the first breakpoint, I also get this console output:
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\3V3FQPNHELRZT\CWinRT-17M8XROOKFYCN.pcm unable to locate separate debug file (dwo, dwp). Debugging will be degraded.
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\3V3FQPNHELRZT\CWinRT-17M8XROOKFYCN.pcm 'E:\sandbox\ktraunmueller\compositor\Sources\Win\pertyIndex_FrameworkElement_Resources' does not exist
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\3V3FQPNHELRZT\CWinRT-17M8XROOKFYCN.pcm Unable to locate module needed for external types.
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\3V3FQPNHELRZT\WinSDK-3VZI2CSYIN2UR.pcm unable to locate separate debug file (dwo, dwp). Debugging will be degraded.
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\3V3FQPNHELRZT\WinSDK-3VZI2CSYIN2UR.pcm 'E:\sandbox\ktraunmueller\compositor\Sources\Win\_INFORMATION_CACHE_MACHINEWIDE' does not exist
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\3V3FQPNHELRZT\WinSDK-3VZI2CSYIN2UR.pcm Unable to locate module needed for external types.
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\1304GAUF1OD4S\CWinRT-17M8XROOKFYCN.pcm unable to locate separate debug file (dwo, dwp). Debugging will be degraded.
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\1304GAUF1OD4S\CWinRT-17M8XROOKFYCN.pcm 'E:\sandbox\ktraunmueller\compositor\Sources\Win\rect_CXamlPropertyIndex_FrameworkElement_Tag' does not exist
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\1304GAUF1OD4S\CWinRT-17M8XROOKFYCN.pcm Unable to locate module needed for external types.
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\1304GAUF1OD4S\CWinRT-17M8XROOKFYCN.pcm 'E:\sandbox\ktraunmueller\compositor\Sources\Win\opertyIndex_FrameworkElement_Triggers' does not exist
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\1304GAUF1OD4S\CWinRT-17M8XROOKFYCN.pcm 'E:\sandbox\ktraunmueller\compositor\Sources\Win\meworkElement_VerticalAlignment' does not exist
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\1304GAUF1OD4S\WinSDK-3VZI2CSYIN2UR.pcm unable to locate separate debug file (dwo, dwp). Debugging will be degraded.
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\1304GAUF1OD4S\WinSDK-3VZI2CSYIN2UR.pcm 'E:\sandbox\ktraunmueller\compositor\Sources\Win\PE_DOCUMENT' does not exist
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\1304GAUF1OD4S\WinSDK-3VZI2CSYIN2UR.pcm Unable to locate module needed for external types.
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\1304GAUF1OD4S\WinSDK-3VZI2CSYIN2UR.pcm 'E:\sandbox\ktraunmueller\compositor\Sources\Win' does not exist
warning: (aarch64) E:\sandbox\ktraunmueller\compositor\Sources\Win\.build\aarch64-unknown-windows-msvc\debug\ModuleCache\1304GAUF1OD4S\WinSDK-3VZI2CSYIN2UR.pcm 'E:\sandbox\ktraunmueller\compositor\Sources\Win\ABLE_TIMER' does not exist
Note the truncated file names, e.g. ...\Win\meworkElement_VerticalAlignment
, which should probably be FrameworkElement_VerticalAlignment
.
I know this is very thin information, I was just asking to see if somebody else has run into a similar problem and maybe has found a workaround.
Thanks
Environment:
- Windows 11 arm64
- VS Code with swiftlang.swift-vscode Version 2.0.2
- current TBC Swift toolchain
The app's Package.swift
// swift-tools-version: 6.2
import PackageDescription
let GUILinkerSettings: [LinkerSetting] = [
.unsafeFlags(["-Xlinker", "/SUBSYSTEM:WINDOWS"], .when(configuration: .release)),
// Update the entry point to point to the generated swift function, this lets us keep the same main method
// for debug/release
.unsafeFlags(["-Xlinker", "/ENTRY:mainCRTStartup"], .when(configuration: .release)),
]
let package = Package(
name: "Compositor-Windows",
products: [
.executable(
name: "Compositor",
targets: ["Compositor"]),
],
dependencies: [
// .package(url: "https://github.com/ktraunmueller/swift-cwinrt", branch: "main"),
// .package(url: "https://github.com/ktraunmueller/swift-uwp", branch: "main"),
// .package(url: "https://github.com/ktraunmueller/swift-windowsfoundation", branch: "main"),
// .package(url: "https://github.com/ktraunmueller/swift-windowsappsdk", branch: "main"),
// .package(url: "https://github.com/ktraunmueller/swift-winui", branch: "main"),
// .package(url: "https://github.com/ktraunmueller/swift-plugins", branch: "main")
.package(path: "../../../winrt/swift-cwinrt"),
.package(path: "../../../winrt/swift-uwp"),
.package(path: "../../../winrt/swift-win2d"),
.package(path: "../../../winrt/swift-windowsappsdk"),
.package(path: "../../../winrt/swift-windowsfoundation"),
.package(path: "../../../winrt/swift-winui"),
.package(path: "../Core")
],
targets: [
.executableTarget(
name: "Compositor",
dependencies: [
.product(name: "CompositorCore", package: "Core"),
.product(name: "CWinRT", package: "swift-cwinrt"),
.product(name: "UWP", package: "swift-uwp"),
.product(name: "Win2D", package: "swift-win2d"),
.product(name: "WinAppSDK", package: "swift-windowsappsdk"),
.product(name: "WindowsFoundation", package: "swift-windowsfoundation"),
.product(name: "WinUI", package: "swift-winui"),
],
swiftSettings: [.interoperabilityMode(.Cxx)],
linkerSettings: GUILinkerSettings
),
],
swiftLanguageModes: [.v5]
)