cmake + google test: weirdo dependency

Discussion in 'C++' started by Giovanni Azua, Oct 8, 2011.

  1. 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<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 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_image_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::LinkContext 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::LinkContext 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::LinkContext 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::LinkContext 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::LinkContext 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::LinkContext 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::LinkContext 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::LinkContext 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::LinkContext 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::LinkContext 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::LinkContext 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::LinkContext 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::LinkContext 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::LinkContext 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::LinkContext 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::eek:perator<< <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$
     
    Giovanni Azua, Oct 8, 2011
    #1
    1. Advertising

  2. 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
     
    Victor Bazarov, Oct 8, 2011
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Thompson

    FAQ - references to Google/Google Groups

    Andrew Thompson, Jun 20, 2005, in forum: Java
    Replies:
    0
    Views:
    700
    Andrew Thompson
    Jun 20, 2005
  2. Replies:
    1
    Views:
    466
    Ioannis Vranos
    Mar 21, 2005
  3. Darren Dale

    how to test for a dependency

    Darren Dale, Jan 9, 2006, in forum: Python
    Replies:
    5
    Views:
    288
    Steven Bethard
    Jan 10, 2006
  4. Skybuck Flying

    Call oddities: &Test() vs &Test vs Test

    Skybuck Flying, Oct 4, 2009, in forum: C Programming
    Replies:
    1
    Views:
    766
    Skybuck Flying
    Oct 4, 2009
  5. lolveley
    Replies:
    1
    Views:
    240
    lolveley
    May 29, 2009
Loading...

Share This Page