4,232 questions
Score of 3
3
votes
1 answer
1
answer
173 views
173
views
How to make two structs to share the same data in C
I am developing the push swap problem, where I need to work with two stacks.
One of the tasks my program needs to do is to keep track of the number of operations of each type, there are 11 of them ...
Score of 0
0
votes
1 answer
1
answer
185 views
185
views
'valgrind --tool=massif' crashes with SIGTRAP inside `pthread_cond_timedwait` on RHEL 9/glibc 2.34
We're running a multithreaded C application under valgrind --tool=massif on RHEL 9 (glibc 2.34 and Valgrind 3.22.0) and seeing a crash with SIGTRAP inside pthread_cond_timedwait. The process dies ...
Score of 3
3
votes
1 answer
1
answer
199 views
199
views
Conditional jump or move depends on uninitialised value(s) with php_pcre_match_impl
I'm creating a simple function in PHP-C extension, I'm using PHP 8.3 from source, enable opcache and pcre.jit. I set ZEND_DONT_UNLOAD_MODULES is 1 and USE_ZEND_ALLOC is 0 for the Valgrind
Inside my ...
Score of 4
4
votes
2 answers
2
answers
155 views
155
views
Valgrind addresses vs Printf addresses in C
I create this simple C code to produce a buffer overflow:
#include <stdio.h>
#include <stdlib.h>
void main(void)
{
int i=0;
char *buffer=NULL;
...
Score of 2
2
votes
1 answer
1
answer
102 views
102
views
Find out why program is slow processing files from network share using Valgrind
I have an open source C/C++ program on Linux amd64 that processes a PDF input file and that I did not write by myself. So I'm not familiar with its code.
Processing a PDF file read from local disk ...
Score of 0
0
votes
0 answers
0
answers
87 views
87
views
Confused by Valgrind Massif output - appears memory allocated under "free"
I'm attempting to use Massif to profile heap usage of an application. I'm running with the --pages-as-heap=true option and am confused by some output I'm seeing. Specifically I'm seeing allocation by ...
Score of 9
9
votes
1 answer
1
answer
377 views
377
views
Valgrind (Helgrind) is showing data race with atomic
In the following program, I want to print the output as
0102030405... so on
The 0 should be printed from one thread, odd values should be printed from second thread and even values from third thread....
Score of 0
0
votes
1 answer
1
answer
74 views
74
views
How to get valgrind to print final tool stats for rustc
Perhaps someone knows why Valgrind tools fail to print final stats when applied to rustc ?
E.g. lackey works fine with C programs:
$ valgrind -q --tool=lackey --basic-counts=yes whoami
yugr
==3668989==...
Score of 2
2
votes
1 answer
1
answer
151 views
151
views
Still reachable valgrind report when execve fails
I am building a shell as part of a school assignment, a limited version of bash. The whole program seems to function alright without any kind on leaks, but when I send invalid/nonexistent commands ...
Score of 1
1
vote
1 answer
1
answer
114 views
114
views
CS50 Speller Valgrind error: Jump or move depends on uninitialized value(s)
I am currently completing the introductory CS course CS50 only and got stuck on the problem "speller" from problem set 5. In this problem, one is given a set of prewritten .c-files, ...
Score of 1
1
vote
1 answer
1
answer
44 views
44
views
Is there's an easy way to give valgrind client the illusion of (plausible) real time
If I run a program under valgrind that also keeps track of time, is there a way to make it get plausible results given the amount of code it has executed.
What I'm planning to do is to run GStreamer ...
Score of 3
3
votes
2 answers
2
answers
142 views
142
views
Custom free function doesn't release memory completely, Valgrind reports 'still reachable'
I've been following an article that walks through implementing primitive versions of malloc and free. After finishing the allocator, I wanted to test it using Valgrind, so I added the following lines ...
Score of 1
1
vote
2 answers
2
answers
59 views
59
views
Is it recommended to run valgrind on a binary generated using multiple processors
I have a binary which was generated using 10 threads i.e. I used GNU make command
make -j10
to generate my binary. If I run valgrind on the generated binary, will the valgrind result be reliable. ...
Score of 1
1
vote
2 answers
2
answers
83 views
83
views
How to run valgrind for apache cgi module?
My CGI application written in C has memory corruption. I would like to attach valgrind while running the application. How do I do that? As apache is invoking the cgi module, I dont have an option to ...
Score of 7
7
votes
2 answers
2
answers
280 views
280
views
C++ embedded TCL interpreter possible memory leaks
I have code which embeds a tcl interpreter in my c++ program. When running with valgrind it shows a bunch of possible memory leaks from the TCL interpreter. I am using Tcl_DeleteInterp(interp); to ...