Stream: t-compiler

Topic: cg_clif rustc bootstrap crash

bjorn3 (Apr 20 2020 at 19:26, on Zulip):

I got rustc bootstrapping using cg_clif. Unfortunately the rustc built using cg_clif crashes when you try to use it. So far I have been able to pin point that make_input returns an io::Error. When trying to .to_string() it it turns out that the io::Error has an invalid discriminant.

How do I continue debugging from this point on? I normally just removed code piece by piece and added printf for values I suspected to be corrupted. However for rustc this is not feasible, as the recompilation takes way too long.

Rust fork: (branch cg_clif_subtree)
cg_clif commit: (branch wip_proc_macro_fixes, clone it to src/rustc_codegen_cranelift in the rust source repo)
Cranelift commit: (pr bytecodealliance/wasmtime#1559, clone it to the parent dir of the rust repo, or edit Cargo.toml of the rust repo to point to it in the patch section)


codegen-backends = ["cranelift"]
deny-warnings = false
bjorn3 (Apr 20 2020 at 19:47, on Zulip):

^ any suggestions?

eddyb (Apr 27 2020 at 07:15, on Zulip):

@bjorn3 you can try to use rr to find the code that last wrote the memory address containing the bad discriminant

bjorn3 (Apr 27 2020 at 08:48, on Zulip):

Good idea!

Last update: May 29 2020 at 16:55UTC