Skip to content

Stack overflow in rustc frontend on Windows #75512

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
comcma opened this issue Aug 14, 2020 · 3 comments · Fixed by #75554
Closed

Stack overflow in rustc frontend on Windows #75512

comcma opened this issue Aug 14, 2020 · 3 comments · Fixed by #75554
Assignees
Labels
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.

Comments

@comcma
Copy link

comcma commented Aug 14, 2020

It seems rustc can no longer handle how much is defined in these two binding files. If I comment out either module, it will successfully build. It was previously building on rustc 1.45.2 (d3fb005a3 2020-07-31).

Code

Building this project on Windows:
https://github.com/gamozolabs/applepie/tree/master/whvp_bindings

Meta

rustc --version --verbose:

rustc 1.47.0-nightly (81dc88f88 2020-08-13)
binary: rustc
commit-hash: 81dc88f88f92ba8ad7465f9cba10c12d3a7b70f1
commit-date: 2020-08-13
host: x86_64-pc-windows-msvc
release: 1.47.0-nightly
LLVM version: 10.0

Error output

thread 'rustc' has overflowed its stack
Backtrace

2020-08-14T02:29:59.465476Z  INFO rustc_mir::interpret::eval_context: LEAVING(0) winhvemulation::COMPARTMENT_ID_DEFAULT_COMPARTMENT_ID (unwinding = false)
2020-08-14T02:29:59.469195Z  INFO rustc_mir::interpret::eval_context: ENTERING(0) winhvemulation::_EXCEPTION_DISPOSITION_ExceptionContinueExecution
2020-08-14T02:29:59.469231Z  INFO rustc_mir::interpret::step: _0 = const 0_i32
2020-08-14T02:29:59.469251Z  INFO rustc_mir::interpret::step: return
2020-08-14T02:29:59.469260Z  INFO rustc_mir::interpret::eval_context: LEAVING(0) winhvemulation::_EXCEPTION_DISPOSITION_ExceptionContinueExecution (unwinding = false)
2020-08-14T02:29:59.469373Z  INFO rustc_mir::interpret::eval_context: ENTERING(0) winhvemulation::_EXCEPTION_DISPOSITION_ExceptionContinueSearch
2020-08-14T02:29:59.469391Z  INFO rustc_mir::interpret::step: _0 = const 1_i32
2020-08-14T02:29:59.469404Z  INFO rustc_mir::interpret::step: return
2020-08-14T02:29:59.469412Z  INFO rustc_mir::interpret::eval_context: LEAVING(0) winhvemulation::_EXCEPTION_DISPOSITION_ExceptionContinueSearch (unwinding = false)
2020-08-14T02:29:59.469493Z  INFO rustc_mir::interpret::eval_context: ENTERING(0) winhvemulation::_EXCEPTION_DISPOSITION_ExceptionNestedException
2020-08-14T02:29:59.469506Z  INFO rustc_mir::interpret::step: _0 = const 2_i32
2020-08-14T02:29:59.469518Z  INFO rustc_mir::interpret::step: return
2020-08-14T02:29:59.469525Z  INFO rustc_mir::interpret::eval_context: LEAVING(0) winhvemulation::_EXCEPTION_DISPOSITION_ExceptionNestedException (unwinding = false)
2020-08-14T02:29:59.469587Z  INFO rustc_mir::interpret::eval_context: ENTERING(0) winhvemulation::_EXCEPTION_DISPOSITION_ExceptionCollidedUnwind
2020-08-14T02:29:59.469597Z  INFO rustc_mir::interpret::step: _0 = const 3_i32
2020-08-14T02:29:59.475783Z  INFO rustc_mir::interpret::step: return
2020-08-14T02:29:59.475808Z  INFO rustc_mir::interpret::eval_context: LEAVING(0) winhvemulation::_EXCEPTION_DISPOSITION_ExceptionCollidedUnwind (unwinding = false)

thread 'rustc' has overflowed its stack

@comcma comcma 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 Aug 14, 2020
@comcma
Copy link
Author

comcma commented Aug 14, 2020

This is the stack overflow. Some recursive call in ClashingExternDeclaration checking. I think this is master. I tried to set
#![allow(clashing_extern_declarations)] across the files to see if it might help, but I am not sure if that is exposed. I didn't dig into too much, but it still seems to trigger.

Meta

I am not sure why I don't see the commit hash in the stage1 build. First time building the compiler.

rustc --version --verbose:

rustc 1.47.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-pc-windows-msvc
release: 1.47.0-dev
LLVM version: 10.0

Error output

Windbg stacktrace
rustc_driver_fd22acb2f5822090!ZN12rustc_middle9dep_graph111_$LT$impl$u20$rustc_query_system..dep_graph..DepKind$u20$for$u20$rustc_middle..dep_graph..dep_node..DepKind$GT$9read_deps17haf2565c75f65db83E+0x24:
00007ff9`5f91ea24 e83778f1ff      call    rustc_driver_fd22acb2f5822090!ZN12rustc_middle2ty7context3tls3TLV7__getit17h3f90482d1bd7ab7eE (00007ff9`5f836260)
0:004> k
 # Child-SP          RetAddr               Call Site
00 000000ad`4b606fd0 00007ff9`5f66ba1c     rustc_driver_fd22acb2f5822090!ZN12rustc_middle9dep_graph111_$LT$impl$u20$rustc_query_system..dep_graph..DepKind$u20$for$u20$rustc_middle..dep_graph..dep_node..DepKind$GT$9read_deps17haf2565c75f65db83E+0x24
01 000000ad`4b607090 00007ff9`5f52bf95     rustc_driver_fd22acb2f5822090!ZN18rustc_query_system9dep_graph5graph21DepGraphData$LT$K$GT$10read_index17h80df760fadc7c348E+0x1c
02 000000ad`4b6070d0 00007ff9`5f6949bf     rustc_driver_fd22acb2f5822090!ZN18rustc_query_system5query8plumbing14get_query_impl17h25df09cb289d452bE+0x105
03 000000ad`4b607310 00007ff9`5f0b2350     rustc_driver_fd22acb2f5822090!ZN123_$LT$rustc_middle..ty..layout..LayoutCx$LT$rustc_middle..ty..context..TyCtxt$GT$$u20$as$u20$rustc_target..abi..LayoutOf$GT$9layout_of17h835ba83aa866799aE+0x8f
04 000000ad`4b6074e0 00007ff9`5f0b1f10     rustc_driver_fd22acb2f5822090!ZN10rustc_lint7builtin26ClashingExternDeclarations22structurally_same_type17h74b463e0803287f3E+0x9b0
05 000000ad`4b607590 00007ff9`5f0b1ba7     rustc_driver_fd22acb2f5822090!ZN10rustc_lint7builtin26ClashingExternDeclarations22structurally_same_type17h74b463e0803287f3E+0x570
06 000000ad`4b6076a0 00007ff9`5f08daf4     rustc_driver_fd22acb2f5822090!ZN10rustc_lint7builtin26ClashingExternDeclarations22structurally_same_type17h74b463e0803287f3E+0x207
07 000000ad`4b6077b0 00007ff9`5f0b1fa2     rustc_driver_fd22acb2f5822090!ZN4core4iter6traits8iterator8Iterator5eq_by17h8d3fc6b26777f72fE+0x264
08 000000ad`4b6078e0 00007ff9`5f0b1ba7     rustc_driver_fd22acb2f5822090!ZN10rustc_lint7builtin26ClashingExternDeclarations22structurally_same_type17h74b463e0803287f3E+0x602
09 000000ad`4b6079f0 00007ff9`5f08daf4     rustc_driver_fd22acb2f5822090!ZN10rustc_lint7builtin26ClashingExternDeclarations22structurally_same_type17h74b463e0803287f3E+0x207
0a 000000ad`4b607b00 00007ff9`5f0b1fa2     rustc_driver_fd22acb2f5822090!ZN4core4iter6traits8iterator8Iterator5eq_by17h8d3fc6b26777f72fE+0x264
0b 000000ad`4b607c30 00007ff9`5f0b1ba7     rustc_driver_fd22acb2f5822090!ZN10rustc_lint7builtin26ClashingExternDeclarations22structurally_same_type17h74b463e0803287f3E+0x602
0c 000000ad`4b607d40 00007ff9`5f08daf4     rustc_driver_fd22acb2f5822090!ZN10rustc_lint7builtin26ClashingExternDeclarations22structurally_same_type17h74b463e0803287f3E+0x207

@tesuji
Copy link
Contributor

tesuji commented Aug 14, 2020

Pinging @jumbatm for clashing_extern_declarations in the meantime.

@jumbatm
Copy link
Contributor

jumbatm commented Aug 14, 2020

Uh oh, that's not good. Thanks for reporting! I'll get on this now.

@rustbot claim

tmandry added a commit to tmandry/rust that referenced this issue Aug 18, 2020
…erflow, r=lcnr

Fix clashing_extern_declarations stack overflow for recursive types.

Fixes rust-lang#75512.

Adds a seen set to `structurally_same_type` to avoid recursing indefinitely for types which contain values of the same type through a pointer or reference.
tmandry added a commit to tmandry/rust that referenced this issue Aug 18, 2020
…erflow, r=lcnr

Fix clashing_extern_declarations stack overflow for recursive types.

Fixes rust-lang#75512.

Adds a seen set to `structurally_same_type` to avoid recursing indefinitely for types which contain values of the same type through a pointer or reference.
tmandry added a commit to tmandry/rust that referenced this issue Aug 19, 2020
…erflow, r=lcnr

Fix clashing_extern_declarations stack overflow for recursive types.

Fixes rust-lang#75512.

Adds a seen set to `structurally_same_type` to avoid recursing indefinitely for types which contain values of the same type through a pointer or reference.
tmandry added a commit to tmandry/rust that referenced this issue Aug 19, 2020
…erflow, r=lcnr

Fix clashing_extern_declarations stack overflow for recursive types.

Fixes rust-lang#75512.

Adds a seen set to `structurally_same_type` to avoid recursing indefinitely for types which contain values of the same type through a pointer or reference.
tmandry added a commit to tmandry/rust that referenced this issue Aug 19, 2020
…erflow, r=lcnr

Fix clashing_extern_declarations stack overflow for recursive types.

Fixes rust-lang#75512.

Adds a seen set to `structurally_same_type` to avoid recursing indefinitely for types which contain values of the same type through a pointer or reference.
@bors bors closed this as completed in e8d30bf Aug 19, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants