Search code examples
valgrind

valgrind stuck on the beginning of running


Hi I'm trying to use valgrind to check a very simple code as follow

#include <stdlib.h>

int main() {
    // Allocate memory using malloc but forget to free it
    int *arr = (int*) malloc(sizeof(int) * 10);
    for (int i = 0; i < 10; i++) {
        arr[i] = i;
    }
    return 0;
}

All I did is

gcc -g test.c -o test.out
valgrind --tool=memcheck --leak-check=full ./test.out

And all I got is follow and the process stucks....

[shore@shore-82b6 manjaro_note]$ valgrind ./test.out
==21491== Memcheck, a memory error detector
==21491== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==21491== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==21491== Command: ./test.out
==21491== 

Solution

  • Still not enough detail to be certain, but it sounds like you have a problem with debuginfod.

    Run with --enable-debuginfod=no, it should solve your problem.

    EDIT: I looked on the Valgrind web site and saw that this option wasn't documented there, so I added it to the debuginfod section.