Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMemorySanitizer detects an use of unitialized value in the test runner (`rustc --test`) #39610
Comments
This comment has been minimized.
This comment has been minimized.
|
Naively I'd say this is a false positive, but I could be wrong! This stack trace looks familiar, though, as I think I've seen it in terms of valgrind warnings in the past as well. (although I think those may have been false positives as well) |
alexcrichton
referenced this issue
Feb 7, 2017
Open
ThreadSanitizer detects a data race in the test runner (`rustc --test`) #39608
This comment has been minimized.
This comment has been minimized.
dimbleby
commented
Feb 17, 2017
I'm guessing that we're just using the regular libc? Also, here is much the same thing happening in another project. |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the info @dimbleby! Right now I believe the standard library is not compiled with @japaric WDYT about modifying After that I think we could generate a nicer error up front saying "not everything is compiled with the memory sanitizer" than perhaps deferring this to runtime. |
This comment has been minimized.
This comment has been minimized.
dimbleby
commented
Feb 18, 2017
|
Not sure whether we're at cross purposes, but just to make sure: I wasn't talking about the Rust standard library but the regular C libc - which is, I suppose, where the Having said that, it sounds as though both would need to be instrumented for the memory sanitizer to give reliable results... |
This comment has been minimized.
This comment has been minimized.
I think this is the root of the problem because if you run the sanitizer using Xargo, to force intrumentation of the whole std facade, then there's no error. @dimbleby I don't think one needs to compile libc with -fsanitize=memory as the sanitizer runtime that we link already instruments most of libc functions (memcpy, memchr, etc.) by overriding those symbols. The example you linked doesn't recompile libc either. We should, though, compile other C libraries that get linked to the final executable with -fsanitize=memory. I think that could be handled with a
We can't ship a
Interesting. I didn't know about that. I'll take a look. Do you know if that also forces the recompilation of functions that are already contained in e.g.
Do you mean making it so that a crate won't compile with |
This comment has been minimized.
This comment has been minimized.
Excellent point! Although unless we could ship two libstd builds and select between them dynamically (yeah let's not do that)
Yeah the "recompilation" here is that we build a massive wad of LLVM IR representing the entire world of Rust, we then optimize it all again, and then emit object code again. That re-codegens the entire world, but doesn't "recompile" the entire world (depending on your definition)
Yeah that's what I'm thinking. Unless all libraries are compiled with the right sanitizer then this is basically guaranteed to return false positives and errors, right? |
Mark-Simulacrum
added
A-libtest
A-sanitizers
labels
Jun 23, 2017
This comment has been minimized.
This comment has been minimized.
|
Is there a way to pass |
Mark-Simulacrum
added
the
C-bug
label
Jul 27, 2017
This comment has been minimized.
This comment has been minimized.
What we could do is add targets for sanitized builds. I want to just |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton how hard would it be to add a new target: The memory sanitizer is Linux-only, and probably |
This comment has been minimized.
This comment has been minimized.
|
It unfortunately wouldn't be the easiest thing but it also woudln't necessarily be too hard. It's definitely pretty hard to "do on a whim", so we'd want to commit to the design before doing so. |
japaric commentedFeb 7, 2017
•
edited
STR
Meta
TODO Sanitizers are not yet in tree. (cf. #38699)
cc @alexcrichton @brson