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

Release build taking forever on 1.34.1 #60548

Closed
fizyk20 opened this issue May 4, 2019 · 15 comments
Closed

Release build taking forever on 1.34.1 #60548

fizyk20 opened this issue May 4, 2019 · 15 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@fizyk20
Copy link

fizyk20 commented May 4, 2019

I'm trying to build my crate at this commit: https://github.com/fizyk20/atm-refraction/tree/a7f38e582d507345f0f6bddbf769244caee0fe70

cargo build --release ran on Rust 1.34.1 doesn't finish for at least a few minutes (I admit I haven't been too patient with letting it run for a long time, as I knew it used to compile quite quickly, but I can safely say that it wasn't able to finish for me in at least 5 minutes). A debug build (cargo build) finishes in about 15 seconds.

I checked on another Rust version to make sure that it's different, and indeed, compilation of the same commit on 1.31.0 in release mode takes 24 seconds. Nightly 1.36.0 2019-05-03 can't finish just like 1.34.1.

I haven't tried versions other than 1.31.0, 1.34.1 and 1.36.0 nightly so far, but I can do so if needed.

I'm on Gentoo Linux on x86_64. All tested Rust versions installed via rustup.

If any other information is required, please let me know.

@jonas-schievink jonas-schievink added I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 4, 2019
@sfackler sfackler added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label May 4, 2019
@ohsayan
Copy link
Contributor

ohsayan commented May 5, 2019

@fizyk20 Can you reproduce this frequently?

@fizyk20
Copy link
Author

fizyk20 commented May 5, 2019

It happens every time I try to build this specific crate using 1.34.1. I haven't encountered the problem with any other piece of code yet, though.

I'm not sure if I answered the question.

@jonas-schievink jonas-schievink added the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label May 5, 2019
@jonas-schievink
Copy link
Contributor

I've given the crate a cursory look and nothing stood out as being particularly difficult for the compiler (except a few nom parsers perhaps?). Build is stuck somewhere in LLVM, probably running module passes on a cgu. I'll try to bisect, but it's likely that it will just point us to an LLVM upgrade.

@jonas-schievink jonas-schievink self-assigned this May 5, 2019
@jonas-schievink
Copy link
Contributor

Good: 1.33.0
Bad: 1.34.0

Good: rustc 1.34.0-nightly (097c04cf4 2019-02-24)
Bad: rustc 1.34.0-nightly (00aae71f5 2019-02-25)

Commits in range: 097c04c...00aae71

Likely cause: #57609 (since it touches MIR lowering)
cc @matthewjasper

@jonas-schievink jonas-schievink removed their assignment May 5, 2019
@jonas-schievink jonas-schievink added I-nominated and removed E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc labels May 5, 2019
@jonas-schievink
Copy link
Contributor

It's something in air/parser.rs – if parse_atmospheres body is replaced with unimplemented!() the issue disappears.

@ohsayan
Copy link
Contributor

ohsayan commented May 5, 2019

@jonas-schievink
✔️ Verified on Rust 1.31.0 -> Build okay stable
✔️ Verified on Rust 1.33.0 -> Build okay stable
✔️ Verified on Rust 1.34.0 -> Slow Build nightly
✔️ Verified on Rust 1.34.1 -> Slow Build nightly
(Likely commits causing problems: c15437c...5ffc919

@jonas-schievink jonas-schievink added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. labels May 5, 2019
@jonas-schievink
Copy link
Contributor

This is a proper hang, my build is still running after >5 hours.

@jonas-schievink jonas-schievink added I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. and removed I-compiletime Issue: Problems and improvements with respect to compile times. labels May 5, 2019
@ohsayan
Copy link
Contributor

ohsayan commented May 5, 2019

This is a proper hang, my build is still running after >5 hours.

Yeah, I ran the build for the crate on EC2 and that's running for > 6 hours

@matthewjasper
Copy link
Contributor

matthewjasper commented May 5, 2019

#60174 appears to fix this. Probably the issue is broken debug info. I'll try a build with llvm assertions tomorrow to see if that's really the case.

Smallish repro (pretty hard to meaning fully reduce further)

lib.rs:

use nom::sp;
use nom::types::CompleteStr;
use nom::Convert;
use nom::InputIter;
use nom::{need_more, Compare};
use nom::{Err, IResult, Needed};
pub fn float(i: CompleteStr) -> IResult<CompleteStr, f64> {
    regex::Regex::new("");
    Ok((i, 0.0))
}
pub struct TemperatureAt {
    pub start_h: f64,
    pub start_t: f64,
}
pub fn temperature_at(i: CompleteStr) -> IResult<CompleteStr, TemperatureAt> {
    match {
        let mut sep_res = sp(i);
        match sep_res {
            Ok((i1, _)) => {
                let res: IResult<CompleteStr, TemperatureAt> = match {
                    let sep_res = sp(i1);
                    match sep_res {
                        Ok((i2, _)) => {
                            i2.compare("");
                            let res2: IResult<_, CompleteStr> = need_more(i2, Needed::Size(0));
                            res2
                        }
                        Err(e07) => Err(Err::convert(e07)),
                    }
                } {
                    Err(e06) => Err(e06),
                    Ok(_) => match match sep_res {
                        Ok(_) => {
                            let res2: IResult<_, char> = match i1.iter_elements().next() {
                                Some('A') => {
                                    let e05 = nom::ErrorKind::Char;
                                    Err(Err::Error(nom::Context::Code(i1, e05)))
                                }
                                _ => need_more(i1, Needed::Size(1)),
                            };
                            res2
                        }
                        Err(e08) => Err(e08),
                    } {
                        Err(e09) => Err(e09),
                        _ => match {
                            sep_res = sp(i);
                            match sep_res {
                                Err(e10) => Err(e10),
                                _ => {
                                    let res = float(i1);
                                    res
                                }
                            }
                        } {
                            Err(e11) => Err(e11),
                            Ok((i7, o)) => match {
                                sep_res = sp(i7);
                                match sep_res {
                                    Ok((i5, _)) => {
                                        let res =
                                            need_more::<_, CompleteStr, u32>(i5, Needed::Size(1));
                                        res
                                    }
                                    Err(e12) => Err(Err::convert(e12)),
                                }
                            } {
                                Err(e01) => Err(e01),
                                _ => match {
                                    sep_res = sp(i7);
                                    sep_res
                                } {
                                    Err(e02) => Err(e02),
                                    _ => Ok((
                                        i,
                                        TemperatureAt {
                                            start_h: 0.0,
                                            start_t: 0.0,
                                        },
                                    )),
                                },
                            },
                        },
                    },
                };
                drop(&res);
                res
            }
            Err(e03) => Err(e03),
        }
    } {
        Err(e04) => Err(e04),
        Ok((i6, o01)) => loop {},
    }
}

Cargo.toml

[package]
name = ""
version = "0.1.0"
authors = [""]
edition = "2018"

[dependencies]
nom = "4.1"
regex = "1.0"

@matthewjasper
Copy link
Contributor

This is fixed by d38eeacc86179a37e2bf35c1bd336df306b6edde.
Taking just the scope changes from there doesn't fix the issue, so this might just be a case that the code that's generated is different enough to avoid the issue.

@nikomatsakis
Copy link
Contributor

@matthewjasper should we put "Fixes" on that PR for this issue?

@nikomatsakis
Copy link
Contributor

triage: P-high

Regression -- assigning to @matthewjasper, who seems to have a pending fix

@matthewjasper
Copy link
Contributor

@matthewjasper should we put "Fixes" on that PR for this issue?

I'd rather not use "Fixes" with no test and no idea what the actual problem is here.

@matthewjasper matthewjasper removed their assignment Jul 7, 2019
@matthewjasper matthewjasper removed the P-high High priority label Jul 7, 2019
@matthewjasper matthewjasper added P-low Low priority E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. and removed regression-from-stable-to-stable Performance or correctness regression from one stable version to another. labels Jul 7, 2019
@matthewjasper
Copy link
Contributor

Changed labels now that this compiles successfully on beta.

@Mark-Simulacrum
Copy link
Member

I don't think this is worth keeping open in the hopes of finding a test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants