-
Notifications
You must be signed in to change notification settings - Fork 262
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
until have bit granularity, use heuristics for typical bitfield code to avoid false pos at potential false neg risk #849
Comments
From [email protected] on March 27, 2012 13:18:19 testing a bit in a dword ends up compiled down to OP_and or OP_test with a constant that contains at least one zero bit. the result thus has at least one bit set. but treating that whole result byte as defined is unacceptable as the tool will then not catch a bug where a completely undefined value is tested for having a bit set. for non-/GL V8 and most bitfields, relaxing the combination rules for OP_or to "def + undef => def" could be a hack that might work w/o too many false negatives (under an option of course). however, for /GL V8 (our release build), the bitfields are initialized using the xor sequence seen in issue #489 : bitvar = ((bitvar ^ value) & bitcoverage) ^ bitvar (keeps the non-bitfield bits of bitvar unchanged and sets the bitfield bits of bitvar to the bitfield bits of value) bit-level granularity actually would NOT solve this, and as pointed out in issue #489 memcheck doesn't handle this either. this is the type of optimized code that thwarts these tools. we could try to pattern-match it as mentioned in issue #489 , or remove /GL. Summary: until have bit granularity, use heuristics for typical bitfield code to avoid false pos at potential false neg risk |
From [email protected] on March 28, 2012 13:14:38 *** DONE have DR work on non-xor sequences: OP_or and OP_and easy to impl since in slowpath. note that relaxing to allow OP_or with a should we require the undef side to be at least partially defined? no, b/c so basically I'm re-writing the rules for combining operands via OP_or: **** DONE handle OP_and init of bitfield from V8 code above: how tell difference between this OP_and and an OP_and that's a test? rely **** TODO what are the expected false negatives from this? what code uses OP_or? how about OP_and with multi-1-bit mask? all our tests pass **** DONE evaluate on V8 => eliminates all % ~/drmemory/git/build_drmemory/bin/drmemory.exe -pause_at_assert -batch -no_results_to_stderr -dr e:/src/dr/git/exports -- ./unit_tests.exe --gtest_filter="FrameworkUnitTest.*" HEAD: just OP_or relaxation, on FrameworkUnitTest Debug: 115 of those 117 are some variant of no errors in my bitv8.cpp (compiled just /O2 so has sequence similar to investigating further: it's the OP_and init of the default constructor adding in OP_and: **** TODO evaluate on riched (issue #791) => eliminates some % ~/drmemory/git/build_drmemory/bin/drmemory.exe -strict_bitops -pause_at_assert -batch -no_results_to_stderr -dr e:/src/dr/git/exports -- ./unit_tests.exe --gtest_filter="GenericInfoViewTest.GenericInfoView" -strict_bitops: some of the remaining are uninits in riched.dll. **** DONE evaluate on issue #493 => eliminates all usp10 and other uninits % bin/drmemory.exe -strict_bitops -batch -dr e:/src/dr/git/exports -- e:/src/dr/test/gui-inject.exe % bin/drmemory.exe -batch -dr e:/src/dr/git/exports -- e:/src/dr/test/gui-inject.exe but I'm inclined to leave the default supp for cases where people turn on **** DONE evaluate on issue #497 => eliminated % bin/drmemory.exe -strict_bitops -batch -dr e:/src/dr/git/exports -- calc % bin/drmemory.exe -batch -dr e:/src/dr/git/exports -- calc **** TODO put check for one side of OP_or being defined on fastpath? fixes issue #849 + add option -strict_bitops, off by default, and when on
|
From [email protected] on March 28, 2012 15:04:53 This issue was closed by revision r812 . Status: Fixed |
From [email protected] on March 27, 2012 11:11:05
I implemented DrMem under the assumption I'd immediately add bit-level granularity but that never became high priority b/c all the target apps up to this point had very, very few bitfields or other features that need bit-level granularity, but we're starting to hit such issues ( issue #792 , issue #412 in system libs, issue #513 in V8).
until we have issue #113 one proposal has been to set the full byte as defined if any bit is set. there are very simple ways to do this but they may give up too much accuracy and add too many false negatives on bit tests. currently investigating.
Original issue: http://code.google.com/p/drmemory/issues/detail?id=849
The text was updated successfully, but these errors were encountered: