valgrind

cpp gdb valgrind - memory usage statistic while app is running and valgrind unhandled syscall

此生再无相见时 提交于 2019-11-28 11:00:20
问题 1) I want to get information about memory usage while my program is running (by request). My program create session-objects on the fly and I want to get information about memory usage of all there objects. Is it possible? Seems this can be done by Valgrind . How to use it? How to run it? (commands) 2) My program is background multithread daemon (it also use Local Unix Sockets). I can not run my program under valdrind valdrind ./daemon start . I got following tons of messages: --19454-- it at

Valgrind reporting a segment overflow

三世轮回 提交于 2019-11-28 10:39:35
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? Piwi Line 1327 from the valgrind source code points to the user manual, "see section Limitations in user manual": Limits section item 1: On Linux, Valgrind

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

为君一笑 提交于 2019-11-28 10:38:42
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? 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. This is not to say that all arrays of characters must be null-terminated: the rule applies only to arrays

Memory leak in OpenSSL function EVP_EncryptFinal_ex

大兔子大兔子 提交于 2019-11-28 08:28:10
问题 I implemented encryption procedure based on the tutorial: http://www.openssl.org/docs/crypto/EVP_EncryptInit.html# When I run it trough valgring and got the following report: ==2371== 176 bytes in 1 blocks are still reachable in loss record 3 of 6 ==2371== at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64- linux.so) ==2371== by 0x56CA133: CRYPTO_malloc (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0) ==2371== by 0x575280F: lh_new (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0) =

Is there Valgrind Memcheck like tool for windows to debug use after free errors? [closed]

☆樱花仙子☆ 提交于 2019-11-28 07:26:00
Durring my work I regulary face rather common programming error - using some object which has already been freed. This invokes UB in C++. On linux , this kind of problems are usually resolved by using Valgrind tool Memcheck. From Memcheck manual : Memcheck tries to establish what the illegal address might relate to, since that's often useful. So, if it points into a block of memory which has already been freed, you'll be informed of this, and also where the block was freed. Memcheck provides me call stack, where the object was deallocated and I can go on and debug the problem. Is there similar

Valgrind does not work with WSL?

拈花ヽ惹草 提交于 2019-11-28 06:24:33
问题 When I installed WSL for my computer I was very excited to have a more natively supported Linux system rather than using VirtualBox . However I get this error when I try to run it. Is there a reason why? I am happy to give more information as required. --4364:0:aspacem -1: ANON 0038000000-00383d5fff 4022272 r-x-- SmFixed d=0x000 i=25365 o=0 (0) m=0 /usr/lib/valgrind/memcheck-amd64-linux --4364:0:aspacem Valgrind: FATAL: aspacem assertion failed: --4364:0:aspacem segment_is_sane --4364:0

Valgrind reports memory 'possibly lost' when using glib data types

只愿长相守 提交于 2019-11-28 05:53:15
I'm developing a library using a number of glib datastructures (GHashTable, GSList etc.). I've been checking my code frequently for memory leaks using valgrind. Most of the issues valgrind points out are quite easy to fix, however there's a few that I can't figure out. All of these are reported as 'possibly lost'. At the top of the valgrind stacktrace, I always find the same 4 libraries: ==29997== 1,512 bytes in 3 blocks are possibly lost in loss record 24 of 25 ==29997== at 0x4004B11: memalign (vg_replace_malloc.c:532) ==29997== by 0x4004B6B: posix_memalign (vg_replace_malloc.c:660) ==29997==

Are there any alternatives to valgrind on Mac OS X Mountain Lion and Mavericks to detect memory leaks for C/C++ applications? [closed]

寵の児 提交于 2019-11-28 05:42:21
I used to use valgrind to detect memory leaks for my C/C++ applications on Mac OS X 10.6 (Snow Leopard) and 10.7 (Lion), but I find it's not supported on recent releases like 10.8 (Mountain Lion) and 10.9 (Mavericks) when I upgraded my OS. Is there something else like valgrind that can be installed on Mac OS X 10.9? On 2013-11-01, the valgrind team announced Valgrind 3.9.0: We are pleased to announce a new release of Valgrind, version 3.9.0, available from http://www.valgrind.org . 3.9.0 is a feature release with many improvements and the usual collection of bug fixes. This release adds

Why doesn't valgrind spot the leak when program was compiled with gcc-5.2.0

五迷三道 提交于 2019-11-28 05:37:18
问题 Today I was coding something and after I was done, I made a check with valgrind and I got a surprise. If I compile my program on my Ubuntu (15.04 64BIT) with gcc-4.9.2 with the following: gcc -Wextra -Werror -Wstrict-prototypes -Wconversion --std=c11 -O2 -g program.c -o program And then run valgrind: valgrind --leak-check=full --track-origins=yes ./program I get the following output: ==5325== Memcheck, a memory error detector ==5325== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward

Windows Callgrind results browser, alternative to KCacheGrind [closed]

試著忘記壹切 提交于 2019-11-28 03:41:32
Is there any tool, other than KCacheGrind, being able to view callgrind results? Preferably for Windows platform? RandomNickName42 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. 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.zip/download Mario Awad Try WebGrind: https://github.com/jokkedk/webgrind Runs on your local PHP