valgrind

Are there known false positives issues with Valgrind?

回眸只為那壹抹淺笑 提交于 2019-12-03 11:11:14
问题 Are there any known false positives with Valgrind? I get a 'Conditional jump or move depends on uninitialised value(s)' with the fmemopen function, writing in C and compiling with GCC. Can I be sure it's real? EDIT: Are there known issues that are not in the suppression files? Are there some things one can do in a program, that are not really errors but Valgrind will say they are? If there are known issues, a list would be nice. 回答1: Yes, there are false positives with Valgrind, that's why it

Valgrind: invalid read of size 4 -> sigsegv, works fine without valgrind and in visual studio

旧城冷巷雨未停 提交于 2019-12-03 11:03:21
I have implemented a compression algorithm (using huffman coding) which uses a priority queue of nodes (a struct i defined). Now, when i just run the code in linux or in visual studio, everything works fine. When I check for memory leaks in visual studio, none are given. The problem now is, when I use valgrind to analyse my program, it terminates with signal 11 (sigsegv). The first error encountered is an 'invalid read of size 4' in the method delete min. Other errors after that are: Adress is 0 bytes inside a block of size 453 freed, invalid write of size 4, invalid free,delete or realloc.

valgrind doesn't accept newest version of glibc

冷暖自知 提交于 2019-12-03 10:55:23
问题 Valgrind doesn't like glibc 2.15: checking the GLIBC_VERSION version... unsupported version 2.15 configure: error: Valgrind requires glibc version 2.2 - 2.14 How can I deal with this? do I have to downgrade glibc? I'm working on Ubuntu 12.04 if that is pertinent info. Update: So I was attempting to download source and install from there instead of using apt-get since I'm going through Learn C the Hard Way. After I got this problem I resorted to apt-get to see if it would work. it installed

std::string operator+() memory leak?

故事扮演 提交于 2019-12-03 10:53:20
I'm quite worry because I wrote a little application and it seems that there is a memory leak if I believe valgrind (What I actually do): ==9321== 251 bytes in 7 blocks are definitely lost in loss record 1 of 1 ==9321== at 0x402569A: operator new(unsigned int) (vg_replace_malloc.c:255) ==9321== by 0x40D3D05: std::string::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char> const&) (in /usr/lib/libstdc++.so.6.0.13) ==9321== by 0x40D4977: std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned int) (in /usr/lib/libstdc++.so.6.0.13) ==9321== by 0x40D57AC: std::string:

Valgrind yells about an uninitialised bytes

≡放荡痞女 提交于 2019-12-03 10:47:52
问题 Valgrind throws me out this error: ==11204== Syscall param write(buf) points to uninitialised byte(s) ==11204== at 0x4109033: write (in /lib/libc-2.13.so) ==11204== by 0x8049654: main (mmboxman.c:289) ==11204== Address 0xbe92f861 is on thread 1's stack ==11204== What's the problem? I can't find what uninitialised byte it is yelling about. Here are the criminal lines of code (the mentioned 289 line is the one which calls the function lockUp): Request request; Response response; fillRequest(

Valgrind output with address and question marks?

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have just receive an output from valgrind that I do not quite understand: ==20290== Invalid read of size 1 ==20290== at 0x8C1D678: ??? ==20290== by 0x5D74C47: ??? ==20290== Address 0xee818c7d is not stack'd, malloc'd or (recently) free'd ==20290== ==20290== ==20290== Process terminating with default action of signal 11 (SIGSEGV) ==20290== Access not within mapped region at address 0xEE818C7D ==20290== at 0x8C1D678: ??? ==20290== by 0x5D74C47: ??? ==20290== If you believe this happened as a result of a stack ==20290== overflow in your

GDB remote debugging with valgrind

主宰稳场 提交于 2019-12-03 10:08:56
问题 If I remote debug using gdb I connect to the gdbserver using target remote host:2345 If I debug memory errors with valgrind and gdb (to break on invalid memory access) I use target remote | vgdb (after starting valgrind --track-origins=yes --vgdb=yes --vgdb-error=0 [binary] on the local machine) Can I combine the two to debug memory errors on a remote machine? Note that I want to avoid using a login shell on the remote machine to work there. 回答1: Can I combine the two to debug memory errors

How to Learn C Debugging and Best Practices [closed]

二次信任 提交于 2019-12-03 09:55:41
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I've written an Apache module in C. Under certain conditions, I can get it to segfault, but I have no idea as to why. At this point, it could be my code, it could be the way I'm compiling the program, or it could be a bug in the OS library (the segfault happens during a call to

How to start an android app with valgrind

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been searching for the last week trying to find an answer to this question. How do I start an Android app with valgrind? I know I can start an app with the 'am' command, but it starts the app and exits. I'm writing an app that uses the NDK for native C code, and I need to check it for suspected memory errors. Edit: I've learned a little more. You can "wrap" an app with a shell script. Here's the shell script I'm using: #!/system/bin/sh VGPARAMS='--error-limit=no' export TMPDIR=/data/data/com.starlon.froyvisuals exec /data/local/Inst/bin

Profiling a C or C++ based application that never exits [closed]

匿名 (未验证) 提交于 2019-12-03 08:50:26
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a small doubt regarding profiling applications which never exit until we manually reboot the machine. I used tools like valgrind which talks about memory leaks or bloating of any application which exits after sometime. But is there any tool which can be used to tell about memory consumption, bloating, overhead created by the application at various stages if possible? NOTE: I am more intrested to know about apps which dont exit ... If an app exits I can use tools like valgrind .. 回答1: I'd consider adding a graceful exit from the