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

stuck at "Building CrateGraph" in rust-lang/rust repo #16902

Closed
lukas-code opened this issue Mar 20, 2024 · 7 comments · Fixed by #16911
Closed

stuck at "Building CrateGraph" in rust-lang/rust repo #16902

lukas-code opened this issue Mar 20, 2024 · 7 comments · Fixed by #16911
Assignees
Labels
Broken Window Bugs / technical debt to be addressed immediately

Comments

@lukas-code
Copy link
Member

lukas-code commented Mar 20, 2024

I'm trying to use the latest pre-release of RA in the https://github.com/rust-lang/rust repo, but it gets stuck at "Building CrateGraph". Autocomplete and go to definition are not working.

It also seems to build up infinite memory usage if you leave it running in the background.

image

How to reproduce

git clone https://github.com/rust-lang/rust --depth=1
cd rust
./x setup compiler
./x setup vscode # say yes to prompt
./x c # to fetch submodules
code .
# try to use any RA feature

Meta

version with regression: rust-analyzer version: 0.4.1888-standalone (6fce1d71d 2024-03-19)

last working version: rust-analyzer version: 0.4.1887-standalone (b91697de8 2024-03-19)

host platform: x86_64-unknown-linux-gnu

@lukas-code lukas-code added the Broken Window Bugs / technical debt to be addressed immediately label Mar 20, 2024
@lukas-code
Copy link
Member Author

Looking at b91697d...6fce1d7, it's probably caused by #16892.

@Veykril
Copy link
Member

Veykril commented Mar 21, 2024

Can you check if the latest release still runs into this?

@Veykril
Copy link
Member

Veykril commented Mar 21, 2024

weird that it gets stuck at that status message though, unless something inbetween there panicked causing us to not send the progress end 🤔

@lukas-code
Copy link
Member Author

It's not fixed in rust-analyzer version: 0.4.1889-standalone (5e276ae51 2024-03-20).

Considering that nobody else has complained about this so far, it might be something specific to my system. Let me know if I can do anything to help debug this.

Here is a backtrace if that helps:

full backtrace
Thread 10 (Thread 0x7297eea006c0 (LWP 6616) "Worker"):
#0  0x00007297f6c7d88d in syscall () from /usr/lib/libc.so.6
#1  0x00005b6b119b9fe4 in std::sys::unix::futex::futex_wait () at library/std/src/sys/unix/futex.rs:62
#2  std::sys_common::thread_parking::futex::Parker::park () at library/std/src/sys_common/thread_parking/futex.rs:52
#3  std::thread::park () at library/std/src/thread/mod.rs:1066
#4  0x00005b6b119e4415 in crossbeam_channel::flavors::list::Channel<T>::recv::{{closure}} ()
#5  0x00005b6b119e3bbc in crossbeam_channel::flavors::list::Channel<T>::recv ()
#6  0x00005b6b119e7cc2 in <crossbeam_channel::channel::IntoIter<T> as core::iter::traits::iterator::Iterator>::next ()
#7  0x00005b6b119ec995 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#8  0x00005b6b119ed4e9 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#9  0x00005b6b119cfa35 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#10 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#11 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#12 0x00007297f6c0255a in ?? () from /usr/lib/libc.so.6
#13 0x00007297f6c7fa3c in ?? () from /usr/lib/libc.so.6

Thread 9 (Thread 0x7297ef4006c0 (LWP 6615) "Worker"):
#0  0x00007297f6c7d88d in syscall () from /usr/lib/libc.so.6
#1  0x00005b6b119b9fe4 in std::sys::unix::futex::futex_wait () at library/std/src/sys/unix/futex.rs:62
#2  std::sys_common::thread_parking::futex::Parker::park () at library/std/src/sys_common/thread_parking/futex.rs:52
#3  std::thread::park () at library/std/src/thread/mod.rs:1066
#4  0x00005b6b119e4415 in crossbeam_channel::flavors::list::Channel<T>::recv::{{closure}} ()
#5  0x00005b6b119e3bbc in crossbeam_channel::flavors::list::Channel<T>::recv ()
#6  0x00005b6b119e7cc2 in <crossbeam_channel::channel::IntoIter<T> as core::iter::traits::iterator::Iterator>::next ()
#7  0x00005b6b119ec995 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#8  0x00005b6b119ed4e9 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#9  0x00005b6b119cfa35 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()--Type <RET> for more, q to quit, c to continue without paging--c
>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#10 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#11 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#12 0x00007297f6c0255a in ?? () from /usr/lib/libc.so.6
#13 0x00007297f6c7fa3c in ?? () from /usr/lib/libc.so.6

Thread 8 (Thread 0x7297efe006c0 (LWP 6614) "Worker"):
#0  0x00007297f6c7d88d in syscall () from /usr/lib/libc.so.6
#1  0x00005b6b119b9fe4 in std::sys::unix::futex::futex_wait () at library/std/src/sys/unix/futex.rs:62
#2  std::sys_common::thread_parking::futex::Parker::park () at library/std/src/sys_common/thread_parking/futex.rs:52
#3  std::thread::park () at library/std/src/thread/mod.rs:1066
#4  0x00005b6b119e4415 in crossbeam_channel::flavors::list::Channel<T>::recv::{{closure}} ()
#5  0x00005b6b119e3bbc in crossbeam_channel::flavors::list::Channel<T>::recv ()
#6  0x00005b6b119e7cc2 in <crossbeam_channel::channel::IntoIter<T> as core::iter::traits::iterator::Iterator>::next ()
#7  0x00005b6b119ec995 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#8  0x00005b6b119ed4e9 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#9  0x00005b6b119cfa35 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#10 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#11 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#12 0x00007297f6c0255a in ?? () from /usr/lib/libc.so.6
#13 0x00007297f6c7fa3c in ?? () from /usr/lib/libc.so.6

Thread 7 (Thread 0x7297f4a006c0 (LWP 6613) "Worker"):
#0  0x00007297f6c7d88d in syscall () from /usr/lib/libc.so.6
#1  0x00005b6b119b9fe4 in std::sys::unix::futex::futex_wait () at library/std/src/sys/unix/futex.rs:62
#2  std::sys_common::thread_parking::futex::Parker::park () at library/std/src/sys_common/thread_parking/futex.rs:52
#3  std::thread::park () at library/std/src/thread/mod.rs:1066
#4  0x00005b6b119e4415 in crossbeam_channel::flavors::list::Channel<T>::recv::{{closure}} ()
#5  0x00005b6b119e3bbc in crossbeam_channel::flavors::list::Channel<T>::recv ()
#6  0x00005b6b119e7cc2 in <crossbeam_channel::channel::IntoIter<T> as core::iter::traits::iterator::Iterator>::next ()
#7  0x00005b6b119ec995 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#8  0x00005b6b119ed4e9 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#9  0x00005b6b119cfa35 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#10 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#11 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#12 0x00007297f6c0255a in ?? () from /usr/lib/libc.so.6
#13 0x00007297f6c7fa3c in ?? () from /usr/lib/libc.so.6

Thread 6 (Thread 0x7297f54006c0 (LWP 6612) "Worker"):
#0  0x00007297f6c7d88d in syscall () from /usr/lib/libc.so.6
#1  0x00005b6b119b9fe4 in std::sys::unix::futex::futex_wait () at library/std/src/sys/unix/futex.rs:62
#2  std::sys_common::thread_parking::futex::Parker::park () at library/std/src/sys_common/thread_parking/futex.rs:52
#3  std::thread::park () at library/std/src/thread/mod.rs:1066
#4  0x00005b6b119e4415 in crossbeam_channel::flavors::list::Channel<T>::recv::{{closure}} ()
#5  0x00005b6b119e3bbc in crossbeam_channel::flavors::list::Channel<T>::recv ()
#6  0x00005b6b119e7cc2 in <crossbeam_channel::channel::IntoIter<T> as core::iter::traits::iterator::Iterator>::next ()
#7  0x00005b6b119ec995 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#8  0x00005b6b119ed4e9 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#9  0x00005b6b119cfa35 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#10 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#11 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#12 0x00007297f6c0255a in ?? () from /usr/lib/libc.so.6
#13 0x00007297f6c7fa3c in ?? () from /usr/lib/libc.so.6

Thread 5 (Thread 0x7297f58006c0 (LWP 6611) "VfsLoader"):
#0  0x00007297f6c7d88d in syscall () from /usr/lib/libc.so.6
#1  0x00005b6b119b9fe4 in std::sys::unix::futex::futex_wait () at library/std/src/sys/unix/futex.rs:62
#2  std::sys_common::thread_parking::futex::Parker::park () at library/std/src/sys_common/thread_parking/futex.rs:52
#3  std::thread::park () at library/std/src/thread/mod.rs:1066
#4  0x00005b6b104f5f64 in crossbeam_channel::select::run_select::{{closure}} ()
#5  0x00005b6b104f552e in crossbeam_channel::select::run_select ()
#6  0x00005b6b11a8388c in vfs_notify::NotifyActor::run ()
#7  0x00005b6b11a8a50f in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#8  0x00005b6b11a896c8 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#9  0x00005b6b119cfa35 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#10 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#11 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#12 0x00007297f6c0255a in ?? () from /usr/lib/libc.so.6
#13 0x00007297f6c7fa3c in ?? () from /usr/lib/libc.so.6

Thread 4 (Thread 0x7297f5c006c0 (LWP 6606) "LspServer"):
#0  0x00007297f6c7d88d in syscall () from /usr/lib/libc.so.6
#1  0x00005b6b119b9fe4 in std::sys::unix::futex::futex_wait () at library/std/src/sys/unix/futex.rs:62
#2  std::sys_common::thread_parking::futex::Parker::park () at library/std/src/sys_common/thread_parking/futex.rs:52
#3  std::thread::park () at library/std/src/thread/mod.rs:1066
#4  0x00005b6b1142de23 in crossbeam_channel::context::Context::wait_until ()
#5  0x00005b6b1142fd9c in crossbeam_channel::flavors::zero::Channel<T>::send::{{closure}} ()
#6  0x00005b6b1142f904 in crossbeam_channel::flavors::zero::Channel<T>::send ()
#7  0x00005b6b11436fc2 in crossbeam_channel::channel::Sender<T>::send ()
#8  0x00005b6b11433260 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#9  0x00005b6b1142ba46 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#10 0x00005b6b119cfa35 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#11 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#12 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#13 0x00007297f6c0255a in ?? () from /usr/lib/libc.so.6
#14 0x00007297f6c7fa3c in ?? () from /usr/lib/libc.so.6

Thread 3 (Thread 0x7297f60006c0 (LWP 6605) "LspServer"):
#0  0x00007297f6c7d88d in syscall () from /usr/lib/libc.so.6
#1  0x00005b6b119b9fe4 in std::sys::unix::futex::futex_wait () at library/std/src/sys/unix/futex.rs:62
#2  std::sys_common::thread_parking::futex::Parker::park () at library/std/src/sys_common/thread_parking/futex.rs:52
#3  std::thread::park () at library/std/src/thread/mod.rs:1066
#4  0x00005b6b1142de23 in crossbeam_channel::context::Context::wait_until ()
#5  0x00005b6b1142ee41 in crossbeam_channel::flavors::zero::Channel<T>::recv::{{closure}} ()
#6  0x00005b6b1142e55d in crossbeam_channel::flavors::zero::Channel<T>::recv ()
#7  0x00005b6b114374c0 in crossbeam_channel::channel::Receiver<T>::recv ()
#8  0x00005b6b1143355d in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#9  0x00005b6b1142bc96 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#10 0x00005b6b119cfa35 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#11 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#12 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#13 0x00007297f6c0255a in ?? () from /usr/lib/libc.so.6
#14 0x00007297f6c7fa3c in ?? () from /usr/lib/libc.so.6

Thread 2 (Thread 0x7297f6a006c0 (LWP 6604) "LspServer"):
#0  0x00007297f6c12e6d in free () from /usr/lib/libc.so.6
#1  0x00005b6b11632f8e in hashbrown::map::HashMap<K,V,S,A>::insert ()
#2  0x00005b6b1160e294 in rust_analyzer::reload::<impl rust_analyzer::global_state::GlobalState>::recreate_crate_graph::{{closure}} ()
#3  0x00005b6b114d5ccd in project_model::workspace::cargo_to_crate_graph ()
#4  0x00005b6b114d0058 in project_model::workspace::ProjectWorkspace::to_crate_graph ()
#5  0x00005b6b1160e56a in rust_analyzer::reload::ws_to_crate_graph ()
#6  0x00005b6b116a5aaf in rust_analyzer::reload::<impl rust_analyzer::global_state::GlobalState>::recreate_crate_graph ()
#7  0x00005b6b116a4f80 in rust_analyzer::reload::<impl rust_analyzer::global_state::GlobalState>::switch_workspaces ()
#8  0x00005b6b116a02e9 in rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_task ()
#9  0x00005b6b1169a301 in rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_event ()
#10 0x00005b6b11698517 in rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run ()
#11 0x00005b6b1181d6e4 in rust_analyzer::main_loop::main_loop ()
#12 0x00005b6b1194c676 in rust_analyzer::run_server ()
#13 0x00005b6b11958406 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#14 0x00005b6b11958c0e in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#15 0x00005b6b119cfa35 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#16 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#17 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#18 0x00007297f6c0255a in ?? () from /usr/lib/libc.so.6
#19 0x00007297f6c7fa3c in ?? () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7297f6b72a00 (LWP 6603) "rust-analyzer"):
#0  0x00007297f6bfeebe in ?? () from /usr/lib/libc.so.6
#1  0x00007297f6c040e3 in ?? () from /usr/lib/libc.so.6
#2  0x00005b6b1195843b in std::thread::JoinInner<T>::join ()
#3  0x00005b6b11959cad in stdx::thread::JoinHandle<T>::join ()
#4  0x00005b6b1194ab6d in rust_analyzer::main ()
#5  0x00005b6b11958416 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#6  0x00005b6b11945932 in std::rt::lang_start::{{closure}} ()
#7  0x00005b6b119b9ad5 in core::ops::function::impls::{impl#2}::call_once<(), (dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> () at library/core/src/ops/function.rs:284
#8  std::panicking::try::do_call<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panicking.rs:552
#9  std::panicking::try<i32, &(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> () at library/std/src/panicking.rs:516
#10 std::panic::catch_unwind<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panic.rs:142
#11 std::rt::lang_start_internal::{closure#2} () at library/std/src/rt.rs:148
#12 std::panicking::try::do_call<std::rt::lang_start_internal::{closure_env#2}, isize> () at library/std/src/panicking.rs:552
#13 std::panicking::try<isize, std::rt::lang_start_internal::{closure_env#2}> () at library/std/src/panicking.rs:516
#14 std::panic::catch_unwind<std::rt::lang_start_internal::{closure_env#2}, isize> () at library/std/src/panic.rs:142
#15 std::rt::lang_start_internal () at library/std/src/rt.rs:148
#16 0x00005b6b1194d475 in main ()

where the relevant part is probably this:

#2  0x00005b6b1160e294 in rust_analyzer::reload::<impl rust_analyzer::global_state::GlobalState>::recreate_crate_graph::{{closure}} ()
#3  0x00005b6b114d5ccd in project_model::workspace::cargo_to_crate_graph ()
#4  0x00005b6b114d0058 in project_model::workspace::ProjectWorkspace::to_crate_graph ()
#5  0x00005b6b1160e56a in rust_analyzer::reload::ws_to_crate_graph ()
#6  0x00005b6b116a5aaf in rust_analyzer::reload::<impl rust_analyzer::global_state::GlobalState>::recreate_crate_graph ()
#7  0x00005b6b116a4f80 in rust_analyzer::reload::<impl rust_analyzer::global_state::GlobalState>::switch_workspaces ()
#8  0x00005b6b116a02e9 in rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_task ()
#9  0x00005b6b1169a301 in rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_event ()
#10 0x00005b6b11698517 in rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run ()

@WaffleLapkin
Copy link
Member

WaffleLapkin commented Mar 21, 2024

Considering that nobody else has complained about this so far, it might be something specific to my system. Let me know if I can do anything to help debug this.

I just had the same issue and I'm pretty sure I'm not you, so ^^'

I did not see the panics in any logs though (might have missed something?...). The only thing I noticed is being stuck building crate graph and loading metadata.

For now switched to release version as it does not have the same bug :')

@Veykril Veykril self-assigned this Mar 21, 2024
@Veykril
Copy link
Member

Veykril commented Mar 21, 2024

It is #16892, though I am unsure why

@Veykril
Copy link
Member

Veykril commented Mar 21, 2024

Ah okay found the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Broken Window Bugs / technical debt to be addressed immediately
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants