DynamoRIO / DynamoRIO/drmemory
UNADDR and UNINIT in VC++ runtime uninit reporting path
- Dominant language
- C
- Stars
- 2.7k
- Forks
- 290
- PR merge metrics
- No merged PRs in 30d
Description
_From [derek.br...@gmail.com](https://code.google.com/u/117968039472581148324/) on December 10, 2010 17:58:12_
PR 502171
xref PR 473614
using the app from PR 502149:
/\* cl assert1.c -MDd -Zi -RTC1 */
int main(void)
{
int x[2];
return x[1000];
}
when compiled with -RTC1, cl inserts checks and detects the unint error
before it happens, so drmem doesn't report it:
---
Microsoft Visual C++ Debug Library
---
Debug Error!
Program: d:\derek\dr\test\bradassert.exe
Module: d:\derek\dr\test\bradassert.exe
File: d:\derek\dr\test\bradassert.c
Line: 6
Run-Time Check Failure `#3` - The variable 'x' is being used without being initialized.
(Press Retry to debug the application)
---
Abort Retry Ignore
---
but, drmem does report a ton of errors on the detect/report path:
:::Dr.Memory::: ERRORS FOUND:
:::Dr.Memory::: 201 unaddressable access(es)
:::Dr.Memory::: 583 uninitialized access(es)
:::Dr.Memory::: 0 invalid free(s)
:::Dr.Memory::: 0 warning(s)
:::Dr.Memory::: 11 leak(s)
:::Dr.Memory::: (re-run with "-check_leaks" for details)
:::Dr.Memory::: 26 possible leak(s)
:::Dr.Memory::: (re-run with "-check_leaks -possible_leaks" for details)
when built w/o -RTC1 we do detect the unaddr, along with a handful of
errors, probably on the msgbox that pops up on reporting the crash to MS:
:::Dr.Memory::: ERRORS FOUND:
:::Dr.Memory::: 4 unaddressable access(es)
:::Dr.Memory::: 7 uninitialized access(es)
:::Dr.Memory::: 0 invalid free(s)
:::Dr.Memory::: 0 warning(s)
:::Dr.Memory::: 1 leak(s)
:::Dr.Memory::: (re-run with "-check_leaks" for details)
:::Dr.Memory::: 0 possible leak(s)
:::Dr.Memory::: (re-run with "-check_leaks -possible_leaks" for details)
Error `#1`: UNADDRESSABLE ACCESS 1 byte(s)
0x00401016 bradassert.exe!main+0x6
d:\derek\dr\test\bradassert.c:6+0x0
0x004012e6 bradassert.exe!__tmainCRTStartup+0x1a6
f:\sp\vctools\crt_bld\self_x86\crt\src\crtexe.c:597+0x19
0x0040113d bradassert.exe!mainCRTStartup+0xd
f:\sp\vctools\crt_bld\self_x86\crt\src\crtexe.c:414+0x0
0x7d4e7d42 KERNEL32.dll!BaseProcessInitPostImport+0x8d
??:0
_Original issue: http://code.google.com/p/drmemory/issues/detail?id=169_
Contributor guide
Assessment
This issue has not been assessed yet.