Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   cmake + google test: weirdo dependency (http://www.velocityreviews.com/forums/t754705-cmake-google-test-weirdo-dependency.html)

Giovanni Azua 10-08-2011 01:00 PM

cmake + google test: weirdo dependency
 
Hello all,

I setup a project using cmake and google test for a Fast Multipole
implementation I am working on (graduate study project). It is working fine
however when I run valgrind checking for memory leaks or using callgrind I
find some weirdo ImageLoaderMachO code (see output below) I have done all
kind of searches but can't find where such junk comes from :(((

find . \( -not -path "*svn*" \) -exec grep -Hi "image" {} \;

Likewise, searching for "loadermacho" "library" etc doesn't bring any clues
as to where this junk is coming from? Would this be a dependency of Google
Test maybe?

TIA,
Best regards,
Giovanni

/Users/bravegag/code/mmc11/trunk/build$ valgrind --tool=memcheck
--leak-check=full --show-reachable=yes --dsymutil=yes ./test_tree
==17516== Memcheck, a memory error detector
==17516== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==17516== Using Valgrind-3.7.0.SVN and LibVEX; rerun with -h for copyright
info
==17516== Command: ./test_tree
==17516==
Running main() from gtest_main.cc
[==========] Running 4 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 4 tests from TreeTest
[ RUN ] TreeTest.UniformDistribution
Particles per box:
9 6 6 4 9 6 6 4 9 6 6 4 9 6 6 4
[ OK ] TreeTest.UniformDistribution (153 ms)
[ RUN ] TreeTest.LineUniformDistribution
Particles per box:
0 0 0 0 0 0 6 7 0 0 6 6 0 0 0 0 6 7 0 0 6 6 0 0 0 0 0 0 6 7 0 0 6 6 0 0 0 0
6 7 0 0 6 6 0 0
[ OK ] TreeTest.LineUniformDistribution (29 ms)
[ RUN ] TreeTest.LineDiagUniformDistribution
Particles per box:
0 0 1 0 6 6 0 0 6 6 0 0 1 0 6 6 0 0 6 6 0 0 0 0 1 0 6 6 0 0 6 6 0 0 1 0 6 6
0 0 6 6 0 0 0 0
[ OK ] TreeTest.LineDiagUniformDistribution (30 ms)
[ RUN ] TreeTest.SmallUniformDistribution
Particles per box:
0 0 10 4 6 6 9 4 4 6 6 4 6 6 9 4 4 6 6 0 0 0
[ OK ] TreeTest.SmallUniformDistribution (23 ms)
[----------] 4 tests from TreeTest (257 ms total)

[----------] Global test environment tear-down
[==========] 4 tests from 1 test case ran. (332 ms total)
[ PASSED ] 4 tests.
==17516==
==17516== HEAP SUMMARY:
==17516== in use at exit: 6,317 bytes in 29 blocks
==17516== total heap usage: 1,187 allocs, 1,158 frees, 346,982 bytes
allocated
==17516==
==17516== 8 bytes in 1 blocks are still reachable in loss record 1 of 9
==17516== at 0xD62F: malloc (vg_replace_malloc.c:266)
==17516== by 0x7FFF5FC11B9E: malloc (in /usr/lib/dyld)
==17516== by 0x7FFF5FC19BB2: operator new(unsigned long) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC080F2: std::vector<char const*
(*)(dyld_image_states, unsigned int, dyld_image_info const*),
std::allocator<char const* (*)(dyld_image_states, unsigned int,
dyld_image_info const*)> >::_M_insert_aux(__gnu_cxx::__normal_iterator<ch ar
const* (**)(dyld_image_states, unsigned int, dyld_image_info const*),
std::vector<char const* (*)(dyld_image_states, unsigned int, dyld_image_info
const*), std::allocator<char const* (*)(dyld_image_states, unsigned int,
dyld_image_info const*)> > >, char const* (* const&)(dyld_image_states,
unsigned int, dyld_image_info const*)) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC081D4: std::vector<char const*
(*)(dyld_image_states, unsigned int, dyld_image_info const*),
std::allocator<char const* (*)(dyld_image_states, unsigned int,
dyld_image_info const*)> >::insert(__gnu_cxx::__normal_iterator<char const*
(**)(dyld_image_states, unsigned int, dyld_image_info const*),
std::vector<char const* (*)(dyld_image_states, unsigned int, dyld_image_info
const*), std::allocator<char const* (*)(dyld_image_states, unsigned int,
dyld_image_info const*)> > >, char const* (* const&)(dyld_image_states,
unsigned int, dyld_image_info const*)) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0546F:
dyld::registerImageStateBatchChangeHandler(dyld_im age_states, char const*
(*)(dyld_image_states, unsigned int, dyld_image_info const*)) (in
/usr/lib/dyld)
==17516== by 0x1BFACB: dyld_register_image_state_change_handler (in
/usr/lib/system/libdyld.dylib)
==17516== by 0x1C0ACB: _dyld_initializer (in
/usr/lib/system/libdyld.dylib)
==17516== by 0x1AE73: libSystem_initializer (in
/usr/lib/libSystem.B.dylib)
==17516== by 0x7FFF5FC0FD19:
ImageLoaderMachO::doModInitFunctions(ImageLoader:: LinkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0FA65:
ImageLoaderMachO::doInitialization(ImageLoader::Li nkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0D257:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516==
==17516== 82 bytes in 6 blocks are still reachable in loss record 2 of 9
==17516== at 0xD62F: malloc (vg_replace_malloc.c:266)
==17516== by 0x250358: strdup (in /usr/lib/system/libsystem_c.dylib)
==17516== by 0x3E69F6: _xpc_strdup (in /usr/lib/system/libxpc.dylib)
==17516== by 0x3ECDD3: _xpc_dictionary_insert (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x3ECF12: xpc_dictionary_set_string (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x3EEF55: _libxpc_initializer (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x1AE7D: libSystem_initializer (in
/usr/lib/libSystem.B.dylib)
==17516== by 0x7FFF5FC0FD19:
ImageLoaderMachO::doModInitFunctions(ImageLoader:: LinkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0FA65:
ImageLoaderMachO::doInitialization(ImageLoader::Li nkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0D257:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0D1F0:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0E02A:
ImageLoader::runInitializers(ImageLoader::LinkCont ext const&,
ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516==
==17516== 88 bytes in 1 blocks are still reachable in loss record 3 of 9
==17516== at 0xD62F: malloc (vg_replace_malloc.c:266)
==17516== by 0x1C89B0: get_or_create_key_element (in
/usr/lib/system/libkeymgr.dylib)
==17516== by 0x1C8BC9: _keymgr_get_and_lock_processwide_ptr_2 (in
/usr/lib/system/libkeymgr.dylib)
==17516== by 0x1C8C36: __keymgr_initializer (in
/usr/lib/system/libkeymgr.dylib)
==17516== by 0x1AE6E: libSystem_initializer (in
/usr/lib/libSystem.B.dylib)
==17516== by 0x7FFF5FC0FD19:
ImageLoaderMachO::doModInitFunctions(ImageLoader:: LinkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0FA65:
ImageLoaderMachO::doInitialization(ImageLoader::Li nkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0D257:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0D1F0:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0E02A:
ImageLoader::runInitializers(ImageLoader::LinkCont ext const&,
ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC03487: dyld::initializeMainExecutable() (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0757F: dyld::_main(macho_header const*, unsigned
long, int, char const**, char const**, char const**) (in /usr/lib/dyld)
==17516==
==17516== 136 bytes in 1 blocks are still reachable in loss record 4 of 9
==17516== at 0xD30A: calloc (vg_replace_malloc.c:569)
==17516== by 0x3E6AEE: _xpc_calloc (in /usr/lib/system/libxpc.dylib)
==17516== by 0x3E73C8: _xpc_base_create (in /usr/lib/system/libxpc.dylib)
==17516== by 0x3F0D0C: _xpc_domain_create (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x3EEFE7: _libxpc_initializer (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x1AE7D: libSystem_initializer (in
/usr/lib/libSystem.B.dylib)
==17516== by 0x7FFF5FC0FD19:
ImageLoaderMachO::doModInitFunctions(ImageLoader:: LinkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0FA65:
ImageLoaderMachO::doInitialization(ImageLoader::Li nkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0D257:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0D1F0:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0E02A:
ImageLoader::runInitializers(ImageLoader::LinkCont ext const&,
ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC03487: dyld::initializeMainExecutable() (in
/usr/lib/dyld)
==17516==
==17516== 192 bytes in 6 blocks are still reachable in loss record 5 of 9
==17516== at 0xD62F: malloc (vg_replace_malloc.c:266)
==17516== by 0x3E6B31: _xpc_malloc (in /usr/lib/system/libxpc.dylib)
==17516== by 0x3ECDB8: _xpc_dictionary_insert (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x3ECF12: xpc_dictionary_set_string (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x3EEF55: _libxpc_initializer (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x1AE7D: libSystem_initializer (in
/usr/lib/libSystem.B.dylib)
==17516== by 0x7FFF5FC0FD19:
ImageLoaderMachO::doModInitFunctions(ImageLoader:: LinkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0FA65:
ImageLoaderMachO::doInitialization(ImageLoader::Li nkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0D257:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0D1F0:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0E02A:
ImageLoader::runInitializers(ImageLoader::LinkCont ext const&,
ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC03487: dyld::initializeMainExecutable() (in
/usr/lib/dyld)
==17516==
==17516== 528 bytes in 6 blocks are still reachable in loss record 6 of 9
==17516== at 0xD30A: calloc (vg_replace_malloc.c:569)
==17516== by 0x3E6AEE: _xpc_calloc (in /usr/lib/system/libxpc.dylib)
==17516== by 0x3E73C8: _xpc_base_create (in /usr/lib/system/libxpc.dylib)
==17516== by 0x3EDCEE: xpc_string_create (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x3ECF01: xpc_dictionary_set_string (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x3EEF55: _libxpc_initializer (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x1AE7D: libSystem_initializer (in
/usr/lib/libSystem.B.dylib)
==17516== by 0x7FFF5FC0FD19:
ImageLoaderMachO::doModInitFunctions(ImageLoader:: LinkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0FA65:
ImageLoaderMachO::doInitialization(ImageLoader::Li nkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0D257:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0D1F0:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0E02A:
ImageLoader::runInitializers(ImageLoader::LinkCont ext const&,
ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516==
==17516== 579 bytes in 6 blocks are still reachable in loss record 7 of 9
==17516== at 0xD62F: malloc (vg_replace_malloc.c:266)
==17516== by 0x250358: strdup (in /usr/lib/system/libsystem_c.dylib)
==17516== by 0x3E69F6: _xpc_strdup (in /usr/lib/system/libxpc.dylib)
==17516== by 0x3EDCF9: xpc_string_create (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x3ECF01: xpc_dictionary_set_string (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x3EEF55: _libxpc_initializer (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x1AE7D: libSystem_initializer (in
/usr/lib/libSystem.B.dylib)
==17516== by 0x7FFF5FC0FD19:
ImageLoaderMachO::doModInitFunctions(ImageLoader:: LinkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0FA65:
ImageLoaderMachO::doInitialization(ImageLoader::Li nkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0D257:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0D1F0:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0E02A:
ImageLoader::runInitializers(ImageLoader::LinkCont ext const&,
ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516==
==17516== 608 bytes in 1 blocks are still reachable in loss record 8 of 9
==17516== at 0xD30A: calloc (vg_replace_malloc.c:569)
==17516== by 0x3E6AEE: _xpc_calloc (in /usr/lib/system/libxpc.dylib)
==17516== by 0x3E73C8: _xpc_base_create (in /usr/lib/system/libxpc.dylib)
==17516== by 0x3ED0DE: xpc_dictionary_create (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x3EEF2C: _libxpc_initializer (in
/usr/lib/system/libxpc.dylib)
==17516== by 0x1AE7D: libSystem_initializer (in
/usr/lib/libSystem.B.dylib)
==17516== by 0x7FFF5FC0FD19:
ImageLoaderMachO::doModInitFunctions(ImageLoader:: LinkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0FA65:
ImageLoaderMachO::doInitialization(ImageLoader::Li nkContext const&) (in
/usr/lib/dyld)
==17516== by 0x7FFF5FC0D257:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0D1F0:
ImageLoader::recursiveInitialization(ImageLoader:: LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC0E02A:
ImageLoader::runInitializers(ImageLoader::LinkCont ext const&,
ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==17516== by 0x7FFF5FC03487: dyld::initializeMainExecutable() (in
/usr/lib/dyld)
==17516==
==17516== 4,096 bytes in 1 blocks are still reachable in loss record 9 of 9
==17516== at 0xD62F: malloc (vg_replace_malloc.c:266)
==17516== by 0x25D3F7: __smakebuf (in /usr/lib/system/libsystem_c.dylib)
==17516== by 0x253D19: __swsetup (in /usr/lib/system/libsystem_c.dylib)
==17516== by 0x289D2D: __sfvwrite (in /usr/lib/system/libsystem_c.dylib)
==17516== by 0x289CA4: fwrite (in /usr/lib/system/libsystem_c.dylib)
==17516== by 0x7C710: std::basic_ostream<char, std::char_traits<char> >&
std::__ostream_insert<char, std::char_traits<char>
>(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) (in

/usr/lib/libstdc++.6.0.9.dylib)
==17516== by 0x7C7E9: std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*) (in /usr/lib/libstdc++.6.0.9.dylib)
==17516== by 0x10004D17C: main (in ./test_tree)
==17516==
==17516== LEAK SUMMARY:
==17516== definitely lost: 0 bytes in 0 blocks
==17516== indirectly lost: 0 bytes in 0 blocks
==17516== possibly lost: 0 bytes in 0 blocks
==17516== still reachable: 6,317 bytes in 29 blocks
==17516== suppressed: 0 bytes in 0 blocks
==17516==
==17516== For counts of detected and suppressed errors, rerun with: -v
==17516== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 1 from 1)
/Users/bravegag/code/mmc11/trunk/build$



Victor Bazarov 10-08-2011 01:43 PM

Re: cmake + google test: weirdo dependency
 
On 10/8/2011 9:00 AM, Giovanni Azua wrote:
> I setup a project using cmake and google test for a Fast Multipole
> implementation I am working on (graduate study project). It is working fine
> however when I run valgrind checking for memory leaks or using callgrind I
> find some weirdo ImageLoaderMachO code (see output below) I have done all
> kind of searches but can't find where such junk comes from :(((
>
> find . \( -not -path "*svn*" \) -exec grep -Hi "image" {} \;
>
> Likewise, searching for "loadermacho" "library" etc doesn't bring any clues
> as to where this junk is coming from? Would this be a dependency of Google
> Test maybe?

[...]

Was there a C++ language question that I didn't notice? If not, find a
better place to ask your question. The Google Test online community (if
there is such a place) sounds like a good first approximation.

V
--
I do not respond to top-posted replies, please don't ask


All times are GMT. The time now is 02:23 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.