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

Slab allocator panics if unpack RAM is manually set too low (or machine has < 32MB of RAM). #2771

Closed
wongsyrone opened this issue May 16, 2021 · 8 comments · Fixed by #2780
Closed
Labels

Comments

@wongsyrone
Copy link

Problem
panic when run rustup update using 1.24.2 beta version

C:\Users\home\Desktop>set RUSTUP_UPDATE_ROOT=https://dev-static.rust-lang.org/rustup

C:\Users\home\Desktop>rustup.exe update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-gnu'
info: latest update on 2021-05-16, rust version 1.54.0-nightly (8cf990c9b 2021-05-15)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
 16.6 MiB /  16.6 MiB (100 %)  16.5 MiB/s in  2s ETA:  0s
info: downloading component 'rust-mingw'
info: downloading component 'rust-std'
 19.8 MiB /  19.8 MiB (100 %)  11.7 MiB/s in  3s ETA:  0s
info: downloading component 'rustc'
 80.0 MiB /  80.0 MiB (100 %)  10.8 MiB/s in 11s ETA:  0s
info: downloading component 'rustfmt'
info: removing previous version of component 'cargo'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rust-docs'
info: removing previous version of component 'rust-mingw'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'rustc'
info: removing previous version of component 'rustfmt'
info: installing component 'cargo'
thread 'main' panicked at 'assertion failed: Threaded::ram_highwater(&vec_pools) < ram_budget', src\diskio\threaded.rs:167:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'No process instance', src\currentprocess.rs:126:17
stack backtrace:
   0:     0x7ff6a2b3d9a3 - <unknown>
   1:     0x7ff6a26cc90c - <unknown>
   2:     0x7ff6a2b3c9a8 - <unknown>
   3:     0x7ff6a2b3c01c - <unknown>
   4:     0x7ff6a2b3b520 - <unknown>
   5:     0x7ff6a2b3b097 - <unknown>
   6:     0x7ff6a299c544 - <unknown>
   7:     0x7ff6a299c50f - <unknown>
   8:     0x7ff6a2c7f42d - <unknown>
   9:     0x7ff6a299aa0c - <unknown>
  10:     0x7ff6a299894c - <unknown>
  11:     0x7ff6a299eb6f - <unknown>
  12:     0x7ff6a29d1a02 - <unknown>
  13:     0x7ff6a29e3e8d - <unknown>
  14:     0x7ff6a2a76081 - <unknown>
  15:     0x7ff6a2a276b2 - <unknown>
  16:     0x7ff6a2a12b09 - <unknown>
  17:     0x7ff6a2c542d0 - <unknown>
  18:     0x7ff6a2c53c0e - <unknown>
  19:     0x7ff6a2c510b8 - <unknown>
  20:     0x7ff6a2c5367d - <unknown>
  21:     0x7ff6a2c51531 - <unknown>
  22:     0x7ffcc9a921ff - _chkstk
  23:     0x7ffcc9a20939 - RtlUnwindEx
  24:     0x7ff6a2c513c2 - <unknown>
  25:     0x7ff6a2c52d2d - <unknown>
  26:     0x7ff6a2c5306f - <unknown>
  27:     0x7ff6a2c53779 - <unknown>
  28:     0x7ff6a2c51531 - <unknown>
  29:     0x7ffcc9a9217f - _chkstk
  30:     0x7ffcc9a41454 - RtlRaiseException
  31:     0x7ffcc9a411a5 - RtlRaiseException
  32:     0x7ffcc7194b89 - RaiseException
  33:     0x7ff6a2c51f30 - <unknown>
  34:     0x7ff6a2765591 - <unknown>
  35:     0x7ff6a2765519 - <unknown>
  36:     0x7ff6a2b3b828 - <unknown>
  37:     0x7ff6a2b3b072 - <unknown>
  38:     0x7ff6a2b43f5b - <unknown>
  39:     0x7ff6a2b43edf - <unknown>
  40:     0x7ff6a2b43e7f - <unknown>
  41:     0x7ff6a2c75500 - <unknown>
  42:     0x7ff6a2c7544c - <unknown>
  43:     0x7ff6a2a3b009 - <unknown>
  44:     0x7ff6a2a69f0e - <unknown>
  45:     0x7ff6a2a084ef - <unknown>
  46:     0x7ff6a29f717d - <unknown>
  47:     0x7ff6a29f1cd2 - <unknown>
  48:     0x7ff6a29ef808 - <unknown>
  49:     0x7ff6a2aee8de - <unknown>
  50:     0x7ff6a2aa669d - <unknown>
  51:     0x7ff6a2643689 - <unknown>
  52:     0x7ff6a2641006 - <unknown>
  53:     0x7ff6a264774c - <unknown>
  54:     0x7ff6a2c50410 - <unknown>
  55:     0x7ffcc95e7034 - BaseThreadInitThunk
  56:     0x7ffcc9a42651 - RtlUserThreadStart
thread panicked while panicking. aborting.

Steps

  1. just rustup update

Possible Solution(s)
No idea.

Notes

C:\Users\home>rustup dump-testament
Rustup version renders as: 1.24.2 (34cd8a5b7 2021-05-10)
Current crate version: 1.24.2
Built from branch: stable
Commit info: 1.24.1+440 (34cd8a5b7 2021-05-10)
Working tree is clean
C:\Users\home>rustup --version
rustup 1.24.2 (34cd8a5b7 2021-05-10)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.52.1 (9bc8c42bb 2021-05-09)`

C:\Users\home>rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  D:\.rustup_home

installed toolchains
--------------------

stable-x86_64-pc-windows-msvc (default)
nightly-x86_64-pc-windows-gnu
nightly-x86_64-pc-windows-msvc

installed targets for active toolchain
--------------------------------------

x86_64-pc-windows-gnu
x86_64-pc-windows-msvc

active toolchain
----------------

stable-x86_64-pc-windows-msvc (default)
rustc 1.52.1 (9bc8c42bb 2021-05-09)
@wongsyrone wongsyrone added the bug label May 16, 2021
@wongsyrone
Copy link
Author

@kinnison The latest beta test result.

@wongsyrone
Copy link
Author

After removing the environment variable RUSTUP_UNPACK_RAM=20000000, it works.

@kinnison
Copy link
Contributor

I think this suggests there'll be some tweaking to be done on how we handle forced lower-RAM scenarios, but since RUSTUP_UNPACK_RAM is not meant for general use I'm not going to worry too badly for now, thank you for raising this. I'm going to rework the title and leave this open, but not block the release on this.

@kinnison kinnison changed the title panic when rustup update Slab allocator panics in lower-RAM-limit scenarios May 16, 2021
@kinnison
Copy link
Contributor

One possible fix for this could be to ensure that the minimum specified RAM limit is not below the total of 1 slab of each size.

@wongsyrone
Copy link
Author

Thanks. Please keep the good work.

@rbtcollins
Copy link
Contributor

@kinnison there is already a check for minimum size > sum of slabs : the threaded pool startup allocates one of each pool to ensure that there is no chance of starvation due to bad workload patterns. This panic is in fact exactly that check.

We can make it prettier sure, but theres no actual fault here.

@kinnison
Copy link
Contributor

Mmm, in my view this kind of check should either have happened right at the start, or it should be soft - i.e. too small a limit should be bumped up to the functional minimum and a warning issued.

@rbtcollins
Copy link
Contributor

rbtcollins commented May 18, 2021

Sure, no in principle disagreement there. It is at the start FWIW: https://github.com/rust-lang/rustup/blob/master/src/diskio/threaded.rs#L167

@rbtcollins rbtcollins changed the title Slab allocator panics in lower-RAM-limit scenarios Slab allocator panics if unpack RAM is manually set too low (or machine has < 32MB of RAM). May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants