Skip to content

Regression from 1.44 to 1.45 #74739

Closed

Description

@mcarton

The following MVE prints 42 with rustc 1.45.0 but 13 with rustc 1.44.0

struct Foo {
    x: i32,
}

fn main() {
    let mut foo = Foo { x: 42 };
    let x = &mut foo.x;
    *x = 13;
    let y = foo;
    println!("{}", y.x); // -> 42; expected result: 13
}

Initially reported on Stack Overflow.

Activity

  1. added
    C-bug
    on Jul 25, 2020
  2. mcarton commented on Jul 25, 2020

    @mcarton
    ContributorAuthor

    With beta or nightly this again prints 13 as expected.

  3. added
    I-unsound
    regression-from-stable-to-stable
    on Jul 25, 2020
  4. added
    I-prioritize
    on Jul 25, 2020
  5. lcnr commented on Jul 25, 2020

    @lcnr
    Contributor

    This is a duplicate of the already fixed #73609

    It seems like this bug somehow slipped into beta :/

  6. added
    T-release
    on Jul 25, 2020
  7. SimonSapin commented on Jul 25, 2020

    @SimonSapin
    Contributor

    @rust-lang/release Should there be a 1.45.1 with #73609?

  8. peterjoel commented on Jul 25, 2020

    @peterjoel
  9. jonas-schievink commented on Jul 25, 2020

    @jonas-schievink
  10. peterjoel commented on Jul 25, 2020

    @peterjoel
  11. benschulz commented on Jul 25, 2020

    @benschulz
    Contributor

    I'm confused. Based on the examples this bug appears to be very impactful, i.e. it should break a lot of code. Yet it made it to stable which, I assume, involves a crater run and independent testing on beta. Is there a subtle condition to this bug that isn't met in most productive code?

  12. oli-obk commented on Jul 25, 2020

    @oli-obk
    Contributor

    The bug is almost impossible to trigger on real world code. You need all values that are going into the bug to be constant values and there can't be any control flow or function calls in between.

  13. 2 remaining items

  14. added
    P-critical
    and removed
    I-prioritize
    on Jul 25, 2020
  15. LeSeulArtichaut commented on Jul 25, 2020

    @LeSeulArtichaut
    Contributor
  16. Mark-Simulacrum commented on Jul 25, 2020

    @Mark-Simulacrum
    Member

    I am happy to include 5fa8b08 in 1.45.1. @oli-obk -- there's some merge conflicts when cherry-picking onto stable, could you provide a commit/PR against stable with the merge conflicts fixed?

    FWIW, I find the notion of putting warnings or saying "don't use this release" to be something we probably don't want to do right now. We'd basically have to do so for all non-latest Rust versions; they're all "unsupported" and may contain this (or other) problems. We ourselves do not patch more than the latest stable release if CVEs are detected, generally speaking. I would also ask that further discussion about yanking releases and such be directed to an internals thread and not this issue to avoid creating noise while we resolve this bug.

  17. oli-obk commented on Jul 25, 2020

    @oli-obk
    Contributor

    on it Nevermind, @wesleywiser is already on it ❤️

  18. zhuxiujia commented on Jul 25, 2020

    @zhuxiujia
  19. llacroix commented on Jul 25, 2020

    @llacroix
  20. oli-obk commented on Jul 25, 2020

    @oli-obk
  21. jonas-schievink commented on Jul 25, 2020

    @jonas-schievink
    Contributor

    This thread has served its purpose, so locking it.

  22. locked and limited conversation to collaborators on Jul 25, 2020
  23. pnkfelix commented on Jul 30, 2020

    @pnkfelix
    Contributor

    @lcnr commented:

    This is a duplicate of the already fixed #73609

    by the way, this issue was not, technically, a duplicate of #73609.

    Or at least, the issue described in #73609 only surfaces under conditions witnessed after commit 38bd83d (PR #71911, merged on June 21st)

    bisected with cargo-bisect-rustc v0.5.2

    Host triple: x86_64-unknown-linux-gnu
    Reproduce with:

    cargo bisect-rustc 2020-04-01 --end 2020-06-22 -- run
    

    while this issue surfaces under conditions witnessed after commit 3fe4dd2 (PR #71953, merged on May 11th)

    bisected with cargo-bisect-rustc v0.5.2

    Host triple: x86_64-unknown-linux-gnu
    Reproduce with:

    cargo bisect-rustc 2020-05-01 --end 2020-06-01 -- run
    

    It does seem like the same patch (PR #73613) fixes both issues; i.e., it seems likely that there is indeed one bug underlying both distinct issues.

    But the fact that they are distinct issues helps explain why we did not backport the fix to beta way back when.

  24. added a commit that references this issue on Aug 13, 2020
  25. added a commit that references this issue on Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugI-unsoundP-criticalT-releaseregression-from-stable-to-stable

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions