Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldb] [Windows] Lldb-dap crashes when trying to step over breakpoint #10269

Open
ktraunmueller opened this issue Mar 16, 2025 · 0 comments
Open

Comments

@ktraunmueller
Copy link

ktraunmueller commented Mar 16, 2025

I have a swift-winrt based Windows desktop app.

Debugging works fine in the app executable, but when trying to step over (some, not all) breakpoints in other modules (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)

lldb command-line debugging is working fine, so it looks this is an issue in the toolchain's lldb-dap debug adapter, not some general problem with my debugger setup.

Sorry, I know this is very thin information, unfortunately I haven't found more clues on how to reproduce or narrow this down.

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]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant