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

"thread 'rustc' has overflowed its stack" introduced in 1.45.0 #74931

Closed
epage opened this issue Jul 30, 2020 · 9 comments · Fixed by #74983
Closed

"thread 'rustc' has overflowed its stack" introduced in 1.45.0 #74931

epage opened this issue Jul 30, 2020 · 9 comments · Fixed by #74983
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-macos Operating system: macOS T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@epage
Copy link
Contributor

epage commented Jul 30, 2020

Code

git clone https://github.com/crate-ci/typos.git
cd typos/crates/typos-dict
cargo +1.44.0 check  # works
cargo +1.45.0 check  # overflows
RUST_MIN_STACK=20000000 cargo check  # works

(also reproduced in beta and nightly)

Meta

rustc --version --verbose:

rustc 1.45.0 (5c1f21c3b 2020-07-13)
binary: rustc
commit-hash: 5c1f21c3b82297671ad3ae1e8c942d2ca92e84f2
commit-date: 2020-07-13
host: x86_64-apple-darwin
release: 1.45.0
LLVM version: 10.0

Error output

Checking typos-dict v0.2.1 (/Users/edpage/src/personal/typos/crates/typos-dict)

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: could not compile `typos-dict`.

Caused by:
  process didn't exit successfully: `rustc --crate-name typos_dict --edition=2018 crates/typos-dict/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata -Cembed-bitcode=no -C debuginfo=2 -C metadata=439c5583e8d5e9ec -C extra-filename=-439c5583e8d5e9ec --out-dir /Users/edpage/src/personal/typos/target/debug/deps -C incremental=/Users/edpage/src/personal/typos/target/debug/incremental -L dependency=/Users/edpage/src/personal/typos/target/debug/deps --extern log=/Users/edpage/src/personal/typos/target/debug/deps/liblog-6af237d64da748f9.rmeta --extern phf=/Users/edpage/src/personal/typos/target/debug/deps/libphf-3c962e541346fbff.rmeta --extern unicase=/Users/edpage/src/personal/typos/target/debug/deps/libunicase-561e4e81056a68fd.rmeta` (signal: 6, SIGABRT: process abort signal)
Backtrace

No backtrace generated

@epage epage added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 30, 2020
@oli-obk
Copy link
Contributor

oli-obk commented Jul 30, 2020

This is already fixed on nightly, I just tried it locally. Can you confirm?

@epage
Copy link
Contributor Author

epage commented Jul 30, 2020

Installed nightly last night but to double check:

$ rustup update
...
nightly-x86_64-apple-darwin unchanged - rustc 1.47.0-nightly (db0492ace 2020-07-29)

$ cargo +nightly check
   Compiling version_check v0.9.2
    Checking siphasher v0.3.3
   Compiling log v0.4.8
    Checking cfg-if v0.1.10
   Compiling unicase v2.6.0
    Checking phf_shared v0.8.0
    Checking phf v0.8.0
    Checking typos-dict v0.2.1 (/Users/edpage/src/personal/typos/crates/typos-dict)

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: could not compile `typos-dict`.

Caused by:
  process didn't exit successfully: `rustc --crate-name typos_dict --edition=2018 crates/typos-dict/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata -Cembed-bitcode=no -C debuginfo=2 -C metadata=d5a6aa6c6eb18cbb -C extra-filename=-d5a6aa6c6eb18cbb --out-dir /Users/edpage/src/personal/typos/target/debug/deps -C incremental=/Users/edpage/src/personal/typos/target/debug/incremental -L dependency=/Users/edpage/src/personal/typos/target/debug/deps --extern log=/Users/edpage/src/personal/typos/target/debug/deps/liblog-194f264183e56651.rmeta --extern phf=/Users/edpage/src/personal/typos/target/debug/deps/libphf-49669432db2fabaf.rmeta --extern unicase=/Users/edpage/src/personal/typos/target/debug/deps/libunicase-0d7595d4b238a095.rmeta` (signal: 6, SIGABRT: process abort signal)

@oli-obk
Copy link
Contributor

oli-obk commented Jul 30, 2020

Hmm... must be apple specific. Do you have a gdb handy that you could run on that last rustc invocation to obtain a stack trace?

@epage
Copy link
Contributor Author

epage commented Jul 30, 2020

Having problems getting it working, not normally a debugger person (been years since I've run gdb) and not much of a Mac person (work computer).

gdb --args /Users/edpage/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/rustc --crate-name typos_dict --edition=2018 crates/typos-d
ict/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata -Cembed-bitcode=no -C debuginfo=2 -C metadata=d5a6aa6c6eb1
8cbb -C extra-filename=-d5a6aa6c6eb18cbb --out-dir /Users/edpage/src/personal/typos/target/debug/deps -C incremental=/Users/edpage/src/personal/typos/target/debug/incr
emental -L dependency=/Users/edpage/src/personal/typos/target/debug/deps --extern log=/Users/edpage/src/personal/typos/target/debug/deps/liblog-194f264183e56651.rmeta
--extern phf=/Users/edpage/src/personal/typos/target/debug/deps/libphf-49669432db2fabaf.rmeta --extern unicase=/Users/edpage/src/personal/typos/target/debug/deps/libun
icase-0d7595d4b238a095.rmeta

I installed rustc-dev for nightly and I get

Reading symbols from /Users/edpage/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/rustc...

warning: Could not open OSO archive file "/Users/runner/work/1/s/build/x86_64-apple-darwin/stage1-rustc/x86_64-apple-darwin/release/deps/libjemalloc_sys-404271e36c84d6
5d.rlib"
(No debugging symbols found in /Users/edpage/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/rustc)

Then when I run, I get

(gdb) run
Starting program: /Users/edpage/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/rustc --crate-name typos_dict --edition=2018 crates/typos-dict/src/lib.rs --error-fo
rmat=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata -Cembed-bitcode=no -C debuginfo=2 -C metadata=d5a6aa6c6eb18cbb -C extra-filename=-d
5a6aa6c6eb18cbb --out-dir /Users/edpage/src/personal/typos/target/debug/deps -C incremental=/Users/edpage/src/personal/typos/target/debug/incremental -L dependency=/Us
ers/edpage/src/personal/typos/target/debug/deps --extern log=/Users/edpage/src/personal/typos/target/debug/deps/liblog-194f264183e56651.rmeta --extern phf=/Users/edpag
e/src/personal/typos/target/debug/deps/libphf-49669432db2fabaf.rmeta --extern unicase=/Users/edpage/src/personal/typos/target/debug/deps/libunicase-0d7595d4b238a095.rm
eta
Unable to find Mach task port for process-id 76733: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8)

@oli-obk
Copy link
Contributor

oli-obk commented Jul 30, 2020

hmm... not sure what our gdb capabilities on mac are. I'll try to find someone who's building rustc on macs. Thanks for the attempt!

@nagisa nagisa added the O-macos Operating system: macOS label Jul 30, 2020
@Mark-Simulacrum
Copy link
Member

I'm looking into producing a build locally.

@Mark-Simulacrum
Copy link
Member

@oli-obk
Copy link
Contributor

oli-obk commented Jul 31, 2020

lol I recently (two days ago) looked at collapse_goto_chain and went "oh this could stack overflow, why is this not a loop".

I'll (try to) fix this without inserting more stacker invocations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-macos Operating system: macOS T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants