Skip to content

Instantly share code, notes, and snippets.

@kingroryg
Created November 4, 2017 13:02
Show Gist options
  • Save kingroryg/8c2a55dbd1f76b8ef31f2e117ea8b357 to your computer and use it in GitHub Desktop.
Save kingroryg/8c2a55dbd1f76b8ef31f2e117ea8b357 to your computer and use it in GitHub Desktop.
➜ valgrind ./bfTest1
==69640== Memcheck, a memory error detector
==69640== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==69640== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==69640== Command: ./bfTest1
==69640==
==69640== Syscall param msg->desc.port.name points to uninitialised byte(s)
==69640== at 0x100A1EE76: mach_msg_trap (in /usr/lib/system/libsystem_kernel.dylib)
==69640== by 0x100A1E38F: mach_msg (in /usr/lib/system/libsystem_kernel.dylib)
==69640== by 0x100A17F3D: task_set_special_port (in /usr/lib/system/libsystem_kernel.dylib)
==69640== by 0x100A8501A: _os_trace_create_debug_control_port (in /usr/lib/system/libsystem_trace.dylib)
==69640== by 0x100A852D0: _libtrace_init (in /usr/lib/system/libsystem_trace.dylib)
==69640== by 0x1001D19CC: libSystem_initializer (in /usr/lib/libSystem.B.dylib)
==69640== by 0x100131A09: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld)
==69640== by 0x100131C39: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld)
==69640== by 0x10012D16F: ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) (in /usr/lib/dyld)
==69640== by 0x10012D102: ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) (in /usr/lib/dyld)
==69640== by 0x10012C2A5: ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) (in /usr/lib/dyld)
==69640== by 0x10012C339: ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==69640== Address 0x1049b627c is on thread 1's stack
==69640== in frame #2, created by task_set_special_port (???:)
==69640==
--69640-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option
--69640-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 2 times)
--69640-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 4 times)
==69640== Thread 2:
==69640== Invalid read of size 4
==69640== at 0x100A5E61A: _pthread_body (in /usr/lib/system/libsystem_pthread.dylib)
==69640== by 0x100A5E56C: _pthread_start (in /usr/lib/system/libsystem_pthread.dylib)
==69640== by 0x100A5DC5C: thread_start (in /usr/lib/system/libsystem_pthread.dylib)
==69640== Address 0x18 is not stack'd, malloc'd or (recently) free'd
==69640==
==69640==
==69640== Process terminating with default action of signal 11 (SIGSEGV)
==69640== Access not within mapped region at address 0x18
==69640== at 0x100A5E61A: _pthread_body (in /usr/lib/system/libsystem_pthread.dylib)
==69640== by 0x100A5E56C: _pthread_start (in /usr/lib/system/libsystem_pthread.dylib)
==69640== by 0x100A5DC5C: thread_start (in /usr/lib/system/libsystem_pthread.dylib)
==69640== If you believe this happened as a result of a stack
==69640== overflow in your program's main thread (unlikely but
==69640== possible), you can try to increase the size of the
==69640== main thread stack using the --main-stacksize= flag.
==69640== The main thread stack size used in this run was 8388608.
--69640:0:schedule VG_(sema_down): read returned -4
==69640==
==69640== HEAP SUMMARY:
==69640== in use at exit: 146,738 bytes in 245 blocks
==69640== total heap usage: 303 allocs, 58 frees, 329,250 bytes allocated
==69640==
==69640== LEAK SUMMARY:
==69640== definitely lost: 0 bytes in 0 blocks
==69640== indirectly lost: 0 bytes in 0 blocks
==69640== possibly lost: 72 bytes in 3 blocks
==69640== still reachable: 128,072 bytes in 86 blocks
==69640== suppressed: 18,594 bytes in 156 blocks
==69640== Rerun with --leak-check=full to see details of leaked memory
==69640==
==69640== For counts of detected and suppressed errors, rerun with: -v
==69640== Use --track-origins=yes to see where uninitialised values come from
==69640== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 1 from 1)
[1] 69640 segmentation fault valgrind ./bfTest1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment