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

*.cpp not found in compile_commands.json, IntelliSense stuck #1777

Closed
flixr opened this issue Apr 3, 2018 · 27 comments
Closed

*.cpp not found in compile_commands.json, IntelliSense stuck #1777

flixr opened this issue Apr 3, 2018 · 27 comments
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@flixr
Copy link

flixr commented Apr 3, 2018

IntelliSense seems to get stuck (red flame still showing, loading, stale processes as in #1246).

I get an error from cpptools that it can't find a CMake generated file in compile_commands.json

"CMakeCXXCompilerId.cpp" not found in "/home/ruess/code/rcdiscover/build/compile_commands.json". Using 'includePath' setting in c_cpp_properties.json.

I think that IntelliSense/cpptools should ignore this file, as it is not actually compiled...
But I'm not sure if this actually the cause for IntelliSense being stuck...

OS: Ubuntu 14.04 x64
VS Code: 1.21.1
cpptools: 0.16.1
cmake-tools: 0.10.0
cmake: 3.11

Example project I see this problem with: https://github.com/roboception/rcdiscover

My c_cpp_properties.json:

{
        {
            "name": "Linux",
            "includePath": [
                "/usr/include/c++/4.8",
                "/usr/include/x86_64-linux-gnu/c++/4.8",
                "/usr/include/c++/4.8/backward",
                "/usr/lib/gcc/x86_64-linux-gnu/4.8/include",
                "/usr/local/include",
                "/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed",
                "/usr/include/x86_64-linux-gnu",
                "/usr/include",
                "${workspaceRoot}"
            ],
            "compileCommands": "${workspaceRoot}/build/compile_commands.json",
            "defines": [],
            "intelliSenseMode": "clang-x64",
            "browse": {
                "path": [
                    "/usr/include/c++/4.8",
                    "/usr/include/x86_64-linux-gnu/c++/4.8",
                    "/usr/include/c++/4.8/backward",
                    "/usr/lib/gcc/x86_64-linux-gnu/4.8/include",
                    "/usr/local/include",
                    "/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed",
                    "/usr/include/x86_64-linux-gnu",
                    "/usr/include",
                    "${workspaceRoot}"
                ],
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": ""
            },
            "cStandard": "c11",
            "cppStandard": "c++14"
        },
}

The compile_commands.json is generated by cmake 3.11 in my build dir.

[
{
  "directory": "/home/ruess/code/rcdiscover/build/rcdiscover",
  "command": "/usr/bin/c++  -DHAVE_PCAP -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover_static.dir/deviceinfo.cc.o -c /home/ruess/code/rcdiscover/rcdiscover/deviceinfo.cc",
  "file": "/home/ruess/code/rcdiscover/rcdiscover/deviceinfo.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/rcdiscover",
  "command": "/usr/bin/c++  -DHAVE_PCAP -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover_static.dir/discover.cc.o -c /home/ruess/code/rcdiscover/rcdiscover/discover.cc",
  "file": "/home/ruess/code/rcdiscover/rcdiscover/discover.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/rcdiscover",
  "command": "/usr/bin/c++  -DHAVE_PCAP -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover_static.dir/force_ip.cc.o -c /home/ruess/code/rcdiscover/rcdiscover/force_ip.cc",
  "file": "/home/ruess/code/rcdiscover/rcdiscover/force_ip.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/rcdiscover",
  "command": "/usr/bin/c++  -DHAVE_PCAP -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover_static.dir/operation_not_permitted.cc.o -c /home/ruess/code/rcdiscover/rcdiscover/operation_not_permitted.cc",
  "file": "/home/ruess/code/rcdiscover/rcdiscover/operation_not_permitted.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/rcdiscover",
  "command": "/usr/bin/c++  -DHAVE_PCAP -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover_static.dir/wol_exception.cc.o -c /home/ruess/code/rcdiscover/rcdiscover/wol_exception.cc",
  "file": "/home/ruess/code/rcdiscover/rcdiscover/wol_exception.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/rcdiscover",
  "command": "/usr/bin/c++  -DHAVE_PCAP -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover_static.dir/socket_exception.cc.o -c /home/ruess/code/rcdiscover/rcdiscover/socket_exception.cc",
  "file": "/home/ruess/code/rcdiscover/rcdiscover/socket_exception.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/rcdiscover",
  "command": "/usr/bin/c++  -DHAVE_PCAP -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover_static.dir/ping.cc.o -c /home/ruess/code/rcdiscover/rcdiscover/ping.cc",
  "file": "/home/ruess/code/rcdiscover/rcdiscover/ping.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/rcdiscover",
  "command": "/usr/bin/c++  -DHAVE_PCAP -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover_static.dir/wol.cc.o -c /home/ruess/code/rcdiscover/rcdiscover/wol.cc",
  "file": "/home/ruess/code/rcdiscover/rcdiscover/wol.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/rcdiscover",
  "command": "/usr/bin/c++  -DHAVE_PCAP -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover_static.dir/gige_request_counter.cc.o -c /home/ruess/code/rcdiscover/rcdiscover/gige_request_counter.cc",
  "file": "/home/ruess/code/rcdiscover/rcdiscover/gige_request_counter.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/rcdiscover",
  "command": "/usr/bin/c++  -DHAVE_PCAP -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover_static.dir/socket_linux.cc.o -c /home/ruess/code/rcdiscover/rcdiscover/socket_linux.cc",
  "file": "/home/ruess/code/rcdiscover/rcdiscover/socket_linux.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/tools",
  "command": "/usr/bin/c++  -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover.dir/rcdiscover.cc.o -c /home/ruess/code/rcdiscover/tools/rcdiscover.cc",
  "file": "/home/ruess/code/rcdiscover/tools/rcdiscover.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/tools",
  "command": "/usr/bin/c++  -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover-gui.dir/rcdiscover-gui.cc.o -c /home/ruess/code/rcdiscover/tools/rcdiscover-gui.cc",
  "file": "/home/ruess/code/rcdiscover/tools/rcdiscover-gui.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/tools",
  "command": "/usr/bin/c++  -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover-gui.dir/rcdiscover-gui/event-ids.cc.o -c /home/ruess/code/rcdiscover/tools/rcdiscover-gui/event-ids.cc",
  "file": "/home/ruess/code/rcdiscover/tools/rcdiscover-gui/event-ids.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/tools",
  "command": "/usr/bin/c++  -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover-gui.dir/rcdiscover-gui/discover-frame.cc.o -c /home/ruess/code/rcdiscover/tools/rcdiscover-gui/discover-frame.cc",
  "file": "/home/ruess/code/rcdiscover/tools/rcdiscover-gui/discover-frame.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/tools",
  "command": "/usr/bin/c++  -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover-gui.dir/rcdiscover-gui/discover-thread.cc.o -c /home/ruess/code/rcdiscover/tools/rcdiscover-gui/discover-thread.cc",
  "file": "/home/ruess/code/rcdiscover/tools/rcdiscover-gui/discover-thread.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/tools",
  "command": "/usr/bin/c++  -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover-gui.dir/rcdiscover-gui/sensor-command-dialog.cc.o -c /home/ruess/code/rcdiscover/tools/rcdiscover-gui/sensor-command-dialog.cc",
  "file": "/home/ruess/code/rcdiscover/tools/rcdiscover-gui/sensor-command-dialog.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/tools",
  "command": "/usr/bin/c++  -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover-gui.dir/rcdiscover-gui/reset-dialog.cc.o -c /home/ruess/code/rcdiscover/tools/rcdiscover-gui/reset-dialog.cc",
  "file": "/home/ruess/code/rcdiscover/tools/rcdiscover-gui/reset-dialog.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/tools",
  "command": "/usr/bin/c++  -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover-gui.dir/rcdiscover-gui/force-ip-dialog.cc.o -c /home/ruess/code/rcdiscover/tools/rcdiscover-gui/force-ip-dialog.cc",
  "file": "/home/ruess/code/rcdiscover/tools/rcdiscover-gui/force-ip-dialog.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/tools",
  "command": "/usr/bin/c++  -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover-gui.dir/rcdiscover-gui/reconnect-dialog.cc.o -c /home/ruess/code/rcdiscover/tools/rcdiscover-gui/reconnect-dialog.cc",
  "file": "/home/ruess/code/rcdiscover/tools/rcdiscover-gui/reconnect-dialog.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/tools",
  "command": "/usr/bin/c++  -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover-gui.dir/rcdiscover-gui/about-dialog.cc.o -c /home/ruess/code/rcdiscover/tools/rcdiscover-gui/about-dialog.cc",
  "file": "/home/ruess/code/rcdiscover/tools/rcdiscover-gui/about-dialog.cc"
},
{
  "directory": "/home/ruess/code/rcdiscover/build/tools",
  "command": "/usr/bin/c++  -DPACKAGE_VERSION=\\\"0.7.0+6+g49ee04a\\\" -DPACKAGE_VERSION_MAJOR=0 -DPACKAGE_VERSION_MINOR=7 -DPACKAGE_VERSION_PATCH=0 -DPROJECT_VERSION=\\\"0.7.0\\\" -DPROJECT_VERSION_INT=700 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/home/ruess/code/rcdiscover -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0   -pthread -O3 -DNDEBUG   -Wall -std=c++11 -funroll-loops -o CMakeFiles/rcdiscover-gui.dir/rcdiscover-gui/resources.cc.o -c /home/ruess/code/rcdiscover/tools/rcdiscover-gui/resources.cc",
  "file": "/home/ruess/code/rcdiscover/tools/rcdiscover-gui/resources.cc"
}
]

Log output of C/C++ on info level:

IntelliSense Engine = Default.
Autocomplete is enabled.
Error squiggles are enabled.
File exclude: **/.git
File exclude: **/.svn
File exclude: **/.hg
File exclude: **/CVS
File exclude: **/.DS_Store
File exclude: **/.vscode
Search exclude: **/node_modules
Search exclude: **/bower_components
Search exclude: **/.vscode
Code browsing service initialized
  Folder: /usr/lib/gcc/x86_64-linux-gnu/4.8/include/ will be indexed
  Folder: /usr/local/include/ will be indexed
  Folder: /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/ will be indexed
  Folder: /usr/include/ will be indexed
  Folder: /home/ruess/code/rcdiscover/ will be indexed
Discovering files...
Checking for syntax errors: file:///home/ruess/code/rcdiscover/tools/rcdiscover.cc
  Processing folder (recursive): /usr/lib/gcc/x86_64-linux-gnu/4.8/include/
  Processing folder (recursive): /usr/local/include/
  Processing folder (recursive): /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/
  Processing folder (recursive): /usr/include/
Checking for syntax errors: file:///home/ruess/code/rcdiscover/build/CMakeFiles/3.11.0/CompilerIdC/CMakeCCompilerId.c
Checking for syntax errors: file:///home/ruess/code/rcdiscover/build/CMakeFiles/3.11.0/CompilerIdCXX/CMakeCXXCompilerId.cpp
Checking for syntax errors: file:///home/ruess/code/rcdiscover/tools/rcdiscover-gui/discover-thread.h
  Processing folder (recursive): /home/ruess/code/rcdiscover/
  Discovering files: 35761 file(s) processed
  1 file(s) removed from database
Unable to determine real path of /home/ruess/code/rcdiscover/build/.cmserver.9417. Error = 2
Done discovering files.
Parsing open files...
Parsing remaining files...
  Parsing: 0 files(s) processed
Done parsing remaining files.
Done parsing open files.
@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Apr 3, 2018

The message about a file not being found in your compile commands is "by design" -- however, I think we should change it to be a warning and not an error (should be fixed in our next release, #1783).

So far I'm not able to repro any problem with your project. My settings seem to match what you're using.

What file is causing IntelliSense to get stuck?

@flixr
Copy link
Author

flixr commented Apr 4, 2018

The message about a file not being found in your compile commands is "by design" -- however, I think we should change it to be a warning and not an error (should be fixed in our next release, #1783).

Ah, ok. Yeah, changing it to a warning or even info with a note that this is deliberately ignored would be nice.

So far I'm not able to repro any problem with your project. My settings seem to match what you're using.

What file is causing IntelliSense to get stuck?

No idea. I'm having this problem with a lot of projects... I just thought I'd pick a rather simple and public one for demonstration.

I had the engine switched to TagParser in the meantime (which worked), going back to Default I now don't see the red flame anymore. But e.g. putting the cursor over a variable I just see "Loading.." and F12 also doesn't work (blue progress indicator at the top only).

Anything I can/should do to collect more info?

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Apr 4, 2018

"Loading..." means our main process is stuck for some reason (F12 not working means the same thing). The usual culprit is the red flame, but if that's not there, then it's something else. On Linux, you can attach a debugger (i.e. using VS Code, launch.json, gdb attach config, setting the "program" to be /home/<user>/.vscode/extensions/ms-vscode-cpptools-<version>/bin/Microsoft.VSCode.CPP.Extension.linux) and see the call stacks that has work that is stuck (you can ignore the threads that don't have work, i.e. short call stacks involving the message_deque or WaitForMultipleEvents).

Of if you let me know the exact file and variable that repros this I can try that. I know 0.16.0 had a deadlock caused by logging that got fixed with 0.16.1, but this sounds like a different/new one.

@flixr
Copy link
Author

flixr commented Apr 5, 2018

It seems to happen with every file/variable, e.g. discover.cc variable req_nums_.
Since it seems to be working for you and I have the same problem with basically every project, I rather guess that it might be due to some file in my include path or something like that.

Two callstacks that might be interesting:

libc.so.6!read() (/build/eglibc-ripdx6/eglibc-2.19/sysdeps/unix/syscall-template.S:81)
libc.so.6!_IO_new_file_underflow(_IO_FILE * fp) (/build/eglibc-ripdx6/eglibc-2.19/libio/fileops.c:613)
libc.so.6!__GI__IO_default_uflow(_IO_FILE * fp) (/build/eglibc-ripdx6/eglibc-2.19/libio/genops.c:435)
libc.so.6!_IO_getc(FILE * fp) (/build/eglibc-ripdx6/eglibc-2.19/libio/getc.c:39)
std::__1::__stdinbuf<char>::__getchar(bool) (Unknown Source:0)
std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::getline<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, char) (Unknown Source:0)
vscode::message_handler::main_loop() (Unknown Source:0)
main (Unknown Source:0)
libpthread.so.0!read() (/build/eglibc-ripdx6/eglibc-2.19/sysdeps/unix/syscall-template.S:81)
async_pipe_nix::read_sync_impl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (Unknown Source:0)
async_pipe::read_sync(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (Unknown Source:0)
bool comm_client::send_request<microsoft::cpp::intellisense::ContainsFileRequest, microsoft::cpp::intellisense::ContainsFileResponse>(microsoft::cpp::intellisense::ContainsFileRequest&, microsoft::cpp::intellisense::ContainsFileResponse&) (Unknown Source:0)
intellisense_client::contains_source(char const*) (Unknown Source:0)
add_new(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<intellisense_client>) (Unknown Source:0)
create_async_work(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*, int, std::__1::shared_ptr<browse_engine>, std::__1::shared_ptr<compilation_args_provider>, IntelliSenseMode, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<std::__1::shared_ptr<intellisense_client>, std::__1::allocator<std::__1::shared_ptr<intellisense_client> > >)>, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)>) (Unknown Source:0)
std::__1::__function::__func<intellisense_client_factory::create_async(char const*, char const*, char const*, int, std::__1::shared_ptr<browse_engine>, std::__1::shared_ptr<compilation_args_provider>, IntelliSenseMode, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::shared_ptr<intellisense_client>, std::__1::allocator<std::__1::shared_ptr<intellisense_client> > >)>, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)>)::$_0, std::__1::allocator<intellisense_client_factory::create_async(char const*, char const*, char const*, int, std::__1::shared_ptr<browse_engine>, std::__1::shared_ptr<compilation_args_provider>, IntelliSenseMode, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::shared_ptr<intellisense_client>, std::__1::allocator<std::__1::shared_ptr<intellisense_client> > >)>, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)>)::$_0>, void ()>::operator()() (Unknown Source:0)
std::__1::__function::__func<microsoft::vc::thread_pool::enqueue(std::__1::function<void ()>, std::__1::future<void>*)::$_1, std::__1::allocator<microsoft::vc::thread_pool::enqueue(std::__1::function<void ()>, std::__1::future<void>*)::$_1>, void ()>::operator()() (Unknown Source:0)
void* std::__1::__thread_proxy<std::__1::tuple<microsoft::vc::thread_pool::thread_pool(int)::$_0> >(void*) (Unknown Source:0)
libpthread.so.0!start_thread(void * arg) (/build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_create.c:312)
libc.so.6!clone() (/build/eglibc-ripdx6/eglibc-2.19/sysdeps/unix/sysv/linux/x86_64/clone.S:111)

the others basically wait on conditions/wait for events.

@flixr
Copy link
Author

flixr commented Apr 5, 2018

Some other callstacks, just in case...

libpthread.so.0!__lll_lock_wait() (/build/eglibc-ripdx6/eglibc-2.19/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135)
libpthread.so.0!_L_lock_952 (Unknown Source:0)
libpthread.so.0!__GI___pthread_mutex_lock(pthread_mutex_t * mutex) (/build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_mutex_lock.c:114)
std::__1::recursive_mutex::lock() (Unknown Source:0)
intellisense_client_factory::try_to_fetch(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (Unknown Source:0)
intellisense_client_factory::create_async(char const*, char const*, char const*, int, std::__1::shared_ptr<browse_engine>, std::__1::shared_ptr<compilation_args_provider>, IntelliSenseMode, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::shared_ptr<intellisense_client>, std::__1::allocator<std::__1::shared_ptr<intellisense_client> > >)>, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)>) (Unknown Source:0)
intellisense_client_factory::handle_document_load(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, char const*, char const*, std::__1::shared_ptr<browse_engine>, std::__1::shared_ptr<compilation_args_provider>, IntelliSenseMode, std::__1::function<void ()>) (Unknown Source:0)
vscode::message_handler::textDocument_didOpen(vscode::DidOpenTextDocumentParams) (Unknown Source:0)
vscode::message_handler::dispatch(vscode::vscode_client_message&&, vscode::vscode_server_message&) (Unknown Source:0)
vscode::message_handler::handle_message(vscode::vscode_client_message&&) (Unknown Source:0)
void* std::__1::__thread_proxy<std::__1::tuple<vscode::message_handler::main_loop()::$_24> >(void*) (Unknown Source:0)
libpthread.so.0!start_thread(void * arg) (/build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_create.c:312)
libc.so.6!clone() (/build/eglibc-ripdx6/eglibc-2.19/sysdeps/unix/sysv/linux/x86_64/clone.S:111)
libpthread.so.0!__lll_lock_wait() (/build/eglibc-ripdx6/eglibc-2.19/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135)
libpthread.so.0!_L_lock_952 (Unknown Source:0)
libpthread.so.0!__GI___pthread_mutex_lock(pthread_mutex_t * mutex) (/build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_mutex_lock.c:114)
std::__1::recursive_mutex::lock() (Unknown Source:0)
create_async_work(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*, int, std::__1::shared_ptr<browse_engine>, std::__1::shared_ptr<compilation_args_provider>, IntelliSenseMode, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<std::__1::shared_ptr<intellisense_client>, std::__1::allocator<std::__1::shared_ptr<intellisense_client> > >)>, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)>) (Unknown Source:0)
std::__1::__function::__func<intellisense_client_factory::create_async(char const*, char const*, char const*, int, std::__1::shared_ptr<browse_engine>, std::__1::shared_ptr<compilation_args_provider>, IntelliSenseMode, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::shared_ptr<intellisense_client>, std::__1::allocator<std::__1::shared_ptr<intellisense_client> > >)>, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)>)::$_0, std::__1::allocator<intellisense_client_factory::create_async(char const*, char const*, char const*, int, std::__1::shared_ptr<browse_engine>, std::__1::shared_ptr<compilation_args_provider>, IntelliSenseMode, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::shared_ptr<intellisense_client>, std::__1::allocator<std::__1::shared_ptr<intellisense_client> > >)>, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)>)::$_0>, void ()>::operator()() (Unknown Source:0)
std::__1::__function::__func<microsoft::vc::thread_pool::enqueue(std::__1::function<void ()>, std::__1::future<void>*)::$_1, std::__1::allocator<microsoft::vc::thread_pool::enqueue(std::__1::function<void ()>, std::__1::future<void>*)::$_1>, void ()>::operator()() (Unknown Source:0)
void* std::__1::__thread_proxy<std::__1::tuple<microsoft::vc::thread_pool::thread_pool(int)::$_0> >(void*) (Unknown Source:0)
libpthread.so.0!start_thread(void * arg) (/build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_create.c:312)
libc.so.6!clone() (/build/eglibc-ripdx6/eglibc-2.19/sysdeps/unix/sysv/linux/x86_64/clone.S:111)

and two with:

libpthread.so.0!__lll_lock_wait() (/build/eglibc-ripdx6/eglibc-2.19/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135)
libpthread.so.0!_L_lock_952 (Unknown Source:0)
libpthread.so.0!__GI___pthread_mutex_lock(pthread_mutex_t * mutex) (/build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_mutex_lock.c:114)
std::__1::recursive_mutex::lock() (Unknown Source:0)
std::__1::__function::__func<intellisense_client_factory::handle_document_load(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, char const*, char const*, std::__1::shared_ptr<browse_engine>, std::__1::shared_ptr<compilation_args_provider>, IntelliSenseMode, std::__1::function<void ()>)::$_2, std::__1::allocator<intellisense_client_factory::handle_document_load(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, char const*, char const*, std::__1::shared_ptr<browse_engine>, std::__1::shared_ptr<compilation_args_provider>, IntelliSenseMode, std::__1::function<void ()>)::$_2>, void ()>::operator()() (Unknown Source:0)
std::__1::__function::__func<microsoft::vc::thread_pool::enqueue(std::__1::function<void ()>, std::__1::future<void>*)::$_1, std::__1::allocator<microsoft::vc::thread_pool::enqueue(std::__1::function<void ()>, std::__1::future<void>*)::$_1>, void ()>::operator()() (Unknown Source:0)
void* std::__1::__thread_proxy<std::__1::tuple<microsoft::vc::thread_pool::thread_pool(int)::$_0> >(void*) (Unknown Source:0)
libpthread.so.0!start_thread(void * arg) (/build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_create.c:312)
libc.so.6!clone() (/build/eglibc-ripdx6/eglibc-2.19/sysdeps/unix/sysv/linux/x86_64/clone.S:111)

@flixr
Copy link
Author

flixr commented Apr 5, 2018

Update:
It might be a problem with the database or something like that...
I stopped vscdoe, removed ~/.config/Code/User/workspaceStorage completely, killed the stale processes and restarted vscode. That seemed to work (no "Loading..." after red flame was out and database update finished) and closing vscode also left no stale processes anymore.

But starting it again (so with a new/existing database), I have the same problem again...

@bobbrow
Copy link
Member

bobbrow commented Apr 9, 2018

Based on the callstacks this doesn't look like a database problem. This looks like either a deadlock in the IntelliSense client lookup/creation, or the IntelliSense server is hung and not responding to messages from the extension.

@sean-mcmanus
Copy link
Contributor

The threads are blocked on the IntelliSense operation "contains_source". It looks like Microsoft.VSCode.CPP.IntelliSense.Msvc.linux is stuck -- if you could attach a debugger and report any suspicious stuck threads that could help. The includePath setting is ignored when compile commands is used, so the only difference would be the /usr/bin/c++ which is queried for compiler includes/defines -- what version of clang/gcc does that point to for you?

Also, if you temporarily set the loggingLevel to the hidden value of "6", you would want to verify that no errors are occuring and the correct compiler includes/defines are output after "sending compilation args" in the C/C++ section in the Output panel.

@flixr
Copy link
Author

flixr commented Apr 17, 2018

The threads are blocked on the IntelliSense operation "contains_source". It looks like Microsoft.VSCode.CPP.IntelliSense.Msvc.linux is stuck -- if you could attach a debugger and report any suspicious stuck threads that could help.

So there are three of these processes running, one looks suspicious:

open64() (/build/eglibc-ripdx6/eglibc-2.19/sysdeps/unix/syscall-template.S:81)
async_pipe_nix::read_sync_impl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (Unknown Source:0)
async_pipe::read_sync(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (Unknown Source:0)
bool comm_client::send_request<microsoft::cpp::intellisense::GetSourceRequest, microsoft::cpp::intellisense::GetSourceResponse>(microsoft::cpp::intellisense::GetSourceRequest&, microsoft::cpp::intellisense::GetSourceResponse&) (Unknown Source:0)
edge_intellisense_server_impl::edge_intellisense_server_impl(char const*, char const*, char const*, char const*)::{lambda(char const*)#1}::operator()(char const*) const (Unknown Source:0)
std::__1::__function::__func<edge_intellisense_server_impl::edge_intellisense_server_impl(char const*, char const*, char const*, char const*)::{lambda(char const*)#1}, std::__1::allocator<{lambda(char const*)#1}>, std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, edge_intellisense_server_impl::edge_intellisense_server_impl(char const*, char const*, char const*, char const*)::{lambda(char const*)#1}<char> >, int, int> (char const*)>::operator()(char const*&&) (Unknown Source:0)
edge_host::find_or_create_file_buffer(wchar_t const*, edge::snapshot_session const*, edge::buffer_kind) (Unknown Source:0)
edge::file_buffer::open(char const*, edge::snapshot_session const*, edge::buffer_kind, a_canonicalized_file_name*) (Unknown Source:0)
a_file_buffer::a_file_buffer(char const*, a_canonicalized_file_name*, edge::buffer_kind) (Unknown Source:0)
a_file_buffer_stream::a_file_buffer_stream(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) (Unknown Source:0)
open_input_stream (Unknown Source:0)
open_input_stream_with_result (Unknown Source:0)
open_source_file (Unknown Source:0)
open_source_file_with_error_handling (Unknown Source:0)
search_for_input_file (Unknown Source:0)
open_file_for_input_full (Unknown Source:0)
open_file_and_push_input_stack (Unknown Source:0)
open_primary_source_file (Unknown Source:0)
fe_init_part_2 (Unknown Source:0)
process_translation_unit (Unknown Source:0)
edg_main (Unknown Source:0)
edge_compiler_main(int, char const**) (Unknown Source:0)
pre_parse(int, char const**, a_scout_parser_interface&, edge::translation_unit*) (Unknown Source:0)
a_compiler_thread::compiler_thread_routine(a_compiler_thread*) (Unknown Source:0)
void* std::__1::__thread_proxy<std::__1::tuple<void (*)(a_compiler_thread*), a_compiler_thread*> >(void*) (Unknown Source:0)
start_thread(void * arg) (/build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_create.c:312)
clone() (/build/eglibc-ripdx6/eglibc-2.19/sysdeps/unix/sysv/linux/x86_64/clone.S:111)
pthread_cond_wait@@GLIBC_2.3.2() (/build/eglibc-ripdx6/eglibc-2.19/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185)
std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) (Unknown Source:0)
a_compiler_thread::start(edge::query_action_data&) (Unknown Source:0)
edge::an_edge_translation_unit_impl::reinitialize_without_fallback(bool, edge::snapshot_session const*, edge::file_position const&, edge::query_action_data&) (Unknown Source:0)
edge::translation_unit::initialize(int, char const**, char const*, char const*, bool, char const*, edge::snapshot_session const*, edge::query_action_data&) (Unknown Source:0)
edge_intellisense_server_impl::create_translation_unit() (Unknown Source:0)
edge_intellisense_server_impl::handle_contains(microsoft::cpp::intellisense::ContainsFileRequest const&) (Unknown Source:0)
work_queue::worker_proc() (Unknown Source:0)
std::__1::__function::__func<microsoft::vc::thread_pool::enqueue(std::__1::function<void ()>, std::__1::future<void>*)::$_1, std::__1::allocator<microsoft::vc::thread_pool::enqueue(std::__1::function<void ()>, std::__1::future<void>*)::$_1>, void ()>::operator()() (Unknown Source:0)
void* std::__1::__thread_proxy<std::__1::tuple<microsoft::vc::thread_pool::thread_pool(int)::$_0> >(void*) (Unknown Source:0)
start_thread(void * arg) (/build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_create.c:312)
clone() (/build/eglibc-ripdx6/eglibc-2.19/sysdeps/unix/sysv/linux/x86_64/clone.S:111)

and all three processes seem to wait for that:

libpthread.so.0!pthread_cond_wait@@GLIBC_2.3.2() (/build/eglibc-ripdx6/eglibc-2.19/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185)
std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) (Unknown Source:0)
a_compiler_thread::at_end_of_scout_parse(void*) (Unknown Source:0)
end_of_parse_notification (Unknown Source:0)
process_translation_unit (Unknown Source:0)
edg_main (Unknown Source:0)
edge_compiler_main(int, char const**) (Unknown Source:0)
pre_parse(int, char const**, a_scout_parser_interface&, edge::translation_unit*) (Unknown Source:0)
a_compiler_thread::compiler_thread_routine(a_compiler_thread*) (Unknown Source:0)
void* std::__1::__thread_proxy<std::__1::tuple<void (*)(a_compiler_thread*), a_compiler_thread*> >(void*) (Unknown Source:0)
libpthread.so.0!start_thread(void * arg) (/build/eglibc-ripdx6/eglibc-2.19/nptl/pthread_create.c:312)
libc.so.6!clone() (/build/eglibc-ripdx6/eglibc-2.19/sysdeps/unix/sysv/linux/x86_64/clone.S:111)

The includePath setting is ignored when compile commands is used,

Don't think so, because of the already mentioned

"CMakeCXXCompilerId.cpp" not found in "/home/ruess/code/rcdiscover/build/compile_commands.json". Using 'includePath' setting in c_cpp_properties.json.

so the only difference would be the /usr/bin/c++ which is queried for compiler includes/defines -- what version of clang/gcc does that point to for you?

I have c++ (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5

Also, if you temporarily set the loggingLevel to the hidden value of "6", you would want to verify that no errors are occuring and the correct compiler includes/defines are output after "sending compilation args" in the C/C++ section in the Output panel.

That looks ok to me:
cpptools.log

@sean-mcmanus
Copy link
Contributor

@flixr Thanks a lot for those call stacks -- those look promising. It appears both processes are deadlocked on each other.

  1. The main process is blocked asking an IntelliSense client if contains a source file.
  2. The IntelliSense client that is handling that request is blocked trying to get the source from the main process.
    I think we have enough information to make process on this. I'll let you know if still need more info...

@sean-mcmanus sean-mcmanus added bug reliability and removed more info needed The issue report is not actionable in its current state labels Apr 21, 2018
@sean-mcmanus sean-mcmanus added this to the April 2018 milestone Apr 21, 2018
@sean-mcmanus sean-mcmanus added the more info needed The issue report is not actionable in its current state label Apr 23, 2018
@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Apr 23, 2018

Actually, looks like we need more info still. We're not able to determine why the main process is not able to handle the IntelliSense processes source file request given the call stacks provided for the main process. Is the main process blocked on "handle_get_source"? This appears to be the same freeze as described in #1407 , which we were never able to figure out a cause. If handle_get_source or a thread with the comm_server isn't in the main process, then the thread could be exiting for some reason. Maybe we'll need to add some timeout.

@flixr
Copy link
Author

flixr commented Apr 23, 2018

Which "main process" do you mean?

Attached the backtraces off all cpptools processes.
cpptools_bt.txt

@sean-mcmanus
Copy link
Contributor

Yeah, those are the call stacks for the main process (Microsoft.VSCode.CPP.Extension.linux) -- the comm_server is waiting for requests, but the call stack for the IntelliSense process shows that it has already sent the request and is blocked waiting for the reply. This is exactly what I saw on Windows with the dmp provided in #1407. It's as if the request was just lost somehow. I'll have to brainstorm with @bobbrow on how to deal with this. I think our previous conclusion was we needed a repro.

@sean-mcmanus sean-mcmanus modified the milestones: April 2018, May 2018 Apr 25, 2018
@sean-mcmanus
Copy link
Contributor

@flixr We finally figured out the cause of all the deadlocks in which the intellisense process is stuck sending a GetSourceRequest (and potentially other deadlocks). We're in the process of figuring out a fix for 0.17.1.

@sean-mcmanus sean-mcmanus removed the more info needed The issue report is not actionable in its current state label May 16, 2018
@sean-mcmanus sean-mcmanus removed this from the May 2018 milestone May 16, 2018
@sean-mcmanus sean-mcmanus added this to the 0.17.1 milestone May 16, 2018
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label May 17, 2018
@sean-mcmanus
Copy link
Contributor

This deadlock issue should be fixed now with 0.17.1.

@flixr
Copy link
Author

flixr commented Jun 14, 2018

With 0.17.4 I still get

"CMakeCXXCompilerId.cpp" not found in "${workspaceFolder}/build/compile_commands.json". Using 'includePath' setting in c_cpp_properties.json.

@sean-mcmanus
Copy link
Contributor

Yeah, that's "by design", we changed it to a warning and fixed the deadlocks.

@flixr
Copy link
Author

flixr commented Jun 14, 2018

So this really means that compile_commands.json is ignored and it reverts to the 'includePath' setting?
That would be a real shame, as compile_commands.json and CMakeCXXCompilerId.cpp is something automatically generated by cmake...

If compile_commands is actually still used, then the warning not say that it reverts to 'includePath' setting.

@bobbrow
Copy link
Member

bobbrow commented Jun 14, 2018

We only ignore compile_commands.json for the individual files you open that don't exist in the json database. We will use compile_commands.json for all of the other files that are present.

@bobbrow
Copy link
Member

bobbrow commented Jun 14, 2018

Perhaps we can clarify the message to say that we are using includePath just for the translation unit in question.

@flixr
Copy link
Author

flixr commented Jun 14, 2018 via email

@kevinuav
Copy link

Hi,all!
I use vscode to edit the px4's code with OSX.It works very well before.But these days it can't "go to definition"suddenly.And it can't find the definition of the functions.
Besides,the issue comes with tons of problems, such as"identifier XXX is undefined","variable XXX is not a type name".Curiously,the code can be compiled successfully!

Meanwhile,it responds with
"FixedwingPositionControl.cpp not found in "${workspaceFolder}/build/px4io-v2_default/compile_commands.json". 'includePath' from c_cpp_properties.json will be used for this file instead."

If the compile_commands.json have something to do with the issue?

To fix the issue,I have tried tons of methods.However,It still doesn't work even after that I completely remove and reinstall all of the vscode and all of the px4's code.what is the problem about the vscode?And how could I fix it? Thank you?

To fix the issue,I have tried tons of methods.However,It still doesn't work even after that I completely remove and reinstall all of the vscode and all of the git's code.what is the problem about the vscode?And how could I fix it? Thank you?

@sean-mcmanus
Copy link
Contributor

@kevinuav I moved your issue to #3040 .

@nurp
Copy link

nurp commented Oct 24, 2019

I keep seeing these warning popping up one above another and it is so distracting.
I have a very big project open (android source code) but not all projects have Makelist.txt so compile_commands is not generated for a certain project. I didn't have these errors before.
Would be great to have a way to ignore it and never see again.

@sean-mcmanus
Copy link
Contributor

@nurp You didn't have these errors before what? We haven't changed this behavior in a long time. One potential workaround is to multiple workspace folders. Would an option to "don't show again" be good or did you have another solution?

@nurp
Copy link

nurp commented Oct 28, 2019

@sean-mcmanus , there is no "don't show again" option. The only option is "manage extension" and it opens the page for C/C++ ms-vscode.cpptools.
So I can't make it ignore it. But I removed the compile_commands.json from sub project folder and restarted vscode. Seems that restart was also required to get rid of the warning.

@sean-mcmanus
Copy link
Contributor

@nurp Yeah, I was suggesting we could add a "don't show again" option to the notification.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2020
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
None yet
Development

No branches or pull requests

5 participants