したがって、次の出力が与えられます。
==80518== Invalid read of size 4
==80518== at 0x558D: Node::ReadFolder(GFile*) (in ./ScribeRecoverMail2)
==80518== by 0x7B61: Worker::Export(GFile*, GArray<Node*>&) (in ./ScribeRecoverMail2)
==80518== by 0x8F7A: Worker::Main() (in ./ScribeRecoverMail2)
==80518== by 0x142D64: ThreadEntryPoint(void*) (in /Users/matthew/Code/Scribe-Branches/v2.00/Utils/ScribeRecoverMail2/build/Debug/ScribeRecoverMail2.app/Contents/Frameworks/Lgi.framework/Versions/A/Lgi)
==80518== by 0x47E258: _pthread_start (in /usr/lib/libSystem.B.dylib)
==80518== by 0x47E0DD: thread_start (in /usr/lib/libSystem.B.dylib)
==80518== Address 0x1d72f590 is 16 bytes inside a block of size 72 alloc'd
==80518== at 0x41581: malloc (vg_replace_malloc.c:266)
==80518== by 0x3D5616: operator new(unsigned long) (in /usr/lib/libstdc++.6.0.9.dylib)
==80518== by 0x77A6: Worker::Scan(GFile*, GArray<Node*>&) (in ./ScribeRecoverMail2)
==80518== by 0x8F0C: Worker::Main() (in ./ScribeRecoverMail2)
==80518== by 0x142D64: ThreadEntryPoint(void*) (in /Users/matthew/Code/Scribe-Branches/v2.00/Utils/ScribeRecoverMail2/build/Debug/ScribeRecoverMail2.app/Contents/Frameworks/Lgi.framework/Versions/A/Lgi)
==80518== by 0x47E258: _pthread_start (in /usr/lib/libSystem.B.dylib)
==80518== by 0x47E0DD: thread_start (in /usr/lib/libSystem.B.dylib)
==80518==
==80518== Invalid read of size 4
==80518== at 0x10B70F: GFile::Read(void*, int, int) (in /Users/matthew/Code/Scribe-Branches/v2.00/Utils/ScribeRecoverMail2/build/Debug/ScribeRecoverMail2.app/Contents/Frameworks/Lgi.framework/Versions/A/Lgi)
==80518== by 0x360E: Node::Read(GFile*, unsigned int&) (in ./ScribeRecoverMail2)
==80518== by 0x55CF: Node::ReadFolder(GFile*) (in ./ScribeRecoverMail2)
==80518== by 0x7B61: Worker::Export(GFile*, GArray<Node*>&) (in ./ScribeRecoverMail2)
==80518== by 0x8F7A: Worker::Main() (in ./ScribeRecoverMail2)
==80518== by 0x142D64: ThreadEntryPoint(void*) (in /Users/matthew/Code/Scribe-Branches/v2.00/Utils/ScribeRecoverMail2/build/Debug/ScribeRecoverMail2.app/Contents/Frameworks/Lgi.framework/Versions/A/Lgi)
==80518== by 0x47E258: _pthread_start (in /usr/lib/libSystem.B.dylib)
==80518== by 0x47E0DD: thread_start (in /usr/lib/libSystem.B.dylib)
==80518== Address 0x1a198900 is 0 bytes inside a block of size 24 alloc'd
==80518== at 0x41581: malloc (vg_replace_malloc.c:266)
==80518== by 0x3D5616: operator new(unsigned long) (in /usr/lib/libstdc++.6.0.9.dylib)
==80518== by 0xDFADB: GFile::GFile() (in /Users/matthew/Code/Scribe-Branches/v2.00/Utils/ScribeRecoverMail2/build/Debug/ScribeRecoverMail2.app/Contents/Frameworks/Lgi.framework/Versions/A/Lgi)
==80518== by 0x8E4E: Worker::Main() (in ./ScribeRecoverMail2)
==80518== by 0x142D64: ThreadEntryPoint(void*) (in /Users/matthew/Code/Scribe-Branches/v2.00/Utils/ScribeRecoverMail2/build/Debug/ScribeRecoverMail2.app/Contents/Frameworks/Lgi.framework/Versions/A/Lgi)
==80518== by 0x47E258: _pthread_start (in /usr/lib/libSystem.B.dylib)
==80518== by 0x47E0DD: thread_start (in /usr/lib/libSystem.B.dylib)
ヴァルグリンドは普段の普段の行動に不満を漏らしているようだ。問題のブロックはまだ割り当てられており、アクセスはメモリ ブロックの start と end 内にあります。では、valgrind が不平を言うのはなぜでしょうか。
このプログラムは Windows でクラッシュするため、Mac でビルドして valgrind を実行し、どこが問題なのかを確認しました。これまでのところ、これらの「ブロック内のエラー」警告はたくさんありますが、「解放されたメモリへの書き込み」などの疑わしいものはありません。私はかなり混乱しています。
最新の安定した valgrind v3.7.0 を実行している PS は、実行しているのと同じマシンにコンパイルしてインストールします。私は長い間 valgrind を使用してきましたが、この種のメッセージはこれまで見たことがありません。