Ich erhalte eine Warnung für possibly lost: 2,064 bytes in 1 blocks
bei der Verwendung von Valgrind auf OSX Yosemite. Gibt es eine Lösung dafür? Ich habe valgrind mit brauen installiert.Mögliche Speicher Leck Valgrind in OSX El Capitan
Unten ist ein Beispiel dafür, wie
~/cat hello.c
int main() {
return 123;
}
~/uname -a
Darwin mac.local 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64 i386 MacBookAir6,2 Darwin
~/clang --version
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.2.0
Thread model: posix
~/valgrind --version
valgrind-3.11.0
~/brew info valgrind
valgrind: stable 3.11.0 (bottled), HEAD
Dynamic analysis tools (memory, debug, profiling)
http://www.valgrind.org/
/usr/local/Cellar/valgrind/3.11.0 (328 files, 46.7M) *
Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/valgrind.rb
~/clang hello.c -o hello.o
~/valgrind --leak-check=full ./hello.o
==7972== Memcheck, a memory error detector
==7972== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==7972== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==7972== Command: ./hello.o
==7972==
==7972==
==7972== HEAP SUMMARY:
==7972== in use at exit: 22,411 bytes in 187 blocks
==7972== total heap usage: 271 allocs, 84 frees, 28,651 bytes allocated
==7972==
==7972== 2,064 bytes in 1 blocks are possibly lost in loss record 57 of 62
==7972== at 0x10000817C: malloc_zone_malloc (in /usr/local/Cellar/valgrind/3.11.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==7972== by 0x1004F3EFD: _objc_copyClassNamesForImage (in /usr/lib/libobjc.A.dylib)
==7972== by 0x1004E7182: protocols() (in /usr/lib/libobjc.A.dylib)
==7972== by 0x1004E7093: readClass(objc_class*, bool, bool) (in /usr/lib/libobjc.A.dylib)
==7972== by 0x1004E4C13: gc_init (in /usr/lib/libobjc.A.dylib)
==7972== by 0x1004EC24E: objc_initializeClassPair_internal(objc_class*, char const*, objc_class*, objc_class*) (in /usr/lib/libobjc.A.dylib)
==7972== by 0x1004F9132: layout_string_create (in /usr/lib/libobjc.A.dylib)
==7972== by 0x1004E783C: realizeClass(objc_class*) (in /usr/lib/libobjc.A.dylib)
==7972== by 0x1004E7300: copySwiftV1MangledName(char const*, bool) (in /usr/lib/libobjc.A.dylib)
==7972== by 0x1004E72E9: copySwiftV1MangledName(char const*, bool) (in /usr/lib/libobjc.A.dylib)
==7972== by 0x1004E72E9: copySwiftV1MangledName(char const*, bool) (in /usr/lib/libobjc.A.dylib)
==7972== by 0x1004E72E9: copySwiftV1MangledName(char const*, bool) (in /usr/lib/libobjc.A.dylib)
==7972==
==7972== LEAK SUMMARY:
==7972== definitely lost: 0 bytes in 0 blocks
==7972== indirectly lost: 0 bytes in 0 blocks
==7972== possibly lost: 2,064 bytes in 1 blocks
==7972== still reachable: 0 bytes in 0 blocks
==7972== suppressed: 20,347 bytes in 186 blocks
==7972==
==7972== For counts of detected and suppressed errors, rerun with: -v
==7972== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 17 from 17)
wenn Sie nicht entweder Markierung meine Antwort richtig oder veröffentlichen Sie Ihre Lösung dagegen hätte, wenn es anders wäre, würde ich es zu schätzen wissen :) –
Tbh ich habe Valgrind nicht berührt oder Seit Monaten habe ich keine fundierte Meinung über wh ist richtig. Was ist SO Protokoll in dieser Situation? – Idr
Nicht sicher. Ich schätze, wenn Sie noch herausfinden, wie Sie Ihr Problem lösen können oder wenn Sie versuchen, in der Zukunft etwas Zeit zu verlieren, dann lassen Sie es so lange, bis Sie feststellen, dass jemandes Antwort hilfreich war oder Sie einfach Ihre eigene Antwort schreiben. Wenn Sie das Problem einfach ganz aufgegeben haben und nicht beabsichtigen, darauf zurückzukommen, dann könnte es sein, dass Sie auch eine Antwort wählen könnten, um es zu schließen. Sie können die Antwort später immer ändern, wenn eine bessere Version herauskommt. –