-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
starting from nightly-2020-08-18 rustls can't connect to some websites #76803
Comments
Which commit is that? (and nightly-2020-08-17) |
Ok I got cargo-bisect-rustc to work, here's the output: searched nightlies: from nightly-2020-08-15 to nightly-2020-08-20 bisected with cargo-bisect-rustc v0.5.2Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --preserve --start=2020-08-15 --end=2020-08-20 -- test |
Great, thanks for the report! |
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Type {
A = 1,
B = 7,
}
impl Type {
fn encode(&self) -> Type {
match self {
Type::A => Type::B,
_ => *self,
}
}
}
fn main() {
assert_eq!(Type::A.encode(), Type::B);
} $ rustc -Zmir-opt-level=0 b.rs && ./b
$ rustc -Zmir-opt-level=1 b.rs && ./b
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `A`,
right: `B`', b.rs:18:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace |
@tmiasko: Is there a relation to the original example code or to the issue in general? |
@Stupremee the code example has different behavior with and without optimizations. Since there's no |
Yea I know, but what does it have to do with the issue / code from paolobarbolini? |
It's minimized code from rustls |
Marking as |
Ahh okay. Thanks |
This looks like a cc @rust-lang/wg-mir-opt #[derive(Copy, Clone)]
#[repr(u8)]
pub enum Type {
A = 1,
B = 7,
}
pub fn encode(v: &Type) -> Type {
match v {
Type::A => Type::B,
_ => *v,
}
} with
edit: |
simpler repro: https://godbolt.org/z/3cdfa8 pub enum Type {
A,
B,
}
pub fn encode(v: Type) -> Type {
match v {
Type::A => Type::B,
_ => v,
}
} |
Wild guess: #74748 |
It was already bisected to that PR in #76803 (comment) |
This repros on beta, so this is a stable-to-beta regression. |
rust/src/librustc_mir/transform/simplify_try.rs Lines 661 to 671 in 33c96b4
This fails to consider that the discriminant value assigned in
|
I opened a PR to disable the logic and nominated it for beta backport. |
The logic is currently broken and we need to disable it to fix a beta regression (see rust-lang#76803)
…r=oli-obk [mir-opt] Disable the `ConsideredEqual` logic in SimplifyBranchSame opt The logic is currently broken and we need to disable it to fix a beta regression (see rust-lang#76803) r? `@oli-obk`
Fix rust-lang#76803 miscompilation Fixes rust-lang#76803 Seems like it was an oversight that the discriminant value being set was not compared to the target value from the SwitchInt, as a comment says this is a requirement for the optimization to be sound. r? `@wesleywiser` since you are probably familiar with the optimization and made rust-lang#76837 to workaround the bug
I'm re-opening to track the beta-backport. Once that is completed, we can close this. |
The logic is currently broken and we need to disable it to fix a beta regression (see rust-lang#76803)
The beta backport has landed (#77308). Closing this issue. |
I tried this code:
With dependencies:
I expected to see this happen: it establishes a TLS connection, sends the HTTP/1.1 request and prints the entire response
Instead, this happened: fails with Custom { kind: InvalidData, error: DecryptError }
I bisected this to nightly-2020-08-18. I couldn't reproduce this issue with other websites.
Meta
rustc --version --verbose
:Backtrace when running with cargo run
The text was updated successfully, but these errors were encountered: