-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustc stackoverflow (SIGSEGV) #122715
Comments
@womeier Please specify the build command you used. Did you build this with optimizations or what? |
Oh, I'm sorry, I misunderstood. No, #122357 is not quite related because it's in LLVM. This is in rustc.
Maybe we should be using |
Included the |
Pulled out a debuginfo'd backtrace from gdb and quickly found this very regular period: #0 0x00007da0db8844fe in <rustc_parse::parser::Parser>::parse_outer_attributes () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#1 0x00007da0db8975f8 in <rustc_parse::parser::Parser>::parse_expr_prefix () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#2 0x00007da0db8939e7 in <rustc_parse::parser::Parser>::parse_expr_assoc_with () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#3 0x00007da0db8937f3 in <rustc_parse::parser::Parser>::parse_expr_assoc () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#4 0x00007da0db954e31 in <rustc_parse::parser::Parser>::with_res::<core::result::Result<rustc_ast::ptr::P<rustc_ast::ast::Expr>, rustc_errors::diagnostic::Diag>, <rustc_parse::parser::Parser>::parse_expr_res::{closure#0}> ()
from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#5 0x00007da0db893623 in <rustc_parse::parser::Parser>::parse_expr_catch_underscore () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#6 0x00007da0db93cc21 in <rustc_parse::parser::Parser>::parse_paren_comma_seq::<rustc_ast::ptr::P<rustc_ast::ast::Expr>, <rustc_parse::parser::Parser>::parse_expr_paren_seq::{closure#0}> () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#7 0x00007da0db899cec in <rustc_parse::parser::Parser>::parse_expr_dot_or_call_with_ () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#8 0x00007da0db8984fe in <rustc_parse::parser::Parser>::parse_expr_dot_or_call_with () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#9 0x00007da0db92c746 in <rustc_parse::parser::Parser>::collect_tokens_for_expr::<<rustc_parse::parser::Parser>::parse_expr_dot_or_call::{closure#0}>::{closure#0} () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#10 0x00007da0db92a3ee in <rustc_parse::parser::Parser>::collect_tokens_for_expr::<<rustc_parse::parser::Parser>::parse_expr_dot_or_call::{closure#0}> () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#11 0x00007da0db89787a in <rustc_parse::parser::Parser>::parse_expr_prefix () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#12 0x00007da0db8939e7 in <rustc_parse::parser::Parser>::parse_expr_assoc_with () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#13 0x00007da0db8937f3 in <rustc_parse::parser::Parser>::parse_expr_assoc () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#14 0x00007da0db954e31 in <rustc_parse::parser::Parser>::with_res::<core::result::Result<rustc_ast::ptr::P<rustc_ast::ast::Expr>, rustc_errors::diagnostic::Diag>, <rustc_parse::parser::Parser>::parse_expr_res::{closure#0}> ()
from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#15 0x00007da0db893623 in <rustc_parse::parser::Parser>::parse_expr_catch_underscore () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#16 0x00007da0db93cc21 in <rustc_parse::parser::Parser>::parse_paren_comma_seq::<rustc_ast::ptr::P<rustc_ast::ast::Expr>, <rustc_parse::parser::Parser>::parse_expr_paren_seq::{closure#0}> () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#17 0x00007da0db899cec in <rustc_parse::parser::Parser>::parse_expr_dot_or_call_with_ () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#18 0x00007da0db8984fe in <rustc_parse::parser::Parser>::parse_expr_dot_or_call_with () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#19 0x00007da0db92c746 in <rustc_parse::parser::Parser>::collect_tokens_for_expr::<<rustc_parse::parser::Parser>::parse_expr_dot_or_call::{closure#0}>::{closure#0} () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#20 0x00007da0db92a3ee in <rustc_parse::parser::Parser>::collect_tokens_for_expr::<<rustc_parse::parser::Parser>::parse_expr_dot_or_call::{closure#0}> () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so
#21 0x00007da0db89787a in <rustc_parse::parser::Parser>::parse_expr_prefix () from /home/jubilee/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-decf49367d89a1c2.so At first glance I thought that |
…ll-call-calling-me-maybe, r=compiler-errors Ensure stack before parsing dot-or-call There are many cases where, due to codegen or a massively unruly codebase, a deeply nested `call(call(call(call(call(call(call(call(call(f())))))))))` can happen. This is a spot where it would be good to grow our stack, so that we can survive to tell the programmer their code is dubiously written. Closes rust-lang#122715
Rollup merge of rust-lang#122717 - workingjubilee:handle-call-call-call-call-calling-me-maybe, r=compiler-errors Ensure stack before parsing dot-or-call There are many cases where, due to codegen or a massively unruly codebase, a deeply nested `call(call(call(call(call(call(call(call(call(f())))))))))` can happen. This is a spot where it would be good to grow our stack, so that we can survive to tell the programmer their code is dubiously written. Closes rust-lang#122715
Pretty cool to get this fixed in a day, thanks @workingjubilee. |
I was trying to run rust code extracted from Coq using the https://github.com/AU-COBRA/coq-rust-extraction plugin resulting in this project: binom-extracted.zip
The original program is
main
in binom.v, some operations on a binomial queue.It does compile when setting the
RUST_MIN_STACK
environment var, as suggested in the seemingly related #122357, so feel free to close.It may be due to a deep nesting of function calls,
__nat_succ
(the successor constructor of the naive representation of natural numbers in Coq).I expected to see this happen: successful compilation
Instead, this happened: rustc stackoverflow
Run command
cargo build
with thisCargo.toml
:Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: