Description
(I already posted this in another bug, but was kindly asked to file it differently. I hope this is good; it's my first report re. vscode.)
Ubuntu 14.04. VSCode 1.17.1. C++ extension 0.13.1. Disabling other extensions doesn't seem to affect problem.
I work with a source tree of around 1500 files of mixed C/C++.
Problem: ~/.vscode/extensions/ms-vscode.cpptools-0.13.1/bin/Microsoft.VSCode.CPP.IntelliSense.Msvc.linux runs at 100% continuously, and IntelliSense barely works.
I've now resorted to a small script that'll kill all such processes. Then it'll run and IntelliSense will be usable for a few minutes, and then we're back at 100%
I finally got annoyed enough to attach gdb to the offending thread and got this trace; maybe it inspires some ideas. It smells like endless looping, perhaps due to wrong error handling in file I/O. I've frequently seen code that doesn't get error handling entirely right when, for example, a file disappears under its feet and where it just keeps looping, trying to read from a file that no longer provides data. Particularly with sub-processes.
In my usecase I compile frequently, and part of our build process generates new C++ files that are then compiled into the final images. I wouldn't be surprised if VSCode got surprised about this "flapping" of files.
All the other threads sit seemingly idle in futex waits. Some of them probably waiting for this one.
#0 0x000000000073b3f9 in source_file_for_seq ()
#1 0x000000000089982d in an_error_ptr_cmp::operator()(an_error* const&, an_error* const&) const ()
#2 0x000000000089ae52 in an_error_manager::get_errors(std::__1::vector<an_error*, std::__1::allocator<an_error*> >&) ()
#3 0x000000000053c6bd in edge::scoped_query_manager::get_filtered_errors_for_tu(edge::list<edge::error*>*, bool (*)(edge::error const&)) ()
#4 0x000000000054484d in edge::an_edge_translation_unit_impl::get_filtered_errors_for_tu(edge::allocator*, edge::snapshot_session const*, bool (*)(edge::error const&), edge::isense_error_array*) ()
#5 0x000000000050c2f0 in edge_intellisense_server_impl::handle_get_errors(microsoft::cpp::intellisense::GetErrorsRequest const&) ()
#6 0x0000000000530c0d in work_queue::worker_proc() ()
#7 0x000000000052d323 in std::__1::__function::__func<microsoft::vc::thread_pool::enqueue(std::__1::function<void ()>, std::__1::future<void>*)::{lambda()#1}, std::__1::allocator<{lambda()#1}>, void ()>::operator()() ()
#8 0x00000000008bddbd in microsoft::vc::thread_pool::thread_pool(int)::{lambda()#1}::operator()() const ()
#9 0x00000000008bdbad in void* std::__1::__thread_proxy<std::__1::tuple<microsoft::vc::thread_pool::thread_pool(int)::{lambda()#1}> >(std::__1::tuple<microsoft::vc::thread_pool::thread_pool(int)::{lambda()#1}>) ()
#10 0x00007f058bdcc184 in start_thread (arg=0x7f0583fff700) at pthread_create.c:312
#11 0x00007f058baf1ffd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111