|
From: Jacob G. <ja...@ad...> - 2012-08-07 23:43:34
|
I created a new Xcode Cocoa project, built and ran it under Valgrind, and the following leaks are reported. Is this expected? Could this be a bug? MacOS> valgrind --num-callers=200 ./valgrindtest2 ==22925== Memcheck, a memory error detector ==22925== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. ==22925== Using Valgrind-3.8.0.SVN and LibVEX; rerun with -h for copyright info ==22925== Command: ./valgrindtest2 ==22925== --22925:0:schedule VG_(sema_down): read returned -4 ==22925== ==22925== HEAP SUMMARY: ==22925== in use at exit: 2,377,584 bytes in 11,686 blocks ==22925== total heap usage: 49,569 allocs, 37,883 frees, 11,880,661 bytes allocated ==22925== ==22925== 18 bytes in 1 blocks are definitely lost in loss record 1,058 of 6,815 ==22925== at 0xC8E6: malloc_zone_malloc (vg_replace_malloc.c:273) ==22925== by 0x3AC68C6: malloc_set_zone_name (in /usr/lib/system/libsystem_c.dylib) ==22925== by 0x3AC6DF2: _malloc_initialize (in /usr/lib/system/libsystem_c.dylib) ==22925== by 0x3AC6F2B: malloc_good_size (in /usr/lib/system/libsystem_c.dylib) ==22925== by 0x15CE06: __CFStringChangeSizeMultiple (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x1610E7: CFStringAppend (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x17359D: _convertToURLRepresentation (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x26AE56: _CFURLInit (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x16BF81: CFURLCreateWithFileSystemPathRelativeToBase (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x181388: _CFBundleGetMainBundleAlreadyLocked (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x1812C5: CFBundleGetMainBundle (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x1A42BDC: +[NSBundle mainBundle] (in /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation) ==22925== by 0x6F6F13: NSApplicationMain (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==22925== by 0x100001511: main (main.m:13) ==22925== ==22925== 22 bytes in 1 blocks are definitely lost in loss record 1,065 of 6,815 ==22925== at 0xC8E6: malloc_zone_malloc (vg_replace_malloc.c:273) ==22925== by 0x3AC68C6: malloc_set_zone_name (in /usr/lib/system/libsystem_c.dylib) ==22925== by 0x39C33EF: dispatch_once_f (in /usr/lib/system/libdispatch.dylib) ==22925== by 0x39C04D1: _dispatch_continuation_alloc_from_heap (in /usr/lib/system/libdispatch.dylib) ==22925== by 0x39C1A6D: _dispatch_barrier_async_f_slow (in /usr/lib/system/libdispatch.dylib) ==22925== by 0x3C0C415: _xpc_connection_create (in /usr/lib/system/libxpc.dylib) ==22925== by 0x3C0CD99: xpc_connection_create (in /usr/lib/system/libxpc.dylib) ==22925== by 0x1A29E7: -[NSXPCConnection initWithServiceName:privileged:] (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x1A257F: __CFXNotificationCenterSetupConnection (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x1A24C0: __CFXNotificationCenterCreate (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x1A2399: __CFNotificationCenterGetDistributedCenter_block_invoke_1 (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x39C33EF: dispatch_once_f (in /usr/lib/system/libdispatch.dylib) ==22925== by 0x1917A9: CFNotificationCenterGetDistributedCenter (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x1D0867: ____CFXPreferencesGetSourceForTriplet_block_invoke_1 (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x39C33EF: dispatch_once_f (in /usr/lib/system/libdispatch.dylib) ==22925== by 0x19D3E9: __CFXPreferencesGetSourceForTriplet (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x1A9816: __CFXPreferencesGetSearchListForBundleID (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x1A96F7: ___CFXPreferencesCopyAppValue_block_invoke_1 (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x1A9699: CFPreferencesCopyAppValue (in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation) ==22925== by 0x1A20FFE: -[NSUserDefaults(NSUserDefaults) initWithUser:] (in /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation) ==22925== by 0x1A20B2C: +[NSUserDefaults(NSUserDefaults) standardUserDefaults] (in /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation) ==22925== by 0x6A7D46: +[NSApplication initialize] (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==22925== by 0x65661: _class_initialize (in /usr/lib/libobjc.A.dylib) ==22925== by 0x65516: prepareForMethodLookup (in /usr/lib/libobjc.A.dylib) ==22925== by 0x652BA: lookUpMethod (in /usr/lib/libobjc.A.dylib) ==22925== by 0x62F3B: objc_msgSend (in /usr/lib/libobjc.A.dylib) ==22925== by 0x6F6F9C: NSApplicationMain (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==22925== by 0x100001511: main (main.m:13) ==22925== ==22925== LEAK SUMMARY: ==22925== definitely lost: 40 bytes in 2 blocks ==22925== indirectly lost: 0 bytes in 0 blocks ==22925== possibly lost: 2,836 bytes in 17 blocks ==22925== still reachable: 2,374,708 bytes in 11,667 blocks ==22925== suppressed: 0 bytes in 0 blocks ==22925== Reachable blocks (those to which a pointer was found) are not shown. ==22925== To see them, rerun with: --leak-check=full --show-reachable=yes ==22925== ==22925== For counts of detected and suppressed errors, rerun with: -v ==22925== ERROR SUMMARY: 19 errors from 19 contexts (suppressed: 2440149 from 29) |
|
From: John R. <jr...@bi...> - 2012-08-08 00:11:30
|
On 08/07/2012 04:43 PM, Jacob Goldstein wrote: > I created a new Xcode Cocoa project, built and ran it under Valgrind, and the following leaks are reported. Is this expected? Could this be a bug? > > > > MacOS> valgrind --num-callers=200 ./valgrindtest2 > ==22925== Memcheck, a memory error detector > ==22925== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. > ==22925== Using Valgrind-3.8.0.SVN and LibVEX; rerun with -h for copyright info > ==22925== Command: ./valgrindtest2 > ==22925== > --22925:0:schedule VG_(sema_down): read returned -4 That unexpected behavior of sema_down should be investigated. > ==22925== > ==22925== HEAP SUMMARY: > ==22925== in use at exit: 2,377,584 bytes in 11,686 blocks I'd be more concerned about 2.4 MB in use (11686 blocks, average 0.21 KB) than I would about 40 bytes (18 + 22) leaked. -- |
|
From: Philippe W. <phi...@sk...> - 2012-08-08 22:04:39
|
On Tue, 2012-08-07 at 17:12 -0700, John Reiser wrote: > On 08/07/2012 04:43 PM, Jacob Goldstein wrote: > > --22925:0:schedule VG_(sema_down): read returned -4 > > That unexpected behavior of sema_down should be investigated. The code explicitely retry in case read on the sema returns -4 (i.e. -VKI_EINTR). Philippe |