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

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

Closed
sangraamp opened this issue Feb 21, 2024 · 3 comments
Closed

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

sangraamp opened this issue Feb 21, 2024 · 3 comments
Assignees
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
Milestone

Comments

@sangraamp
Copy link

sangraamp commented Feb 21, 2024

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:https:///Users/apple/2D%20Physics%20Engine/.git/.gitstatus.5vKTiE
LSP: (received - deferred) cpptools/fileCreated: file:https:///Users/apple/2D%20Physics%20Engine/.git/.gitstatus.5vKTiE/a
LSP: (received - deferred) cpptools/fileCreated: file:https:///Users/apple/2D%20Physics%20Engine/.git/.gitstatus.5vKTiE/b
LSP: (received - deferred) cpptools/fileDeleted: file:https:///Users/apple/2D%20Physics%20Engine/.git/.gitstatus.5vKTiE
LSP: (received - deferred) cpptools/fileCreated: file:https:///Users/apple/2D%20Physics%20Engine/.git/index
LSP: (received - deferred) cpptools/fileDeleted: file:https:///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

@Colengms
Copy link
Collaborator

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?

@Colengms Colengms self-assigned this Feb 21, 2024
@Colengms Colengms added Language Service more info needed The issue report is not actionable in its current state labels Feb 21, 2024
@sangraamp
Copy link
Author

Well, thanks for that, @Colengms! Looks like that was the issue, it is working now.

@Colengms Colengms 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 Feb 22, 2024
@Colengms Colengms added bug and removed more info needed The issue report is not actionable in its current state labels Feb 22, 2024
@Colengms Colengms added this to Triage in 1.20 via automation Feb 22, 2024
@Colengms Colengms added this to the 1.20.0 milestone Feb 22, 2024
@sean-mcmanus sean-mcmanus modified the milestones: 1.20.0, 1.20 Mar 25, 2024
@browntarik browntarik moved this from Triage to To do in 1.20 Mar 27, 2024
@browntarik browntarik assigned browntarik and unassigned Colengms Mar 27, 2024
@browntarik browntarik moved this from To do to In progress in 1.20 Apr 5, 2024
@browntarik browntarik moved this from In progress to To do in 1.20 Apr 8, 2024
@browntarik browntarik moved this from To do to In progress in 1.20 Apr 12, 2024
@bobbrow bobbrow removed this from In progress in 1.20 Apr 23, 2024
@bobbrow bobbrow added this to Triage in 1.21 via automation Apr 23, 2024
@bobbrow bobbrow moved this from Triage to In progress in 1.21 Apr 23, 2024
@browntarik browntarik moved this from In progress to Pull Request in 1.21 Apr 24, 2024
@browntarik browntarik added the fixed Check the Milestone for the release in which the fix is or will be available. label Apr 29, 2024
@browntarik browntarik moved this from Pull Request to Done in 1.21 Apr 29, 2024
@sean-mcmanus sean-mcmanus modified the milestones: 1.20, 1.20.3 Apr 30, 2024
@sean-mcmanus sean-mcmanus removed this from Done in 1.21 Apr 30, 2024
@sean-mcmanus sean-mcmanus added this to Triage in 1.20 via automation Apr 30, 2024
@sean-mcmanus sean-mcmanus moved this from Triage to Done in 1.20 Apr 30, 2024
@sean-mcmanus
Copy link
Collaborator

@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
No open projects
1.20
Done
Development

No branches or pull requests

4 participants