[Owasp-esapi-c++] Test Suite and Valgrind

Jeffrey Walton noloader at gmail.com
Fri Apr 9 12:36:53 EDT 2004


Hi All,

I'm trying to run the test suite through Valgrind. I have *never* seen
so many reported issues. I don't know how many precisely, but the
console spits out between 10,000 and 20,000 lines.

When I run a hand crafted test using TestMainWin32.cpp (providing
main()), I get about 30 lines of verbose preamble and no issues.

Does anyone have a Boost suppression file or know how to clear *en
masse* errors reported against Boost::Test?

Jeff

owasp-esapi-c++$ valgrind -v --tool=memcheck --leak-check=full
--show-reachable=yes test/run_esapi_tests

...
Running 28 test cases...
==8525== Warning: silly arg (-16384) to __builtin_new()
**8525** new/new[] failed and should throw an exception, but Valgrind
==8525==    at 0x402513F: VALGRIND_PRINTF_BACKTRACE (valgrind.h:4214)
==8525==    by 0x40256CC: operator new(unsigned int) (vg_replace_malloc.c:255)
==8525==    by 0x809F266:
esapi::zallocator<Useless>::allocate(unsigned int, void const*)
(zAllocator.h:71)
==8525==    by 0x809CF95: std::__norm::_Vector_base<Useless,
esapi::zallocator<Useless> >::_M_allocate(unsigned int)
(stl_vector.h:140)
==8525==    by 0x809B465: std::__norm::_Vector_base<Useless,
esapi::zallocator<Useless> >::_Vector_base(unsigned int,
esapi::zallocator<Useless> const&) (stl_vector.h:113)
==8525==    by 0x8099A1E: std::__norm::vector<Useless,
esapi::zallocator<Useless> >::vector(unsigned int, Useless const&,
esapi::zallocator<Useless> const&) (stl_vector.h:229)
==8525==    by 0x8097AB9: std::__debug::vector<Useless,
esapi::zallocator<Useless> >::vector(unsigned int, Useless const&,
esapi::zallocator<Useless> const&) (vector:79)
==8525==    by 0x8091E7C: VerifyAllocationWrap() (zAllocatorTest.cpp:79)
==8525==    by 0x8091DA9: VerifyAllocator::test_method() (zAllocatorTest.cpp:64)
==8525==    by 0x8091CC1: VerifyAllocator_invoker() (zAllocatorTest.cpp:60)
==8525==    by 0x806D10C: boost::unit_test::ut_detail::unused
boost::unit_test::ut_detail::invoker<boost::unit_test::ut_detail::unused>::invoke<void
(*)()>(void (*&)()) (callback.hpp:56)
==8525==    by 0x806D020:
boost::unit_test::ut_detail::callback0_impl_t<boost::unit_test::ut_detail::unused,
void (*)()>::invoke() (callback.hpp:89)
**8525**    cannot throw exceptions and so is aborting instead.  Sorry.
==8525==    at 0x402513F: VALGRIND_PRINTF_BACKTRACE (valgrind.h:4214)
==8525==    by 0x40256DA: operator new(unsigned int) (vg_replace_malloc.c:255)
==8525==    by 0x809F266:
esapi::zallocator<Useless>::allocate(unsigned int, void const*)
(zAllocator.h:71)
==8525==    by 0x809CF95: std::__norm::_Vector_base<Useless,
esapi::zallocator<Useless> >::_M_allocate(unsigned int)
(stl_vector.h:140)
==8525==    by 0x809B465: std::__norm::_Vector_base<Useless,
esapi::zallocator<Useless> >::_Vector_base(unsigned int,
esapi::zallocator<Useless> const&) (stl_vector.h:113)
==8525==    by 0x8099A1E: std::__norm::vector<Useless,
esapi::zallocator<Useless> >::vector(unsigned int, Useless const&,
esapi::zallocator<Useless> const&) (stl_vector.h:229)
==8525==    by 0x8097AB9: std::__debug::vector<Useless,
esapi::zallocator<Useless> >::vector(unsigned int, Useless const&,
esapi::zallocator<Useless> const&) (vector:79)
==8525==    by 0x8091E7C: VerifyAllocationWrap() (zAllocatorTest.cpp:79)
==8525==    by 0x8091DA9: VerifyAllocator::test_method() (zAllocatorTest.cpp:64)
==8525==    by 0x8091CC1: VerifyAllocator_invoker() (zAllocatorTest.cpp:60)
==8525==    by 0x806D10C: boost::unit_test::ut_detail::unused
boost::unit_test::ut_detail::invoker<boost::unit_test::ut_detail::unused>::invoke<void
(*)()>(void (*&)()) (callback.hpp:56)
==8525==    by 0x806D020:
boost::unit_test::ut_detail::callback0_impl_t<boost::unit_test::ut_detail::unused,
void (*)()>::invoke() (callback.hpp:89)
==8525==
==8525== HEAP SUMMARY:
==8525==     in use at exit: 59,931 bytes in 2,155 blocks
==8525==   total heap usage: 2,690 allocs, 535 frees, 292,067 bytes allocated
==8525==
==8525== 1 bytes in 1 blocks are still reachable in loss record 1 of 993
==8525==    at 0x402532E: operator new[](unsigned int) (vg_replace_malloc.c:299)
==8525==    by 0x44A8ACC: T.6066 (argv_traverser.ipp:58)
==8525==    by 0x44AE689: boost::unit_test::runtime_config::init(int&,
char**) (unit_test_parameters.ipp:305)
==8525==    by 0x4493E35: boost::unit_test::framework::init(bool
(*)(), int, char**) (framework.ipp:232)
==8525==    by 0x44A1B4F: boost::unit_test::unit_test_main(bool (*)(),
int, char**) (unit_test_main.ipp:177)
==8525==    by 0x8067602: main (unit_test.hpp:59)
==8525==
==8525== 4 bytes in 1 blocks are still reachable in loss record 2 of 993
==8525==    at 0x402569A: operator new(unsigned int) (vg_replace_malloc.c:255)
==8525==    by 0x44A05F3:
boost::unit_test::unit_test_log_t::set_format(boost::unit_test::output_format)
(unit_test_log.ipp:412)
==8525==    by 0x4493E63: boost::unit_test::framework::init(bool
(*)(), int, char**) (framework.ipp:236)
==8525==    by 0x44A1B4F: boost::unit_test::unit_test_main(bool (*)(),
int, char**) (unit_test_main.ipp:177)
==8525==    by 0x8067602: main (unit_test.hpp:59)
==8525==
==8525== 8 bytes in 1 blocks are still reachable in loss record 3 of 993
==8525==    at 0x402569A: operator new(unsigned int) (vg_replace_malloc.c:255)
==8525==    by 0x448D562: void
boost::unit_test::callback1<boost::debug::dbg_startup_info const&,
boost::unit_test::ut_detail::unused>::operator=<void
(*)(boost::debug::dbg_startup_info const&)>(void
(*)(boost::debug::dbg_startup_info const&)) (callback.hpp:174)
==8525==    by 0x448C247: global constructors keyed to debug.cpp (debug.ipp:613)
==8525==    by 0x44D36EC: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x4487423: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x400DBBB: call_init (dl-init.c:70)
==8525==    by 0x400DCD8: _dl_init (dl-init.c:134)
==8525==    by 0x400088E: ??? (in /lib/ld-2.11.1.so)
==8525==
==8525== 8 bytes in 1 blocks are still reachable in loss record 4 of 993
==8525==    at 0x402569A: operator new(unsigned int) (vg_replace_malloc.c:255)
==8525==    by 0x448C2A1: global constructors keyed to debug.cpp
(callback.hpp:174)
==8525==    by 0x44D36EC: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x4487423: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x400DBBB: call_init (dl-init.c:70)
==8525==    by 0x400DCD8: _dl_init (dl-init.c:134)
==8525==    by 0x400088E: ??? (in /lib/ld-2.11.1.so)
==8525==
==8525== 8 bytes in 1 blocks are still reachable in loss record 5 of 993
==8525==    at 0x402569A: operator new(unsigned int) (vg_replace_malloc.c:255)
==8525==    by 0x448C386: global constructors keyed to debug.cpp
(callback.hpp:174)
==8525==    by 0x44D36EC: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x4487423: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x400DBBB: call_init (dl-init.c:70)
==8525==    by 0x400DCD8: _dl_init (dl-init.c:134)
==8525==    by 0x400088E: ??? (in /lib/ld-2.11.1.so)
==8525==
==8525== 8 bytes in 1 blocks are still reachable in loss record 6 of 993
==8525==    at 0x402569A: operator new(unsigned int) (vg_replace_malloc.c:255)
==8525==    by 0x448C46B: global constructors keyed to debug.cpp
(callback.hpp:174)
==8525==    by 0x44D36EC: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x4487423: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x400DBBB: call_init (dl-init.c:70)
==8525==    by 0x400DCD8: _dl_init (dl-init.c:134)
==8525==    by 0x400088E: ??? (in /lib/ld-2.11.1.so)
==8525==
==8525== 8 bytes in 1 blocks are still reachable in loss record 7 of 993
==8525==    at 0x402569A: operator new(unsigned int) (vg_replace_malloc.c:255)
==8525==    by 0x448C550: global constructors keyed to debug.cpp
(callback.hpp:174)
==8525==    by 0x44D36EC: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x4487423: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x400DBBB: call_init (dl-init.c:70)
==8525==    by 0x400DCD8: _dl_init (dl-init.c:134)
==8525==    by 0x400088E: ??? (in /lib/ld-2.11.1.so)
==8525==
==8525== 8 bytes in 1 blocks are still reachable in loss record 8 of 993
==8525==    at 0x402569A: operator new(unsigned int) (vg_replace_malloc.c:255)
==8525==    by 0x448C635: global constructors keyed to debug.cpp
(callback.hpp:174)
==8525==    by 0x44D36EC: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x4487423: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x400DBBB: call_init (dl-init.c:70)
==8525==    by 0x400DCD8: _dl_init (dl-init.c:134)
==8525==    by 0x400088E: ??? (in /lib/ld-2.11.1.so)
==8525==
==8525== 8 bytes in 1 blocks are still reachable in loss record 9 of 993
==8525==    at 0x402569A: operator new(unsigned int) (vg_replace_malloc.c:255)
==8525==    by 0x448C71A: global constructors keyed to debug.cpp
(callback.hpp:174)
==8525==    by 0x44D36EC: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x4487423: ??? (in
/usr/lib/libboost_unit_test_framework.so.1.40.0)
==8525==    by 0x400DBBB: call_init (dl-init.c:70)
==8525==    by 0x400DCD8: _dl_init (dl-init.c:134)
==8525==    by 0x400088E: ??? (in /lib/ld-2.11.1.so)
==8525==
==8525== 8 bytes in 1 blocks are still reachable in loss record 10 of 993
...


More information about the Owasp-esapi-c++ mailing list