valgrind

Suppression files for Qt memory leaks with Valgrind

独自空忆成欢 提交于 2019-11-27 06:50:10
问题 I usually write my classes in C++ and check if they leak memory using valgrind on Linux platform. I'm not satisfied until all the heap memory is freed. Starting to write in Qt, I found how many leaks valgrind detects, also on a simple project. They are so many that it's difficult to detect my same leaks. I read somewhere that is possibile to use a suppression files for valgrind which helps filtering out the unwanted leaks, but I can't find it. I'm using Ubuntu 11.04 x64, g++ 4.5, Qt 4.7. Does

How to start an android app with valgrind

℡╲_俬逩灬. 提交于 2019-11-27 06:45:35
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/valgrind $VGPARAMS $* And here's setprop: adb shell

Is anyone using valgrind and Qt?

耗尽温柔 提交于 2019-11-27 06:37:08
问题 I am trying to debug a large application build using Qt/C++ and valgrind is reporting a lot of memory leak from internal Qt stuff. Could anyone share a proper valgrind suppression file for Qt apps ? Thanks ! Eg. #include <qobject.h> int main() { QObject o; return 0; } returns: $ valgrind --leak-check=full --show-reachable=yes ./leak ==12655== Memcheck, a memory error detector ==12655== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==12655== Using Valgrind-3.5.0-Debian and

Windows Callgrind results browser, alternative to KCacheGrind [closed]

情到浓时终转凉″ 提交于 2019-11-27 05:12:49
问题 Is there any tool, other than KCacheGrind, being able to view callgrind results? Preferably for Windows platform? 回答1: alleyoop and valkyrie are alternative front ends. May have enough suport for what you want, you can use mingw to compile for Windows native if SUA does not work out of the box. 回答2: I have compiled kcachegrind on windows using QT4.7, here is the binary bundle (including the dot utility to generate call graph): http://sourceforge.net/projects/precompiledbin/files/kcachegrind

How to install Valgrind on macOS Mojave(10.14) with Homebrew?

不想你离开。 提交于 2019-11-27 05:06:26
问题 I tried to install Valgrind with command brew install Valgrind and I get a message says "valgrind: This formula either does not compile or function as expected on macOS versions newer than Sierra due to an upstream incompatibility. Error: An unsatisfied requirement failed this build." I tried to install with the command brew intall --HEAD Valgrind instead, after successfully installed the dependencies autoconf, automake and libtool, when it tries to install valgrind, I get a configure error:

Linux上使用Qt Creator进行C/C++开发

大城市里の小女人 提交于 2019-11-27 05:02:16
Qt Creator支持中文,启动速度比Eclipse、Netbeans更快,界面也更美观,跟输入法Fcitx协作良好(光标跟随)。 你既可以把Qt Creator当代码编辑器作为vim辅助,好处在于Qt Creator能够自动parse项目,形成友好快速的智能提示,而且你也同样可以使用Qt Creator里面的gdb前端(上图)和 valgrind前端(高清大图) 对项目进行调试和内存分析,不过Makefile就要自己写或者用autotools生成了,这对于使用vim进行编程的同学来说,应该是轻车熟路的。差点忘了,连续按两次Alt+V快捷键即可进入VIM编辑模式(FakeVim),这应该很能吸引vim用户。当然,Qt Creator默认支持主流版本控制系统git/hg/svn等。 你也可以把Qt Creator当作IDE,这时可以作为Eclipse CDT、 Netbeans for C++这些重量级IDE的一个轻量替代品。你可以直接在Qt Creator的向导里新建一个非Qt使用CMake自动构建的项目,这意味着你不用自己写Makefile,你只要在Qt Creator里“执行CMake”就能自动生成。当然,你也可以导入一个make构建的项目到Qt Creator里编译调试,比如Nginx。 1、安装Qt Creator和基础构建环境(以Ubuntu为例):

valgrind memory leak errors when using pthread_create

岁酱吖の 提交于 2019-11-27 04:37:23
I'm writing a program using the pthread library. When I run my program with the command valgrind --leak-check=full , I get the following errors description: ==11784== ==11784== **HEAP SUMMARY:** ==11784== in use at exit: 4,952 bytes in 18 blocks ==11784== total heap usage: 1,059 allocs, 1,041 frees, 51,864 bytes allocated ==11784== ==11784== **288 bytes** in 1 blocks are possibly lost in loss record 2 of 3 ==11784== at 0x4C2380C: calloc (vg_replace_malloc.c:467) ==11784== by 0x4010D2E: _dl_allocate_tls (dl-tls.c:300) ==11784== by 0x55DC218: **pthread_create**@@GLIBC_2.2.5 (allocatestack.c:570)

valgrind memory leak errors when using pthread_create

做~自己de王妃 提交于 2019-11-27 03:58:21
问题 I'm writing a program using the pthread library. When I run my program with the command valgrind --leak-check=full , I get the following errors description: ==11784== ==11784== **HEAP SUMMARY:** ==11784== in use at exit: 4,952 bytes in 18 blocks ==11784== total heap usage: 1,059 allocs, 1,041 frees, 51,864 bytes allocated ==11784== ==11784== **288 bytes** in 1 blocks are possibly lost in loss record 2 of 3 ==11784== at 0x4C2380C: calloc (vg_replace_malloc.c:467) ==11784== by 0x4010D2E: _dl

Valgrind reporting a segment overflow

大兔子大兔子 提交于 2019-11-27 03:42:57
问题 When running my program with valgrind / callgrind I get the following message a lot: ==21734== brk segment overflow in thread #1: can't grow to 0x4a39000 (with different addresses) Note that it is not preceded by a stack overflow message. I can't find any documentation on this message and I have no idea what is overflowing exactly. Can anybody help me figure out what the problem is? Is this a problem of valgrind, or of my program? 回答1: Line 1327 from the valgrind source code points to the

What happened when we do not include '\0' at the end of string in C?

做~自己de王妃 提交于 2019-11-27 03:42:19
问题 In C, when I initialize my array this way: char full_name[] = { 't', 'o', 'a', 'n' }; and print it with printf("%s", full_name); and run it with valgrind I got error Uninitialised value was create by stack allocation Why do that happen? 回答1: Since %s format specifier expects a null-terminated string, the resulting behavior of your code is undefined. Your program is considered ill-formed, and can produce any output at all, produce no output, crash, and so on. To put this shortly, don't do that