DynamoRIO / DynamoRIO/drmemory

cs2bug fails under Cygwin due to system leak in std::basic_string<>::find_last_not_of

Open
#664 4 comments 0 reactions 0 assignees View on GitHub
Component-Tests Migrated OpSys-Cygwin Priority-Low
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

_From [rnk@google.com](https://code.google.com/u/rnk@google.com/) on November 02, 2011 12:38:49_

This happens on my Win7 workstation, and notably not on the bots.

This is the leak report I get:

Error `#6`: LEAK 1 direct bytes 0x00248f98-0x00248f99 + 0 indirect bytes

#0 MSVCR90.dll!aligned_offset_recalloc+0x39 (0x73403eb8 )
??:0
#1 MSVCP90.dll!std::basic_string,std::allocator >::find_last_not_of+0x1c (0x7345fed9 )
??:0
#2 MSVCP90.dll!std::messages::messages+0x11 (0x73460e39 )
??:0
#3 MSVCP90.dll!std::operator!=,std::allocator >+0x8 (0x73464d91 )
??:0
#4 MSVCP90.dll!std::basic_istream >::seekg+0x2 (0x73469d69 )
??:0
#5 MSVCP90.dll!std::moneypunct::`default constructor closure'+0x6 (0x7346cb76 )
??:0
#6 MSVCP90.dll!std::num_get > >::_Getffldx+0x140 (0x7346e961 )
??:0
#7 MSVCP90.dll!std::num_get > >::do_get+0x7a (0x734797f7 )
??:0
#8 MSVCP90.dll!std::basic_filebuf >::sync+0x30 (0x7345de48 )
??:0
#9 MSVCP90.dll!std::basic_ostream >::operator<<+0x35 (0x7347bc69 )
??:0
#10 cs2bug.exe!test_leaks+0x103 (0x00201484 )
c:\src\drmemory\tests\cs2bug.cpp:136+0x59
#11 cs2bug.exe!main+0x1c (0x0020122d )
c:\src\drmemory\tests\cs2bug.cpp:196+0x4
Note: elapsed time = 0:00:01.706 in thread 7108

I have no idea why find_last_not_of would be doing any memory allocation. IMO the correct fix is to add a default suppression like:

LEAK
name=i#NOCHECKIN: leak in find_last_not_of
...
_!std::basic_string<_>::find_last_not_of

I'll send it out for review.

_Original issue: http://code.google.com/p/drmemory/issues/detail?id=664_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.