Skip to content

Valgrind: Invalid reads on empty program. #14784

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

Closed
KokaKiwi opened this issue Jun 10, 2014 · 0 comments · Fixed by #14787
Closed

Valgrind: Invalid reads on empty program. #14784

KokaKiwi opened this issue Jun 10, 2014 · 0 comments · Fixed by #14787

Comments

@KokaKiwi
Copy link

When compiling a simple:

fn main() {
}

Valgrind print some invalid reads at execution:

==15175== Invalid read of size 4
==15175== at 0x5041F00: __pthread_mutex_unlock_usercnt (in /usr/lib/libpthread-2.19.so)
==15175== by 0x4640E5: cleanup::h8314b69d20f4266bUyd::v0.11.0.pre (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x444D90: start::hf019bd0d44c53e2arne::v0.11.0.pre (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x444B38: lang_start::h07173657fd6aab66Lme::v0.11.0.pre (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x4030FE: main (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== Address 0x600e110 is 16 bytes inside a block of size 128 free'd
==15175== at 0x46EA39: je_dallocx (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x4640DD: cleanup::h8314b69d20f4266bUyd::v0.11.0.pre (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x444D90: start::hf019bd0d44c53e2arne::v0.11.0.pre (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x444B38: lang_start::h07173657fd6aab66Lme::v0.11.0.pre (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x4030FE: main (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175==
==15175== Invalid read of size 4
==15175== at 0x5041BB0: __pthread_mutex_unlock_full (in /usr/lib/libpthread-2.19.so)
==15175== by 0x4640E5: cleanup::h8314b69d20f4266bUyd::v0.11.0.pre (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x444D90: start::hf019bd0d44c53e2arne::v0.11.0.pre (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x444B38: lang_start::h07173657fd6aab66Lme::v0.11.0.pre (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x4030FE: main (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== Address 0x600e110 is 16 bytes inside a block of size 128 free'd
==15175== at 0x46EA39: je_dallocx (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x4640DD: cleanup::h8314b69d20f4266bUyd::v0.11.0.pre (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x444D90: start::hf019bd0d44c53e2arne::v0.11.0.pre (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x444B38: lang_start::h07173657fd6aab66Lme::v0.11.0.pre (in /tmp/tmpm0d_76im/invalid_read_mutex/main)
==15175== by 0x4030FE: main (in /tmp/tmpm0d_76im/invalid_read_mutex/main)

The full output: https://gist.github.com/KokaKiwi/bcf0fefc8068259115d9

My rustc version:

$ rustc --version
rustc 0.11.0-pre-nightly (7580ef9 2014-06-08 00:46:57 -0700)
host: x86_64-unknown-linux-gnu
alexcrichton added a commit to alexcrichton/rust that referenced this issue Jun 10, 2014
This is another case of rust-lang#13246. The RAII lock wasn't being destroyed until after
the allocation was free'd due to destructor scheduling.

Closes rust-lang#14784
bors added a commit that referenced this issue Jun 11, 2014
This is another case of #13246. The RAII lock wasn't being destroyed until after
the allocation was free'd due to destructor scheduling.

Closes #14784
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant