Skip to content

Instantly share code, notes, and snippets.

@estin
Last active January 22, 2020 06:19
Show Gist options
  • Save estin/393600a78a2891164aaa9db453d88e84 to your computer and use it in GitHub Desktop.
Save estin/393600a78a2891164aaa9db453d88e84 to your computer and use it in GitHub Desktop.
RA eats all system memory

Try analyze https://github.com/estin/cywad

RA version

$ git log -n 1
commit de2409702ba639f06cf340f5e3f3b7e671021d1b (HEAD -> master, tag: 2020-01-20, origin/staging, origin/release, origin/master, origin/HEAD)
Merge: 648241ee 72792f6b
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date:   Mon Jan 20 10:16:06 2020 +0000

    Merge #2877

    2877: "Insert explicit type " assist fix #2869, fix typo r=matklad a=TomasKralCZ

    So this was quite straightforward. I basically looked at how the other assists work and tried doing something simillar. I also fixed a typo in the other assist.

    Co-authored-by: TomasKralCZ <tomas@kral.hk>

Environment

$ rustc -V
rustc 1.42.0-nightly (859764425 2020-01-07)

$ cargo -V
cargo 1.42.0-nightly (6e1ca924a 2020-01-06)   

$ uname -a
Linux localhost.lan 5.1.5-arch1-2-ARCH #1 SMP PREEMPT Mon May 27 03:37:39 UTC 2019 x86_64 GNU/Linux
 
$ git clone https://github.com/estin/cywad ../cywad-clean 

Progres 5699/100860 25% processing

top - 00:12:21 up 9 min,  1 user,  load average: 1.66, 1.61, 0.97
Tasks: 168 total,   3 running, 165 sleeping,   0 stopped,   0 zombie
%Cpu(s): 28.1 us,  2.2 sy,  0.0 ni, 69.1 id,  0.3 wa,  0.2 hi,  0.1 si,  0.0 st
MiB Mem :  15764.6 total,   8183.0 free,   6347.7 used,   1233.9 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.   8922.0 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
 2520 user      20   0 5728732   5.3g  10732 R  99.3  34.5   4:01.62 ra_cli
  887 user      20   0  419868  39576  21408 R   6.6   0.2   0:08.24 alacritty

Progres 36264/100860 35% processing

top - 00:13:24 up 10 min,  1 user,  load average: 1.64, 1.61, 1.02
Tasks: 168 total,   2 running, 166 sleeping,   0 stopped,   0 zombie
%Cpu(s): 25.5 us,  1.4 sy,  0.0 ni, 73.0 id,  0.0 wa,  0.1 hi,  0.0 si,  0.0 st
MiB Mem :  15764.6 total,   5509.7 free,   9028.8 used,   1226.1 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.   6248.9 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
 2520 user      20   0 8500388   7.9g  10732 R  99.7  51.5   5:04.52 ra_cli
  677 user      20   0  484268  72512  59348 S   2.3   0.4   0:13.82 Xorg
$ env RUST_BACKTRACE=full cargo run --release -p ra_cli analysis-stats --with-deps --memory-usage ../cywad-clean/
    Finished release [optimized] target(s) in 5.83s
     Running `target/release/ra_cli analysis-stats --with-deps --memory-usage ../cywad-clean/`
         
Database loaded, 267 roots, 28.364931516s
Crates in this dir: 331
Total modules found: 4445
Total declarations: 198581
Total functions: 100860
Item Collection: 54.976240485s, 0b allocated 0b resident
6300/100860 6% processing: log2

thread 'main' panicked at 'index 18446744073709551615 out of range for slice of length 1', src/libcore/slice/mod.rs:2674:5
stack backtrace:
   0:     0x56204882da74 - backtrace::backtrace::libunwind::trace::h4429d846a965f730
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1:     0x56204882da74 - backtrace::backtrace::trace_unsynchronized::h64291ceeabe42132
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2:     0x56204882da74 - std::sys_common::backtrace::_print_fmt::h610d7607f8a3fb40
                               at src/libstd/sys_common/backtrace.rs:77
   3:     0x56204882da74 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he6c12d28be7a7b71
                               at src/libstd/sys_common/backtrace.rs:59
   4:     0x56204884ff2c - core::fmt::write::hcadeb61eade511b1
                               at src/libcore/fmt/mod.rs:1057
   5:     0x562048829ac7 - std::io::Write::write_fmt::h2dacf72e7a02535a
                               at src/libstd/io/mod.rs:1426
   6:     0x56204882fbde - std::sys_common::backtrace::_print::hdedd02eb3439490f
                               at src/libstd/sys_common/backtrace.rs:62
   7:     0x56204882fbde - std::sys_common::backtrace::print::hc4dd29eeb6bc5dce
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x56204882fbde - std::panicking::default_hook::{{closure}}::hd86919cf75a5f4a3
                               at src/libstd/panicking.rs:195
   9:     0x56204882f8d1 - std::panicking::default_hook::hed6f1ecdd828101a
                               at src/libstd/panicking.rs:215
  10:     0x562048830223 - std::panicking::rust_panic_with_hook::hfe3dea1e12987f71
                               at src/libstd/panicking.rs:463
  11:     0x56204882fe10 - rust_begin_unwind
                               at src/libstd/panicking.rs:371
  12:     0x56204884e51e - core::panicking::panic_fmt::h93905c2ae23b76e4
                               at src/libcore/panicking.rs:85
  13:     0x562048851a26 - core::slice::slice_index_len_fail::h23ad6ffb51566ba3
                               at src/libcore/slice/mod.rs:2674
  14:     0x562047fccc1e - chalk_solve::split::Split::split_projection::h57fce3f61fbf4c3c
  15:     0x562047d9a050 - chalk_solve::clauses::program_clauses_for_goal::h197e3075dba4291d
  16:     0x562047fbfc81 - <chalk_solve::solve::slg::SlgContextOps<TF> as chalk_engine::context::ContextOps<chalk_solve::solve::slg::SlgContext<TF>>>::program_clauses::h4153caff79b359d6
  17:     0x562047de8548 - chalk_engine::logic::<impl chalk_engine::forest::Forest<C>>::push_initial_strands_instantiated::h59266bdb6054df9e
  18:     0x562047debf78 - chalk_engine::logic::<impl chalk_engine::forest::Forest<C>>::get_or_create_table_for_ucanonical_goal::h173cf7d2fe3d72e6
  19:     0x562047dec331 - chalk_engine::forest::Forest<C>::solve::hd7a0de78b7959143
  20:     0x562047fcee53 - std::panicking::try::do_call::he557cf7aca8c5160
  21:     0x562048837cea - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:79
  22:     0x562047f33481 - ra_hir_ty::traits::trait_solve_query::hd819f62e5065f12f
  23:     0x56204801a45f - salsa::runtime::Runtime<DB>::execute_query_implementation::h971ea348219d32db
  24:     0x562047e357c2 - salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade::h0514af5aaa99284e
  25:     0x562047ea648a - salsa::derived::slot::Slot<DB,Q,MP>::read::haeadc46e5e1006a6
  26:     0x5620480cccd7 - <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch::h685e2734cd446de5
  27:     0x5620480b8536 - salsa::QueryTable<DB,Q>::get::h3291ae2524465756
  28:     0x562047d5f849 - ra_hir_ty::infer::InferenceContext<D>::resolve_ty_as_possible::h1b81a214f61a46bf
  29:     0x562047d6e1b4 - ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext<D>>::infer_method_call::hf3e59ad7019d3091
  30:     0x562047d654ae - ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext<D>>::infer_expr_inner::he4ec72d2820884b6
  31:     0x562047d62506 - ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext<D>>::infer_expr::h83cfa2e0c970e0c9
  32:     0x562047d6a83a - ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext<D>>::infer_expr_inner::he4ec72d2820884b6
  33:     0x562047d6c5b8 - ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext<D>>::infer_expr_coerce::hef6e46b5d925118f
  34:     0x562047d6612e - ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext<D>>::infer_expr_inner::he4ec72d2820884b6
  35:     0x562047d6c5b8 - ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext<D>>::infer_expr_coerce::hef6e46b5d925118f
    43:     0x562047d5e25b - ra_hir_ty::infer::do_infer_query::h72bd614641e8c299
  44:     0x562048018e66 - salsa::runtime::Runtime<DB>::execute_query_implementation::h667330cefb62782a
  45:     0x562047e57e43 - salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade::h5f0ad343f5d1013e
  46:     0x562047e9e508 - salsa::derived::slot::Slot<DB,Q,MP>::read::h66ef06384c07144d
  47:     0x5620480c8a68 - <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch::h2aaa16555f42043f
  48:     0x5620480c1eb8 - <T as ra_hir_ty::db::HirDatabase>::do_infer::h73e990bbd19ee33c
  49:     0x562048020504 - ra_hir_ty::db::infer::h1b53bd69f865b82a
  50:     0x562047efd5e8 - ra_cli::analysis_stats::run::h2f0278ed5571392a
  51:     0x562047fb8566 - ra_cli::main::h826e34b58f3cc624
  52:     0x562047efb803 - std::rt::lang_start::{{closure}}::ha95b5fe80807d44c
  53:     0x56204882fd03 - std::rt::lang_start_internal::{{closure}}::hcc2592ec19581492
                               at src/libstd/rt.rs:52
  54:     0x56204882fd03 - std::panicking::try::do_call::h9a0c206593194ded
                               at src/libstd/panicking.rs:296
  55:     0x562048837cea - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:79
  56:     0x562048830770 - std::panicking::try::h5a3df1de2763d1fc
                               at src/libstd/panicking.rs:272
  57:     0x562048830770 - std::panic::catch_unwind::h222846c6df4c8f02
                               at src/libstd/panic.rs:394
  58:     0x562048830770 - std::rt::lang_start_internal::he3ccbdebb1770af8
                               at src/libstd/rt.rs:51
  59:     0x562047fb9912 - main
  60:     0x7f3f862bb153 - __libc_start_main
  61:     0x562047d5818e - _start
  62:                0x0 - <unknown>
[2020-01-21T21:11:33Z ERROR ra_hir_ty::traits] chalk panicked :-( 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment