"vcasan.cpp" file not found on Address Sanitizer exception

オープン
#14,427 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
cpp, vscode
領域
devtools

調査の方向性

添付された AddressSanitizerTest.zip の再現ファイルと DebugConsoleOutput.txt の出力から始め、デバッグの Call Stack が vcasan.cpp フレームをどのように処理するかを調査します。失敗を再現し、AddressSanitizer 例外でブレークしたときに、ファイルが見つからないというメッセージを表示する代わりに main.cpp の 5 行目が開くことを確認します。

索引モデルが issue の本文から書いたものです。

説明

bug debugger help wanted
Environment
  • OS and Version: Microsoft Windows 10 Pro (Version 10.0.19045 Build 19045)
  • VS Code Version: 1.119.0
  • C/C++ Extension Version: 1.32.2
  • Visual Studio Version: Community 2026 version 18.5.2
Bug Summary and Steps to Reproduce

Bug Summary:
When AddressSanitizer throws an exception, VS Code breaks but tries to open a file "vcasan.cpp" which can't be found. By going to the debug Call Stack I can select the main.exe!main() Line 5 frame to see the actual line in my source code that caused the overflow, but I'm wondering if I've misconfigured something that would let VS Code do this automatically? Any help is appreciated, thanks!

Image Image

Steps to reproduce:

  1. Download and unzip example code:
    AddressSanitizerTest.zip
  2. Launch VS Code from x64 Native Tools Command Prompt for VS
  3. Open example code
  4. Run default build task
  5. Start debugging
  6. Address Sanitizer throws exception, but VS Code shows unhelpful The editor could not be opened because the file was not found. message
    Expected behavior:
    VS Code breaks on Line 5 of main.cpp, where the heap overflow happens in the user's source code.

Here is the Debug Console Output for the Address Sanitizer exception:
DebugConsoleOutput.txt

Configuration and Logs
c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.26100.0",
            "compilerPath": "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "windows-msvc-x64"
        }
    ],
    "version": 4
}


Log Diagnostics:

-------- Diagnostics - 5/6/2026, 4:50:01 PM
Version: 1.32.2
Current Configuration:
{
    "name": "Win32",
    "includePath": [
        "c:/Users/Kevin/Documents/Programming/AddressSanitizerTest/**"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "windowsSdkVersion": "10.0.26100.0",
    "compilerPath": "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/cl.exe",
    "cStandard": "c17",
    "cppStandard": "c++17",
    "intelliSenseMode": "windows-msvc-x64",
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true,
    "recursiveIncludesReduceIsExplicit": false,
    "recursiveIncludesPriorityIsExplicit": false,
    "recursiveIncludesOrderIsExplicit": false,
    "compilerPathInCppPropertiesJson": "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/cl.exe",
    "mergeConfigurations": false,
    "recursiveIncludes": {},
    "browse": {
        "limitSymbolsToIncludedHeaders": true
    }
}
Modified Settings:
{
    "C_Cpp.copilotHover": "disabled"
}
Additional Tracked Settings:
{
    "editorTabSize": 4,
    "editorInsertSpaces": true,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "utf8",
    "filesAssociations": {},
    "filesExclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/.DS_Store": true,
        "**/Thumbs.db": true
    },
    "filesAutoSaveAfterDelay": false,
    "editorInlayHintsEnabled": true,
    "editorParameterHintsEnabled": true,
    "searchExclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/*.code-search": true
    },
    "workbenchSettingsEditor": "ui"
}
cpptools version (native): 1.32.2.0
Current database path: C:\Users\Kevin\AppData\Local\Microsoft\vscode-cpptools\77a60dd37b6c63560da26e05e8402e68\.BROWSE.VC.DB
Translation Unit Mappings:
[ C:\Users\Kevin\Documents\Programming\AddressSanitizerTest\main.cpp - source TU]:
Translation Unit Configurations:
[ C:\Users\Kevin\Documents\Programming\AddressSanitizerTest\main.cpp ]
    Process ID: 6928
    Memory Usage: 27 MB
    Compiler Path: C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\bin\Hostx64\x64\cl.exe
    Include Paths:
        include: C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\include
        include: C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\VS\include
        include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt
        include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um
        include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared
        include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\winrt
        include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\cppwinrt
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\winrt
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\cppwinrt
    Defines:
        _DEBUG
        UNICODE
        _UNICODE
    Standard Version: ms_c++17
    IntelliSense Mode: windows-msvc-x64
    Other Flags:
        --using_directory
        C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\lib\x64
        --using_directory
        C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\lib\x86\store\references
        --using_directory
        C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.26100.0
        --using_directory
        C:\Program Files (x86)\Windows Kits\10\References\10.0.26100.0
        --using_directory
        C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Total Memory Usage: 27 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 5133


Language Server Logging:

loggingLevel: 6
loggingLevel has changed to: Debug
Processed c_cpp_properties.json in 0.0021933s
Shutting down IntelliSense server: C:\Users\Kevin\Documents\Programming\AddressSanitizerTest\main.cpp
LSP: (invoked) cpptools/didChangeCppProperties (id: 28)
Attempting to get defaults from C++ compiler in "compilerPath" property: 'C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/cl.exe'
Attempting to get defaults from C compiler in "compilerPath" property: 'C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/cl.exe'
  Folder: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.26100.0\CPPWINRT will be indexed
  Folder: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.26100.0\SHARED will be indexed
  Folder: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.26100.0\UCRT will be indexed
  Folder: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.26100.0\UM will be indexed
  Folder: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.26100.0\WINRT will be indexed
  Folder: C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\18\COMMUNITY\VC\AUXILIARY\VS\INCLUDE will be indexed
  Folder: C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\18\COMMUNITY\VC\TOOLS\MSVC\14.50.35717\INCLUDE will be indexed
  Folder: C:\USERS\KEVIN\DOCUMENTS\PROGRAMMING\ADDRESSSANITIZERTEST will be indexed
LSP: Sending response (id: 28)
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
Other Extensions

No response

Additional context

No response

主要言語
TypeScript
スター
6.2k
フォーク
1.7k
平均マージ
14時間 46分
マージ済み PR(30日)
61

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/vscode-cpptools のほかの issue

microsoft/vscode-cpptools の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。