valgrind

Valgrind doesn't show the sources of definitely lost memory

こ雲淡風輕ζ 提交于 2019-12-12 03:17:58
问题 Valgrind detects memory that is definitely lost but doesn't show me the source (just question marks): ==9859== 32 bytes in 1 blocks are definitely lost in loss record 61 of 274 ==9859== at 0x4C244E8: malloc (vg_replace_malloc.c:236) ==9859== by 0x100F8FB9: ??? ==9859== by 0x3A6F: ??? ==9859== by 0x1F: ??? ==9859== by 0x12C24F07: ??? ==9859== by 0x87: ??? Why are the sources not shown (not even the start in the main() function)? What should I do? Where do I need to look to determine the

Valgrind suppression with using frame-level wildcard (ellipses)

…衆ロ難τιáo~ 提交于 2019-12-12 02:26:15
问题 I'm catching quite a few uninitialized value(s) under Valgrind. The finding is expected because its related to to OpenSSL's PRNG: ==5787== Use of uninitialised value of size 8 ==5787== at 0x533B449: _x86_64_AES_encrypt_compact (in /usr/local/ssl/lib/libcrypto.so.1.0.0) ==5787== by 0x533B6DA: fips_aes_encrypt (in /usr/local/ssl/lib/libcrypto.so.1.0.0) ==5787== by 0x56FBC47: ??? (in /usr/local/ssl/lib/libcrypto.so.1.0.0) ==5787== by 0x56FBD27: ??? (in /usr/local/ssl/lib/libcrypto.so.1.0.0) =

Crash in C++ std::map

蹲街弑〆低调 提交于 2019-12-12 01:25:35
问题 I think I have isolated crash which happens only on cygwin platform. Tried to run with valgrind on linux — no effect, it reports no memory errors. I have function to remove zero monomes from Polynomes typedef map<multiset<int>, double> Polynome; void removeZeroes(Polynome&p){ for(auto it=p.cbegin();it!=p.cend();){ if(p[it->first]==0.) { p.erase(it++); } else ++it; } } void calcGDerivatives(Reduced &r) { auto vars = getAllVars(r); cout<<"calculating derivatives"<<endl; iterate(vars, [&r]

Valgrind error with std::cin

邮差的信 提交于 2019-12-12 01:09:19
问题 Here is my code: std::string getword() { std::string temp; std::cin >> temp; return temp; } Valgrind throws an error on the line std::cin >> temp. Here is the valgrind output for those who asked: HEAP SUMMARY: ==18490== in use at exit: 33 bytes in 1 blocks ==18490== total heap usage: 397 allocs, 396 frees, 12,986 bytes allocated ==18490== ==18490== 33 bytes in 1 blocks are possibly lost in loss record 1 of 1 ==18490== at 0x4C2AF8E: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload

Valgrind invalid write

感情迁移 提交于 2019-12-11 21:12:43
问题 ==3905== ERROR SUMMARY: 14 errors from 2 contexts (suppressed: 2 from 2) ==3905== ==3905== 6 errors in context 1 of 2: ==3905== Invalid write of size 4 ==3905== at 0x401BFE: EliminateXr (in /home/suraj/Desktop/project/fm) ==3905== by 0x402040: fm_elim (in /home/suraj/Desktop/project/fm) ==3905== by 0x401395: name_fm (in /home/suraj/Desktop/project/fm) ==3905== by 0x400C38: main (in /home/suraj/Desktop/project/fm) ==3905== Address 0x51fc724 is 36 bytes inside a block of size 39 alloc'd ==3905=

Invalid free() / delete / delete[] / realloc() in __libc_freeres()

穿精又带淫゛_ 提交于 2019-12-11 19:07:15
问题 I'm compiling the code with -g flag and -O0. Please see valgrind output below. I only want to know if I can I see what is invalid freed? I only see this: ==2566== Invalid free() / delete / delete[] / realloc() ==2566== at 0x4A21244: free (vg_replace_malloc.c:468) ==2566== by 0x500FB7A: free_mem (in /lib64/libc-2.4.so) ==2566== by 0x500F781: __libc_freeres (in /lib64/libc-2.4.so) ==2566== by 0x491C719: _vgnU_freeres (vg_preloaded.c:62) ==2566== by 0x4F4E6F4: exit (in /lib64/libc-2.4.so) ==2566

Confused about profiling result

蹲街弑〆低调 提交于 2019-12-11 18:44:15
问题 I have built my program with " -g -O2 " and ran valgrind +cachegrind. I am unsure how to interpret the output. Here is the output: http://daviddoria.com/Uploads/callgrind.CacheMisses My "whole program" is the InpaintingAlgorithm function that is 98.4% of "main". So far so good. Now looking at the callees of InpaintingAlgorithm , 92.9% of InpaintingAlgorithm is LinearSearchKNNProperty::operator() . This is my "inner loop", and again I expect a huge amount of the time to be spent here. Now here

Unable to cross-compile Valgrind for ARM

孤街醉人 提交于 2019-12-11 17:44:09
问题 There are many questions similar to mine on google, I have tried them all but none of them works so I have to post this question. I'm trying to use Valgrind to detect memory leak on some binary files, which are compiled for my device (using Processor: ARM926EJ-S rev 5 (v5l)). Therefore, I'm trying to cross compile Valgrind using the specific toolchain for my device. Here is my process: I'm using Valgrind 3.13.0 and Ubuntu 16 1/ cd Valgrind-3.13.0 2/ sed "s/armv7/arm/g" configure (so that it

Can someone explain this valgrind error with open mpi?

二次信任 提交于 2019-12-11 16:49:10
问题 My basic question is about how the suppression files work in valgrind. I have looked at a lot of the documentation that points to using the following on mpi versions > 1.5 (mine is 1.6): mpirun -np 2 valgrind --suppressions=/usr/share/openmpi/openmpi-valgrind.supp --track-origins=yes ./myprog However, when I run it like this the file has over 600 errors! The errors I am getting are these two over and over. I don't know how to interpret either one of these with my current understanding of

Memory Leak with import_array() for numpy Python3.5

回眸只為那壹抹淺笑 提交于 2019-12-11 15:26:02
问题 Could someone suggest a fix for this problem? When I use import_array(), Valgrind reports memory leak of 157528 bytes. Here is the small piece of code to replicate the problem on Ubuntu16.04 and Python3.5 #include <Python.h> #include "numpy/arrayobject.h" int main(int argc, char *argv[]) { Py_Initialize(); import_array(); Py_Finalize(); return 0; } Here are the relevant pieces of Valgrind report. ==85642== **2,689** bytes in 2 blocks are definitely lost in loss record 1,044 of 1,100 ==85642==