I am running my program though valgrind, but it appears it is generating errors caused by the tool itself? All my errors look like the following, but from reading through other posts, it seems that usually the at
line tells you where in your program the offending malloc occurs, but all my at
lines are coming from valgrind. Are these legit errors in my program?
==10551== 32,808 (24 direct, 32,784 indirect) bytes in 1 blocks are definitely lost in loss record 840 of 843
==10551== at 0x54D7: malloc_zone_malloc (in /usr/local/Cellar/valgrind/3.8.1/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==10551== by 0x7C5171: NXCreateMapTableFromZone (in /usr/lib/libobjc.A.dylib)
==10551== by 0x7C4722: _read_images (in /usr/lib/libobjc.A.dylib)
==10551== by 0x7C39EB: map_images_nolock (in /usr/lib/libobjc.A.dylib)
==10551== by 0x7C34F3: map_images (in /usr/lib/libobjc.A.dylib)
==10551== by 0x7FFF5FC04936: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*)) (in /usr/lib/dyld)
==10551== by 0x7FFF5FC0467C: dyld::registerImageStateBatchChangeHandler(dyld_image_states, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*)) (in /usr/lib/dyld)
==10551== by 0xA99ED9: dyld_register_image_state_change_handler (in /usr/lib/system/libdyld.dylib)
==10551== by 0x7C204C: _objc_init (in /usr/lib/libobjc.A.dylib)
==10551== by 0x6BB27: libSystem_initializer (in /usr/lib/libSystem.B.dylib)
==10551== by 0x7FFF5FC13377: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld)
==10551== by 0x7FFF5FC13761: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld)
==10551==
I used homebrew to install valgrind. It probably has something to do with this error:
==10551== WARNING: Support on MacOS 10.8 is experimental and mostly broken.
==10551== WARNING: Expect incorrect results, assertions and crashes.
but I just want to make sure (by someone who has used this before) that these errors are not coming from my program. (I am on 10.8).