Skip to content

Use of / as an include path causes crash/freeze on macOS #11993

Closed

Description

@soyabean-10

Environment

  • OS and Version: macOS Sonoma 14.3.1 (23D60)
  • VS Code Version: 1.86.2
  • C/C++ Extension Version: v1.18.5
  • If using SSH remote, specify OS of remote machine: N/A

Bug Summary and Steps to Reproduce

Bug Summary:

Pre-release version:
Screenshot 2024-02-21 at 3 44 59 PM

Release version:
Screenshot 2024-02-21 at 3 52 27 PM

Steps to reproduce:
Not aware of this as of now.

Expected behavior:
N/A

Configuration and Logs

Configurations in c_cpp_properties.json:
{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**",
                "/"
            ],
            "defines": [],
            "macFrameworkPath": [
                "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "macos-clang-x64",
            "configurationProvider": "ms-vscode.makefile-tools"
        }
    ],
    "version": 4
}

Logs from running C/C++: Log Diagnostics from the VS Code command palette:
N/A (not able to get the logs)

Logs from the language server logging:
loggingLevel: Debug
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.18.5
cpptools version (native): 1.18.3.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/queryCompilerDefaults (id: 2)
LSP: (invoked) cpptools/queryCompilerDefaults (id: 2)
LSP: (received) cpptools/didChangeCppProperties (id: 3)
LSP: (received) cpptools/queryCompilerDefaults (id: 4)
Querying compiler for default C++ language standard using command line: /usr/bin/clang -x c++ -E -dM /dev/null
Compiler returned default language standard version: c++98. Since this version is old, will try to use newer version c++17 as default.
Querying compiler's default target using command line: "/usr/bin/clang" -dumpmachine
Compiler returned default target value: x86_64-apple-darwin23.3.0
Compiler query command line: /usr/bin/clang -std=c17 -m64 -Wp,-v -fno-blocks -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/clang'
Compiler query command line: /usr/bin/clang -std=c++17 -m64 -Wp,-v -fno-blocks -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/clang'
LSP: (invoked) cpptools/didChangeCppProperties (id: 3)
Code browsing service initialized
  /Users/apple/2D Physics Engine/** is not a directory
Custom configuration provider 'Makefile Tools' registered
LSP: (received - deferred) cpptools/fileCreated: file:///Users/apple/2D%20Physics%20Engine/.git/.gitstatus.5vKTiE
LSP: (received - deferred) cpptools/fileCreated: file:///Users/apple/2D%20Physics%20Engine/.git/.gitstatus.5vKTiE/a
LSP: (received - deferred) cpptools/fileCreated: file:///Users/apple/2D%20Physics%20Engine/.git/.gitstatus.5vKTiE/b
LSP: (received - deferred) cpptools/fileDeleted: file:///Users/apple/2D%20Physics%20Engine/.git/.gitstatus.5vKTiE
LSP: (received - deferred) cpptools/fileCreated: file:///Users/apple/2D%20Physics%20Engine/.git/index
LSP: (received - deferred) cpptools/fileDeleted: file:///Users/apple/2D%20Physics%20Engine/.git/index.lock
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.18.5
cpptools version (native): 1.18.3.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
Warning: Database safety check failed. Recreating database.
[rc=0x80004005] (DB: false, Expected: true)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/clang -x c++ -E -dM /dev/null
Compiler returned default language standard version: c++98. Since this version is old, will try to use newer version c++17 as default.
Querying compiler's default target using command line: "/usr/bin/clang" -dumpmachine
Compiler returned default target value: x86_64-apple-darwin23.3.0
Compiler query command line: /usr/bin/clang -std=c++17 -m64 -Wp,-v -fno-blocks -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/clang'
Compiler query command line: /usr/bin/clang -std=c17 -m64 -Wp,-v -fno-blocks -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/clang'
  /Users/apple/2D Physics Engine/** is not a directory

I don't know why it says the folder isn't a directory, I can access it via the terminal.

Other Extensions

No response

Additional context

Here are the folder permissions:
drwxr-xr-x@ 15 apple staff 480 Feb 21 12:11 2D Physics Engine

Activity

  1. Colengms commented on Feb 21, 2024

    @Colengms
    Contributor

    Hi @sangraamp . Since we're not tracking an issue blocking all Mac users, there may be something about your system or configuration that we may need to uncover to understand what's happening.

    Does this happen for you with a simple project, such as a folder containing just a single, simple source file?

    I noticed that you've specified "/" as an include path. Since it's unlikely that you have header files located directly at the root of your file system, I don't think this is needed. I suspect this is resulting in the C/C++ extension trying to ingest your entire file system into its browse database, possibly crashing due to running out of memory. Does the issue still occur if you remove that?

  2. soyabean-10 commented on Feb 22, 2024

    @soyabean-10
    Author

    Well, thanks for that, Colen Garoutte-Carson (@Colengms)! Looks like that was the issue, it is working now.

  3. changed the title [-]Unable to start the C/C++ language server. IntelliSense features will be disabled. Error: Error: Pending response rejected since connection got disposed[/-] [+]Use of `/` as an include path causes crash/freeze on macOS[/+] on Feb 22, 2024
  4. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Apr 29, 2024
  5. sean-mcmanus commented on May 1, 2024

    @sean-mcmanus
    Contributor
  6. locked and limited conversation to collaborators on Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions