valgrind

Valgrind on macOS Sierra

拟墨画扇 提交于 2019-11-28 19:09:16
I following this guide: valgrind installation guide After I have downloading the package, and I have run the sh script, but when I launch the make install command, it couldn't create the folder because it don't have the permission (even though I have used the sudo command). Furthermore I tried with brew but I have this error: valgrind: This formula either does not compile or function as expected on macOS versions newer than El Capitan due to an upstream incompatibility. Error: An unsatisfied requirement failed this build. Musen You can download Valgrind's latest version from their website .

pthread_exit vs. return

杀马特。学长 韩版系。学妹 提交于 2019-11-28 17:25:27
问题 I have a joinable pthread runner function defined as below: void *sumOfProducts(void *param) { ... pthread_exit(0); } This thread is supposed to join the main thread. Whenever I ran my program through Valgrind I would get the following leaks : LEAK SUMMARY: definitely lost: 0 bytes in 0 blocks indirectly lost: 0 bytes in 0 blocks possibly lost: 0 bytes in 0 blocks still reachable: 968 bytes in 5 blocks suppressed: 0 bytes in 0 blocks ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 15

几个C++内存泄漏和越界检测工具简介

不羁岁月 提交于 2019-11-28 16:47:39
一、BoundsChecker 或许你还不知道大名顶顶的Nu-Mega,但一定听说过他们的产品SoftICE,BoundsChecker也是这家公司的产品。与Visual C++配合使用,据说威力强大。本人和没有实际用过,在此复制一下百度百科的简介,好有个简单的认识。 BoundsChecker是一个运行时错误检测工具,它主要定位程序运行时期发生的各种错误。它通过驻留在Visual C++开发环境内部的自动处理调试程序来加速应用程序的开发,缩短产品发布时间。BoundsChecker对于编程中的错误(大多数是C++中特有的)提供了清晰的详细的分析。它能够检测和诊断出在静态,堆栈内存中的错误以及内存和资源泄漏问题。在运行状态下BoundsChecker验证超过8700APIs和OLE方法,包括最新的Windows APIs,ODBC,ActiveX,DirectX,COM和Internet APIs。   BoundsChecker采用一种被称为Code Injection的技术,来截获分配内存和释放内存函数的调用。简单的说,当你的程序开始运行时,BoundsChecker的DLL被自动载入进程的地址空间,然后它会修改进程中分配和释放内存的函数的调用,让这些调用首先转入它的代码。BoundsChecker在做这些动作时,无需修改被调试程序的源代码或工程配置文件,这使得它使用非常的简便

What tools do you use to develop C++ applications on Linux? [closed]

允我心安 提交于 2019-11-28 15:00:27
I develop C++ applications in a Linux environment. The tools I use every day include Eclipse with the CDT plugin, gdb and valgrind. What tools do other people use? Is there anything out there for Linux that rivals the slickness of Microsoft Visual Studio? Zan Lynx I use a bunch of terminal windows. I have vim running on interesting source files, make and g++ output on another for compiler errors or a gdb session for runtime errors. If I need help finding definitions I run cscope and use vim's cscope support to jump around. Eclipse CDT is my second choice. It's nice but huge, ungainly and slow

Test for void pointer in C++ before deleting

空扰寡人 提交于 2019-11-28 13:57:17
I have an array in C++: Player ** playerArray; which is initialized in the constructor of the class it is in. In the destructor I have: delete playerArray; except when testing the program through Valgrind it says that there are some calls to delete to a void pointer: operator delete(void*) I want to test whether the playerArray is a void pointer before calling delete to avoid this error. Does anyone know how to do this? Perhaps you meant delete [] playerArray . You need the [] if the pointer is an array, not a single instance. Here's how operator delete is defined. void operator delete(void*)

Delete in c++ program is not freeing up memory [closed]

我只是一个虾纸丫 提交于 2019-11-28 13:56:10
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I created an object which has few integer variables, and one char memory block say which is allocated with memory of 300-500 bytes as its members . After that this object was pushed in to vector by one thread,

Valgrind reports leaked memory on OS X 10.8.1

僤鯓⒐⒋嵵緔 提交于 2019-11-28 13:47:55
I'm using Valgrind version 3.8.0 on OS X 10.8.1, Mountain Lion. Regarding compatibility with 10.8.1, Valgrind's site says (italics mine): Valgrind 3.8.0 works on {x86,amd64}-darwin (Mac OS X 10.6 and 10.7, with limited support for 10.8). I know, then, that there is only "limited support" for 10.8.1. Nonetheless, this bug report says (italics mine): This (the latest 3.8.0 release) makes Valgrind compile and able to run small programs on OSX 10.8. Be warned however that it still asserts with bigger apps, and 32 bit programs are not checked properly at all (most errors are missed by Memcheck). Ok

does openmp allocate memory and free all after

[亡魂溺海] 提交于 2019-11-28 12:38:40
Does openmp allocate memory and free all memory? Because I ran valgrind, and did free all my lists.. Everything that I malloc, did I free. ==11442== HEAP SUMMARY: ==11442== in use at exit: 192 bytes in 1 blocks ==11442== total heap usage: 2,001 allocs, 2,000 frees, 2,917,280 bytes allocated ==11442== ==11442== LEAK SUMMARY: ==11442== definitely lost: 0 bytes in 0 blocks ==11442== indirectly lost: 0 bytes in 0 blocks ==11442== possibly lost: 0 bytes in 0 blocks ==11442== still reachable: 192 bytes in 1 blocks ==11442== suppressed: 0 bytes in 0 blocks If not why can there still be a memory leak

Is anyone using valgrind and Qt?

爱⌒轻易说出口 提交于 2019-11-28 11:56:53
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 LibVEX; rerun with -h for copyright info ==12655== Command: ./leak ==12655== ==12655== ==12655== HEAP

Valgrind reports memory leak when assigning a value to a string

那年仲夏 提交于 2019-11-28 11:06:58
Valgrind reports a memory leak when assigning a value to a string. I used the following simple code to test an memory leak reported by Valgrind. /****************************************** * FILE: t3.c * Compiled using : g++ -g t3.c -o t3 * * $ g++ -v * Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/specs * Configured with: ./configure --prefix=/usr --infodir=/share/info --mandir=/share/man * --enable-languages=c,c++ --with-system-zlib --program-suffix=-3.4 --enable-threads=posix * Thread model: posix * gcc version 3.4.6 ******************************************/ #include <iostream>