Closed mrpositron closed 2 years ago
Valgrind output:
==713457== Memcheck, a memory error detector
==713457== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==713457== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==713457== Command: ./hello_tf
==713457==
==713457== Warning: set address range perms: large range [0x4864000, 0x2dd08000) (defined)
==713457== Warning: set address range perms: large range [0x3098b000, 0x4acd2000) (defined)
==713457== Warning: set address range perms: large range [0x65422040, 0x165422040) (undefined)
==713457== Invalid read of size 8
==713457== at 0x4842C28: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==713457== by 0x30772AF5: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E6470: google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<std::pair<void const*, int> >::AddFile(google::protobuf::FileDescriptorProto const&, std::pair<void const*, int>) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E27DF: google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307ADEC3: google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307A4DAD: protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptorsImpl() (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x306774DE: __pthread_once_slow (pthread_once.c:116)
==713457== by 0x307A5B68: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x4011B99: call_init.part.0 (dl-init.c:72)
==713457== by 0x4011CA0: call_init (dl-init.c:30)
==713457== by 0x4011CA0: _dl_init (dl-init.c:119)
==713457== by 0x4001139: ??? (in /usr/lib/x86_64-linux-gnu/ld-2.31.so)
==713457== Address 0x65422038 is 8 bytes before a block of size 4,294,967,296 alloc'd
==713457== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==713457== by 0x30772ADC: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E6470: google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<std::pair<void const*, int> >::AddFile(google::protobuf::FileDescriptorProto const&, std::pair<void const*, int>) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E27DF: google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307ADEC3: google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307A4DAD: protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptorsImpl() (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x306774DE: __pthread_once_slow (pthread_once.c:116)
==713457== by 0x307A5B68: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x4011B99: call_init.part.0 (dl-init.c:72)
==713457== by 0x4011CA0: call_init (dl-init.c:30)
==713457== by 0x4011CA0: _dl_init (dl-init.c:119)
==713457== by 0x4001139: ??? (in /usr/lib/x86_64-linux-gnu/ld-2.31.so)
==713457==
==713457== Invalid read of size 8
==713457== at 0x4842C30: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==713457== by 0x30772AF5: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E6470: google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<std::pair<void const*, int> >::AddFile(google::protobuf::FileDescriptorProto const&, std::pair<void const*, int>) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E27DF: google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307ADEC3: google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307A4DAD: protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptorsImpl() (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x306774DE: __pthread_once_slow (pthread_once.c:116)
==713457== by 0x307A5B68: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x4011B99: call_init.part.0 (dl-init.c:72)
==713457== by 0x4011CA0: call_init (dl-init.c:30)
==713457== by 0x4011CA0: _dl_init (dl-init.c:119)
==713457== by 0x4001139: ??? (in /usr/lib/x86_64-linux-gnu/ld-2.31.so)
==713457== Address 0x65422030 is 16 bytes before a block of size 4,294,967,296 alloc'd
==713457== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==713457== by 0x30772ADC: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E6470: google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<std::pair<void const*, int> >::AddFile(google::protobuf::FileDescriptorProto const&, std::pair<void const*, int>) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E27DF: google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307ADEC3: google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307A4DAD: protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptorsImpl() (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x306774DE: __pthread_once_slow (pthread_once.c:116)
==713457== by 0x307A5B68: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x4011B99: call_init.part.0 (dl-init.c:72)
==713457== by 0x4011CA0: call_init (dl-init.c:30)
==713457== by 0x4011CA0: _dl_init (dl-init.c:119)
==713457== by 0x4001139: ??? (in /usr/lib/x86_64-linux-gnu/ld-2.31.so)
==713457==
==713457== Invalid read of size 8
==713457== at 0x4842C3B: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==713457== by 0x30772AF5: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E6470: google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<std::pair<void const*, int> >::AddFile(google::protobuf::FileDescriptorProto const&, std::pair<void const*, int>) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E27DF: google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307ADEC3: google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307A4DAD: protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptorsImpl() (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x306774DE: __pthread_once_slow (pthread_once.c:116)
==713457== by 0x307A5B68: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x4011B99: call_init.part.0 (dl-init.c:72)
==713457== by 0x4011CA0: call_init (dl-init.c:30)
==713457== by 0x4011CA0: _dl_init (dl-init.c:119)
==713457== by 0x4001139: ??? (in /usr/lib/x86_64-linux-gnu/ld-2.31.so)
==713457== Address 0x65422028 is 24 bytes before a block of size 4,294,967,296 alloc'd
==713457== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==713457== by 0x30772ADC: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E6470: google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<std::pair<void const*, int> >::AddFile(google::protobuf::FileDescriptorProto const&, std::pair<void const*, int>) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E27DF: google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307ADEC3: google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307A4DAD: protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptorsImpl() (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x306774DE: __pthread_once_slow (pthread_once.c:116)
==713457== by 0x307A5B68: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x4011B99: call_init.part.0 (dl-init.c:72)
==713457== by 0x4011CA0: call_init (dl-init.c:30)
==713457== by 0x4011CA0: _dl_init (dl-init.c:119)
==713457== by 0x4001139: ??? (in /usr/lib/x86_64-linux-gnu/ld-2.31.so)
==713457==
==713457== Invalid read of size 8
==713457== at 0x4842C1C: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==713457== by 0x30772AF5: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E6470: google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<std::pair<void const*, int> >::AddFile(google::protobuf::FileDescriptorProto const&, std::pair<void const*, int>) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E27DF: google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307ADEC3: google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307A4DAD: protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptorsImpl() (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x306774DE: __pthread_once_slow (pthread_once.c:116)
==713457== by 0x307A5B68: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x4011B99: call_init.part.0 (dl-init.c:72)
==713457== by 0x4011CA0: call_init (dl-init.c:30)
==713457== by 0x4011CA0: _dl_init (dl-init.c:119)
==713457== by 0x4001139: ??? (in /usr/lib/x86_64-linux-gnu/ld-2.31.so)
==713457== Address 0x65422020 is 32 bytes before a block of size 4,294,971,296 in arena "client"
==713457==
==713457==
==713457== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==713457== Bad permissions for mapped region at address 0x63325FF8
==713457== at 0x4842C28: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==713457== by 0x30772AF5: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E6470: google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<std::pair<void const*, int> >::AddFile(google::protobuf::FileDescriptorProto const&, std::pair<void const*, int>) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307E27DF: google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307ADEC3: google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x307A4DAD: protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptorsImpl() (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x306774DE: __pthread_once_slow (pthread_once.c:116)
==713457== by 0x307A5B68: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0)
==713457== by 0x4011B99: call_init.part.0 (dl-init.c:72)
==713457== by 0x4011CA0: call_init (dl-init.c:30)
==713457== by 0x4011CA0: _dl_init (dl-init.c:119)
==713457== by 0x4001139: ??? (in /usr/lib/x86_64-linux-gnu/ld-2.31.so)
==713457==
==713457== HEAP SUMMARY:
==713457== in use at exit: 4,301,400,345 bytes in 49,820 blocks
==713457== total heap usage: 58,257 allocs, 8,437 frees, 4,302,177,389 bytes allocated
==713457==
==713457== LEAK SUMMARY:
==713457== definitely lost: 0 bytes in 0 blocks
==713457== indirectly lost: 0 bytes in 0 blocks
==713457== possibly lost: 288 bytes in 6 blocks
==713457== still reachable: 4,301,400,057 bytes in 49,814 blocks
==713457== of which reachable via heuristic:
==713457== stdstring : 1,384,974 bytes in 11,573 blocks
==713457== suppressed: 0 bytes in 0 blocks
==713457== Rerun with --leak-check=full to see details of leaked memory
==713457==
==713457== For lists of detected and suppressed errors, rerun with: -s
==713457== ERROR SUMMARY: 8 errors from 4 contexts (suppressed: 4 from 4)
Segmentation fault (core dumped)
Installing protobuf from the source solved the problem
So, I modified a 'main.cpp' code bit. Basically I just removed
YOLO
part and detection lines from themain()
function. Here is a code:If I will run this code, it will show segmentation fault. However, if I will run this code commenting either one of
EffnetBBone effnet = EffnetBBone(base_dir);
orTFModelLoader tf_loader = TFModelLoader(base_dir, "serving_default_feature", 8 * 8 * dim * 4, 4, dims);
it will perfectly. I don't understand why this code seg faults when both of those lines are present. What's more, code seg faults even beforemain()
function.Thanks in advance!