Comments (2)
So @Dylan-Brotherston has let me know that including unistd.h
disables ASAN, but this is still detectable by valgrind, so would be good to turn that on when ASAN gets diabled?
$ dcc bug.c -o bug -fsanitize=valgrind
$ echo ABCD | ./bug
Runtime error: uninitialized variable accessed.
Execution stopped in main() in bug.c at line 11:
int main(int argc, char **argv) {
char arr[5];
fread(arr, 1, 4, stdin);
--> if (strcmp(arr, "ABCD") != 0) {
printf("match\n");
}
}
Values when execution stopped:
argc = 1
arr = "ABCD<uninitialized value>"
from dcc.
DCC has a list of "safe" includes here:
dcc/compile_time_python/options.py
Line 90 in 7ffa8c8
unistd.h
isn't in that list because some functions provided by that header will case the dual sanitizers to become unsynchronized.
in this situation when compiling only one sanitizer will be included, by default sanitizer1 is the ASAN sanitizer and ASAN cannot detect this error, MSAN or Valgrind (usually sanitizer2) can detect this error.
Explicitly setting the first sanitizer to Valgrind with -fsanitize=valgrind
fixes this issue, but then ASAN will not be running and other issues will be missed.
So currently this is intended behavior. best to run both dcc
and dcc -fsanitize=valgrind
separately in this case.
from dcc.
Related Issues (20)
- report multidimensional array bounds (incomplete type) errors better.
- can not override dcc's implict -Wunused-variable flag HOT 1
- dcc doesn't accept - for stdin HOT 1
- dcc asan fails to report uninit error when compiled with intermediary object file HOT 1
- dcc dual sanitizer desynchronization when printing pointers HOT 1
- Remap dcc++ to d++ HOT 2
- function name wrongly assumed to be printf for -Wformat-insufficient-args HOT 1
- missign function return type incorrectlky assumed for -Wimplicit-int HOT 1
- values close to the memory poison values not flagged as uninitialized HOT 1
- feature request - report pointer values as pointing to variable HOT 1
- feature request - capture stdin HOT 1
- enhancement - give specific (helpful) error for failure to null-terminate string
- fileno broken HOT 1
- printf "%s\n" of a NULL value produces incorrect explanation
- warning NULL argument for printf %s would benefit from explanation
- Request: add explanations of capabilities/limitations to README
- delayed unintialised error when writing to files
- [Docs] help2man man-page generation is missing a [DESCRIPTION] section
- a case where the expected "dcc explanation" output is not generated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dcc.