Skip to content

Thread Sanitizer - Data race reserve_inner #540

Closed
@drconopoima

Description

@drconopoima

Hello, I wish you a nice day

I have run my personal project newsletter-rs

https://github.com/drconopoima/newsletter-rs

through thread sanitizer as detailed here https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html

I'm spawning a thread blocking to perform tokio-postgres cached statement queries in background to continuously assert the health of the postgres database.

It detects the data race at this line, on dependency Bytes 1.1.0

https://github.com/sfackler/rust-postgres/blob/38da7fa8fe0067f47b60c147ccdaa214ab5f5211/postgres-protocol/src/message/backend.rs#L115

I'm able to reproduce reliably like:

git clone https://github.com/drconopoima/newsletter-rs --branch bytes_reserve --depth 1
cd newsletter-rs
export RUSTFLAGS=-Zsanitizer=thread RUSTDOCFLAGS=-Zsanitizer=thread
cargo +nightly run -Zbuild-std --target x86_64-unknown-linux-gnu

The complete thread sanitizer output:

threadsanitizer.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions