From: Sahni, J. <jit...@cr...> - 2007-12-20 12:56:05
|
I found another way to disable memory caching in stl ( under gcc ), without rebuilding everything Refer : http://gcc.gnu.org/onlinedocs/libstdc++/20_util/allocator.html ""Starting with GCC 3.2, and continued in the 3.3 series, to globally disable memory caching within the library for the default allocator, merely set GLIBCPP_FORCE_NEW (at this time, with any value) in the system's environment before running the program. If your program crashes with GLIBCPP_FORCE_NEW in the environment, it likely means that you linked against objects built against the older library. Code to support this extension is fully compatible with 3.2 code if GLIBCPP_FORCE_NEW is not in the environment. As it turns out, the 3.4 code base continues to use this mechanism, only the environment variable has been changed to GLIBCXX_FORCE_NEW "" Will experiment with this approach and see if this helps Jitan -----Original Message----- From: Paul Pluzhnikov [mailto:ppl...@gm...] Sent: Wednesday, December 19, 2007 8:55 PM To: Sahni, Jitan Cc: val...@li...; val...@li... Subject: Re: [Valgrind-users] Valgrind memcheck and std map and array array bounds checking On Dec 19, 2007 1:39 PM, Sahni, Jitan <jit...@cr...> wrote: > is there any way in memcheck to detect out of bound array access, when using > stl objects like std::string and std::map ? No, but many such bugs can easily be detected by building with -D_GLIBCXX_DEBUG (when using recent g++ versions). See http://gcc.gnu.org/onlinedocs/libstdc++/debug_mode.html Also, there is no such thing as "out of bound array access" when using std::map, is there? Cheers, ============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ============================================================================== |