DynamoRIO / DynamoRIO/drmemory
[win32] cs2bug std::string alloc callstack messed up
- 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:25_
PR 587093
For PR 576032 I added a test of std::string to tests/cs2bug.cpp
and it works great on Linux.
But on Windows, instead of the expected (and what we see on Linux):
Error `#3`: LEAK 4 direct bytes + 0 indirect bytes
cs2bug.cpp:79
Error `#4`: LEAK 4 direct bytes + 19 indirect bytes
cs2bug.cpp:93
We see a weird callstack:
Error `#3`: LEAK 4 direct bytes 0x000a9558-0x000a955c + 0 indirect bytes
0x00411854 cs2bug.exe!malloc
f:\sp\vctools\crt_bld\self_x86\crt\src\malloc.c:163
0x7d4d8de9 KERNEL32.dll!FlsGetValue
??:0
0x00439c5c cs2bug.exe!SetEnvironmentVariableA
??:0
0x00411580 cs2bug.exe!ValidateLocalCookies
??:0
0x7d4d89b4 KERNEL32.dll!MulDiv
??:0
and:
Duplicate leak of 28 (0 indirect) bytes:
symbol e:\derek\dr\build_suite\build_drmemory-debug-32\tests\cs2bug.exe+0x11854 => malloc+0x7a
(0x117da-0x1189d)
symbol C:\WINDOWS\syswow64\kernel32.dll+0x18de8 => FlsGetValue+0x4b (0x18d9d-0x18de9)
symbol e:\derek\dr\build_suite\build_drmemory-debug-32\tests\cs2bug.exe+0x39c5b => SetEnvironm
entVariableA+0xa8ab (0x2f3b0-0x2f3b6)
symbol e:\derek\dr\build_suite\build_drmemory-debug-32\tests\cs2bug.exe+0x1157f => ValidateLoc
alCookies+0x2f (0x11550-0x11574)
symbol C:\WINDOWS\syswow64\kernel32.dll+0x189b3 => MulDiv+0x174 (0x1883f-0x18bcf)
0x00411854 cs2bug.exe!malloc
f:\sp\vctools\crt_bld\self_x86\crt\src\malloc.c:163
0x7d4d8de9 KERNEL32.dll!FlsGetValue
??:0
0x00439c5c cs2bug.exe!SetEnvironmentVariableA
??:0
0x00411580 cs2bug.exe!ValidateLocalCookies
??:0
0x7d4d89b4 KERNEL32.dll!MulDiv
??:0
are the callstacks messed up somehow from some weird new()
behavior and that's why they show up as dups?
the lack of indirect bytes for the string could just be
differences in how string copy constructor is implemented.
malloc-post 0x000a9558-0x000a955c = 0x4 (really 0x000a9550-0x000a9564 0x14)
malloc-post changing from 0x000a9550 to 0x000a9558
find_next_fp b/c starting w/ non-fp ebp
find_next_fp b/c hit bad non-zero fp
truncating callstack: can't find next fp
MALLOC 0x000a9558-0x000a955c
symbol e:\derek\dr\build_suite\build_drmemory-debug-32\tests\cs2bug.exe+0x11854 => malloc+0x7a
(0x117da-0x1189d)
find_next_fp b/c starting w/ non-fp ebp
symbol C:\WINDOWS\syswow64\kernel32.dll+0x18de8 => FlsGetValue+0x4b (0x18d9d-0x18de9)
symbol e:\derek\dr\build_suite\build_drmemory-debug-32\tests\cs2bug.exe+0x39c5b => SetEnvironm
entVariableA+0xa8ab (0x2f3b0-0x2f3b6)
symbol e:\derek\dr\build_suite\build_drmemory-debug-32\tests\cs2bug.exe+0x1157f => ValidateLoc
alCookies+0x2f (0x11550-0x11574)
symbol C:\WINDOWS\syswow64\kernel32.dll+0x189b3 => MulDiv+0x174 (0x1883f-0x18bcf)
find_next_fp b/c hit bad non-zero fp
truncating callstack: can't find next fp
0x00411854 cs2bug.exe!malloc
f:\sp\vctools\crt_bld\self_x86\crt\src\malloc.c:163
fp=0x00ddfeb8 parent=0x00ddff64 0x7d4d8de9 KERNEL32.dll!FlsGetValue
??:0
fp=0x00ddff64 parent=0x00ddffb0 0x00439c5c cs2bug.exe!SetEnvironmentVaria
bleA
??:0
fp=0x00ddffb0 parent=0x00ddffe0 0x00411580 cs2bug.exe!ValidateLocalCookie
s
??:0
fp=0x00ddffe0 parent=0xffffffff 0x7d4d89b4 KERNEL32.dll!MulDiv
??:0
_Original issue: http://code.google.com/p/drmemory/issues/detail?id=193_
Contributor guide
Assessment
This issue has not been assessed yet.