Git Product home page Git Product logo

Comments (6)

siddontang avatar siddontang commented on July 30, 2024

/cc @overvenus

from rust-prometheus.

bbigras avatar bbigras commented on July 30, 2024

Be aware that there could be false positives. See https://users.rust-lang.org/t/howto-sanitize-your-rust-code/9378/22. And https://github.com/japaric/rust-san#better-backtraces could be useful too.

from rust-prometheus.

siddontang avatar siddontang commented on July 30, 2024

Thanks @BrunoQC

We will fix it later, or could you send us a PR to fix it?

from rust-prometheus.

overvenus avatar overvenus commented on July 30, 2024

Hi @BrunoQC ,

Sorry for the super late reply.

The SUMMARY indicates that the data race happens in crate lazy-static.

        unsafe {
            let r = &mut self.0;
            self.1.call_once(|| {
                *r = Box::into_raw(Box::new(f())); // write
            });

            &*self.0 // read
        }

@parched said that

This will be a false positive because drop_slow uses a fence, and tsan doesn't work with fences.

rust-lang/rust#39608 (comment)


I am not so familiar with atomic and fence, not sure if this is false positive. I will investigate further. ๐Ÿ˜„

from rust-prometheus.

parched avatar parched commented on July 30, 2024

Looks like is probably call_once. I had a look at the source though and couldn't see anything obvious, it certainly doesn't use fences that I could see. It would be good to run it with better backtraces (link earlier) to see exactly where it is happening.

from rust-prometheus.

breezewish avatar breezewish commented on July 30, 2024

Looks to be a false positive. Closing.

from rust-prometheus.

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.