前提・実現したいこと
C言語を用いて数値計算しているものです.
そのプログラムがメモリリークを起こしているようで,
バグを検出するためにvalgrindをインストールしました.
その結果ある程度バグを見つられたのですが,possibly lostがどうしても消えません.
また同じエラーが白紙のプログラムでも発生することがわかりました
==81429== Memcheck, a memory error detector
==81429== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==81429== Using Valgrind-3.14.0.GIT and LibVEX; rerun with -h for copyright info
==81429== Command: ./a.out
==81429==
==81429==
==81429== HEAP SUMMARY:
==81429== in use at exit: 18,339 bytes in 163 blocks
==81429== total heap usage: 184 allocs, 21 frees, 26,787 bytes allocated
==81429==
==81429== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42
==81429== at 0x1000ABC32: calloc (in /usr/local/Cellar/valgrind/HEAD-2b0aa0a/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==81429== by 0x1007787E2: map_images_nolock (in /usr/lib/libobjc.A.dylib)
==81429== by 0x10078B7DA: objc_object::sidetable_retainCount() (in /usr/lib/libobjc.A.dylib)
==81429== by 0x100006C64: dyld::notifyBatchPartial(dyld_image_states, bool, char const* ()(dyld_image_states, unsigned int, dyld_image_info const), bool, bool) (in /usr/lib/dyld)
==81429== by 0x100006E39: dyld::registerObjCNotifiers(void ()(unsigned int, char const const*, mach_header const* const*), void ()(char const, mach_header const*), void ()(char const, mach_header const*)) (in /usr/lib/dyld)
==81429== by 0x10024371D: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib)
==81429== by 0x100778075: _objc_init (in /usr/lib/libobjc.A.dylib)
==81429== by 0x1001CDB34: _os_object_init (in /usr/lib/system/libdispatch.dylib)
==81429== by 0x1001CDB1B: libdispatch_init (in /usr/lib/system/libdispatch.dylib)
==81429== by 0x1000BA9C2: libSystem_initializer (in /usr/lib/libSystem.B.dylib)
==81429== by 0x100018AC5: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld)
==81429== by 0x100018CF5: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld)
==81429==
==81429== LEAK SUMMARY:
==81429== definitely lost: 0 bytes in 0 blocks
==81429== indirectly lost: 0 bytes in 0 blocks
==81429== possibly lost: 72 bytes in 3 blocks
==81429== still reachable: 200 bytes in 6 blocks
==81429== suppressed: 18,067 bytes in 154 blocks
==81429== Reachable blocks (those to which a pointer was found) are not shown.
==81429== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==81429==
==81429== For counts of detected and suppressed errors, rerun with: -v
==81429== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12)
どなたか理由・対策をご存知でしたら教えてください.
該当のソースコード
#include<stdio.h> #include<stdlib.h> int main(void){ return 0; }
###試したこと
--gen-suppressions オプションというのを検索で見つけたのですが,よくわかりませんでした.特にsuppressionファイルの作成の仕方がわかりませんでした
補足情報(FW/ツールのバージョンなど)
macOS high sierra 10.13.6
gcc は8.2.0です
(プログラミング等にまだ疎いので,情報が不十分でしたら教えてください)

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/21 17:54