Giter Site home page Giter Site logo

Comments (5)

mkroening avatar mkroening commented on May 20, 2024 1

Bisecting nightly releases shows that the issue appears when upgrading RustyHermit from nightly-2021-03-22 to nightly-2021-03-23 as demonstrated in #134. I'll have to investigate, what happened in that night (rust-lang/rust@f826641...5d04957).

from hermit-rs.

mkroening avatar mkroening commented on May 20, 2024

Ah, indeed code related to network changed, in hermit-os/kernel@5f2d3b1...44eaa9f, but GitHub does not show the diff nicely.

Edit: Nevermind, I was just confused by the force-push in libhermit and git diff... I have no idea, what could be the cause of this issue. 🤔

from hermit-rs.

mkroening avatar mkroening commented on May 20, 2024

I found the cause. Mutable noalias has been enabled by default in rust-lang/rust@39ed643. Reverting to the old behavior via RUSTFLAGS="-Zmutable-noalias=no" works around the issue and network works again, but can't be considered a proper fix.

Mutable noalias has enabled further optimizations of the reads and writes in ComCfg::dev_features, even in debug mode. Making them volatile, as they should be, solves the issue. Inserting debugging prints of self.com_cfg.device_feature_select does too, making this a prime example of a Heisenbug.

I'll look into proper abstractions for volatile memory access, so we can prevent this from happening in other places as well.

from hermit-rs.

stlankes avatar stlankes commented on May 20, 2024

May be gnoliyil/fuchsia@914bdaf helps to understand the problem.

from hermit-rs.

mkroening avatar mkroening commented on May 20, 2024

Thanks for the Link!

I think, we are not facing a miscompilation here though. A fix for that specific issue is in place since nightly-2021-05-14 (rust-lang/rust#84958 (comment), we are on nightly-2021-05-19). Also, our issue also exists in debug.

In the long term we should make sure to make all memory-mapped I/O accesses volatile, but to get things working again as soon as possible, we might want to disable mutable-noalias until we have a proper fix. I'll create tracking issues and PRs.

from hermit-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.