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

Allocate HIR on an arena 2/4 -- Expr & Pat #66936

Merged
merged 7 commits into from
Dec 27, 2019
Merged

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Dec 1, 2019

This is the second PR in the series started by #66931

This time, commits don't really make sense on their own.
They are mostly split by type of compile error.

The additional diff is here: cjgillot/rust@hirene-preamble...hirene-expr

@davidtwco
Copy link
Member

r? @eddyb
cc @Zoxc

@rust-highfive rust-highfive assigned eddyb and unassigned davidtwco Dec 1, 2019
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@bors

This comment has been minimized.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 2, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-12-02T19:49:52.0883694Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-02T19:49:52.1073113Z ##[command]git config gc.auto 0
2019-12-02T19:49:52.1134435Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-02T19:49:52.1198558Z ##[command]git config --get-all http.proxy
2019-12-02T19:49:52.1323834Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66936/merge:refs/remotes/pull/66936/merge
---
2019-12-02T20:15:55.0260053Z fatal runtime error: stack overflow
2019-12-02T20:15:55.3125594Z error: could not compile `core`.
2019-12-02T20:15:55.3125719Z 
2019-12-02T20:15:55.3125762Z Caused by:
2019-12-02T20:15:55.3136067Z   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name core src/libcore/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -C metadata=8dab76f6898d904f -C extra-filename=-8dab76f6898d904f --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps -Zexternal-macro-backtrace '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -Cprefer-dynamic -Zbinary-dep-depinfo` (signal: 6, SIGABRT: process abort signal)
2019-12-02T20:15:56.9123561Z error: build failed
2019-12-02T20:15:56.9140676Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "-Zconfig-profile" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "--message-format" "json-render-diagnostics"
2019-12-02T20:15:56.9140809Z expected success, got: exit code: 101
2019-12-02T20:15:56.9153845Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-12-02T20:15:56.9153845Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-12-02T20:15:56.9153943Z Build completed unsuccessfully in 0:20:35
2019-12-02T20:15:56.9202769Z == clock drift check ==
2019-12-02T20:15:56.9218274Z   local time: Mon Dec  2 20:15:56 UTC 2019
2019-12-02T20:15:57.1877585Z   network time: Mon, 02 Dec 2019 20:15:57 GMT
2019-12-02T20:15:57.1881821Z == end clock drift check ==
2019-12-02T20:15:57.8993319Z 
2019-12-02T20:15:57.9091492Z ##[error]Bash exited with code '1'.
2019-12-02T20:15:57.9126620Z ##[section]Starting: Checkout
2019-12-02T20:15:57.9128281Z ==============================================================================
2019-12-02T20:15:57.9128330Z Task         : Get sources
2019-12-02T20:15:57.9128372Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@cjgillot
Copy link
Contributor Author

cjgillot commented Dec 3, 2019

I seem to be constructing some sort of infinite loop in the HIR graph. The stack overflow happens when hashing everything. The loop consists of a ExprKind::Call(ExprKind::Path(QPath::TypeRelative(...)), &[ExprKind::Binary(..., loop, ...)).

@bors

This comment has been minimized.

@bors

This comment has been minimized.

@bors

This comment has been minimized.

@bors

This comment has been minimized.

src/librustc/hir/mod.rs Outdated Show resolved Hide resolved
@Zoxc
Copy link
Contributor

Zoxc commented Dec 22, 2019

Did you ensure that the Fewer calls to arena.alloc commit didn't result in allocations which wouldn't get used?

And did you resolve the infinite loop?

@cjgillot cjgillot force-pushed the hirene-expr branch 2 times, most recently from 84526d2 to 3c5f298 Compare December 22, 2019 18:09
@cjgillot
Copy link
Contributor Author

Rebased.

Did you ensure that the Fewer calls to arena.alloc commit didn't result in allocations which wouldn't get used?

I did as much as I could. There are no unused allocation of HIR nodes, because of typing. However, typing does not guarantee against unused allocation of a pointer.

And did you resolve the infinite loop?

Yes. It was in the arena allocation code. Bug #67001

@@ -2931,16 +2938,20 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
}
}

hir::PatKind::Slice(before.into(), slice, after.into())
hir::PatKind::Slice(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably elide the intermediate allocations here by converting the code above into more functional style code, but we can leave this for another time.

src/librustc/hir/mod.rs Outdated Show resolved Hide resolved
@cjgillot
Copy link
Contributor Author

Rebased.

@Centril
Copy link
Contributor

Centril commented Dec 27, 2019

@bors r=Zoxc p=5

@bors
Copy link
Contributor

bors commented Dec 27, 2019

📌 Commit fb100e5 has been approved by Zoxc

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 27, 2019
@bors
Copy link
Contributor

bors commented Dec 27, 2019

⌛ Testing commit fb100e5 with merge a04c789...

bors added a commit that referenced this pull request Dec 27, 2019
Allocate HIR on an arena 2/4 -- Expr & Pat

This is the second PR in the series started by #66931

This time, commits don't really make sense on their own.
They are mostly split by type of compile error.

The additional diff is here: cjgillot/rust@hirene-preamble...hirene-expr
@bors
Copy link
Contributor

bors commented Dec 27, 2019

☀️ Test successful - checks-azure
Approved by: Zoxc
Pushing a04c789 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 27, 2019
@bors bors merged commit fb100e5 into rust-lang:master Dec 27, 2019
JohnTitor added a commit to JohnTitor/rust-clippy that referenced this pull request Dec 27, 2019
JohnTitor added a commit to JohnTitor/rust-clippy that referenced this pull request Dec 27, 2019
bors added a commit to rust-lang/rust-clippy that referenced this pull request Dec 27, 2019
@cjgillot cjgillot deleted the hirene-expr branch December 27, 2019 17:37
bors added a commit that referenced this pull request Dec 29, 2019
Allocate HIR on an arena 3/4 -- Ty

This is the third PR in the series started by #66931 and #66936

Once again, commits don't really make sense on their own.
They are mostly split by type of compile error.

The additional diff is here: cjgillot/rust@hirene-expr...hirene-ty
bors added a commit that referenced this pull request Dec 31, 2019
Allocate HIR on an arena 4/4

This is the fourth and last PR in the series started by #66931, #66936 and #66942.

The last commits should compile on their own.
The difference with the previous PR is given by cjgillot/rust@hirene-ty...hirene

A few more cleanups may be necessary, please tell me.

r? @eddyb like the other
cc @Zoxc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants