From: Miguel O. <mig...@gm...> - 2009-05-04 15:45:39
|
On Mon, May 4, 2009 at 3:32 PM, fpga <mgb...@bl...> wrote: > > #include "sstream" > using namespace std; > int main(){ > stringstream ss; > return 0; > } > > Why does the above cause this 'bug'? Trying... $ valgrind --version valgrind-3.4.1-Debian $ g++ --version g++ (Debian 4.3.3-3) 4.3.3 $ valgrind ./a.out ... ==2990== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from 1) ==2990== malloc/free: in use at exit: 0 bytes in 0 blocks. ==2990== malloc/free: 0 allocs, 0 frees, 0 bytes allocated. ==2990== For counts of detected errors, rerun with: -v ==2990== All heap blocks were freed -- no leaks are possible. ... Which versions are you using? Is your C++ lib in good shape? > > ==4249== Invalid free() / delete / delete[] > ==4249== at 0x40052EA: operator delete(void*, std::nothrow_t const&) > (vg_replace_malloc.c:354) > ==4249== by 0x5544058: std::__verify_grouping(char const*, unsigned, > std::string const&) (locale_facets.cc:108) > ==4249== by 0x5544F8C: std::locale::_Impl::_Impl(char const*, unsigned) > (localename.cc:218) > ==4249== by 0x554500C: std::locale::_Impl::_Impl(char const*, unsigned) > (localename.cc:206) > ==4249== by 0x5546137: std::locale::locale() (localename.cc:88) > ==4249== by 0x5540B9B: std::ios_base::ios_base() (locale.cc:378) > ==4249== by 0x557EAA4: std::basic_stringstream<char, > std::char_traits<char>, std::allocator<char> >>::basic_stringstream(std::_Ios_Openmode) (istream:586) > ==4249== by 0x804863E: main (/home/me/Desktop/new_play/bug.cpp:4) > ==4249== Address 0x55dd188 is not stack'd, malloc'd or (recently) free'd > -- > View this message in context: http://www.nabble.com/Does-creating-a-stringstream-object-cause-a-leak-tp23370849p23370849.html > Sent from the Valgrind - Users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Register Now & Save for Velocity, the Web Performance & Operations > Conference from O'Reilly Media. Velocity features a full day of > expert-led, hands-on workshops and two days of sessions from industry > leaders in dedicated Performance & Operations tracks. Use code vel09scf > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |