Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
36 views

Facing Memory Allocation Issue in malloc During Function Execution

The error stating that memory cannot be allocated at the same point in malloc with the same number of repetitions keeps occurring. received signal SIGSEGV, Segmentation fault. pid_t getPIDByName(const ...
임수환's user avatar
1 vote
1 answer
56 views

Valgrind gives an error "Invalid read of size 4"

I'm reading float data in from a file and Valgrind gives the error "Invalid read of size 4". I'm a new user of Valgrind and don't understand why I get this error. My code is: int main() { ...
Jim Rasmussen's user avatar
0 votes
0 answers
74 views

Double free when trying to free memory allocated in a Chained Hashmap in C

Apologies in advance for the code dump, I can't really think of another way to show my issue properly. For a school project I have to make a bakery simulation and since it has to fit within certain ...
LangleyMann's user avatar
2 votes
1 answer
79 views

Why does Valgrind report "uninitialized value" but not "invalid read" in my C++ vector access?

I am working on a C++ program that involves accessing elements in a std::vector . I encountered an issue when running my code with Valgrind, where it reports an "uninitialized value" error, ...
kaixin liu's user avatar
5 votes
2 answers
120 views

Is boost::filesystem thread-safe?

Here is the following case I am observing on my Debian stable system: % valgrind --tool=drd ./threads ==1368067== drd, a thread error detector ==1368067== Copyright (C) 2006-2020, and GNU GPL'd, by ...
malat's user avatar
  • 12.3k
0 votes
1 answer
25 views

Valgrind Warning: set address range perms: large range when using -DCMAKE_BUILD_TYPE=DEBUG

I am working with a fortran program (this repository), which I compile using the newest intel LLVM compiler. This works fine when I don't supply any flags, but when I compile with -DCMAKE_BUILD_TYPE=...
Yes's user avatar
  • 393
1 vote
1 answer
55 views

Conditional jump or move depends on uninitialised value(s) ADT Set [closed]

I have been trying to implement a Set ADT using open addressing for the hash table and lazy deletion, however, I am having problems with the resizing of the Set. I can insert elements up to 75% of the ...
hrodric's user avatar
  • 409
0 votes
2 answers
56 views

Make a valgrind error suppression generic for a system call

Using valgrind in the context of a C++ project, I have been trying to suppress uninitialised byte information coming from system calls within third party libraries. How could I generate the specific ...
kaixin liu's user avatar
1 vote
0 answers
44 views

Is GLFWTerminate Leaking Memory?

I have been using GLFW in a recent project of mine, and felt it was necessary to run the code through Valgrind for a leak check. However, when I did, two memory leaks were reported during the close of ...
Zenais's user avatar
  • 126
0 votes
1 answer
66 views

valgrind unhandled instruction bytes / Unrecognised instruction

I want to check my C++ application in valgrind as I get weird crashes on some machines, but not on my machine which I use for developing. But I cannot get anywhere. Right as the application starts up ...
ray_ray_ray's user avatar
0 votes
0 answers
67 views

SDL huge memory leaks [duplicate]

I found a huge memory leak in the initialisation of SDL. So I wrote a basic code to test SDL: #include <SDL2/SDL.h> #include <stdio.h> int main(int argc, char *argv[]) { if (SDL_Init(...
Theo Tajbakhsh's user avatar
0 votes
0 answers
59 views

Valgrind shows weird results when using it with SDL2

I am writing an additional layer on SDL2 for personal use. I'd like to check for memory leaks, so I downloaded Valgrind and read a quick start page. I launched a program that uses my library in ...
Hobbes's user avatar
  • 205
0 votes
0 answers
56 views

My binary is not establishing SCTP connection when running using Valgrind

In my program two binaries are there, one binary [let's call it binary1] is trying to establish SCTP connection with the other binary[let's call it binary2]. In normal condition binary1 is able to ...
Adwaith R Krishna's user avatar
0 votes
0 answers
51 views

kcachegrind can't connect to display

For a school project I have to use Valgrind and other tools to help optimise a program. I'm on macOS 14.0 and using a Lima VM to run the profiling tools, but this is my first time using an environment ...
Giacomo Amaducci's user avatar
1 vote
1 answer
136 views

Difference in Memory Usage Between malloc and new in C++

I'm observing a difference in the total memory allocation when using malloc versus new in a simple C++ program, as reported by Valgrind. Below are the two versions of my program and the corresponding ...
sajad's user avatar
  • 13
1 vote
1 answer
112 views

Mergesort for singly-linked lists gives correct results but leaks memory

I'm working on an assignment to implement mergesort for singly-linked lists in C++. The merge function needs to merge two sorted lists in-place without creating new nodes. The mergesort function ...
Milad Khazani's user avatar
1 vote
1 answer
67 views

Valgrind is still showing memory is reachable with addrec() [closed]

The following code is for creating and managing hash table: hash.c: #include <stdio.h> #include <stdlib.h> #include "hash.h" typedef struct node { record_t rec; struct ...
bigmacBucky's user avatar
0 votes
2 answers
115 views

How to detect Out-of-Bounds Access within Placement New Boundaries in C++?

#include <iostream> struct mix { int64_t x[10]; }; int main() { int64_t* p = new int64_t[100]; mix* px = new (p) mix; mix* py = new (p + 10) mix; px->x[12] = 104; std::cout <&...
种传龙's user avatar
0 votes
1 answer
23 views

double free or corruption (out), coredump. Where can I find the coredump?

I have been working in Fedora on a C++ client for the BaseX XML database. The original version of the client was developed in Eclipse and consisted of a test program and some source files that allowed ...
Ben Engbers's user avatar
0 votes
1 answer
40 views

Valgrind Massif - startpoint for memory allocation [cpp]

I just started getting in touch with Valgrinds massif tool and wanted to know, if one could introduce a checkpoint to start monitoring the heap allocation. Considering the following basic example: #...
Chief's user avatar
  • 181
0 votes
1 answer
34 views

--trace-children-skip option is not having any impact with Valgrind

I have a run.sh with: ./opt/exm/bin/exm_daemon exm_daemon spawns many process. I run valgrind with options: sudo valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --trace-children=...
noob-sys-dev's user avatar
1 vote
0 answers
41 views

Why is Callgrind not working on my project?

I tried using callgrind on my program written in C language but it is not working. This is the output it gives me when I try to launch it: (https://i.sstatic.net/pBeyJRYf.png) It was working before, ...
Federica Censabella's user avatar
0 votes
1 answer
64 views

Valgrind complain after modifing reference return variable from a vector in c++

I am trying to modify an std::vector through the use of references, the vector lifetime is designed in such a way modifications through the reference always are valid, in other words the the reference'...
user1006274's user avatar
0 votes
0 answers
269 views

Valgrind fatal error at startup in arch linux

I installed valgrind on my arch system through sudo pacman -S valgrind and when attempting to run it, this message appears: ==3821== Memcheck, a memory error detector ==3821== Copyright (C) 2002-2024,...
Victor fernandes's user avatar
0 votes
0 answers
38 views

Build valgrind to target LPC55S69(which is based on Armv8-m architecture)

I'm trying to build valgrind to target baremetal arm cortex-m (based on armv8-m architecture). The host is a x86 wsl environment. How do I specify this while trying to configure valgrind. For ex: To ...
randomranger409's user avatar
2 votes
1 answer
87 views

Unable to debug python C extension using valgrind

I am trying to debug a C extension I made using CFFI. I am using Python 3.11 and Valgrind 3.18.1. As far as I can tell from the docs the only setup needed is setting the PYTHONMALLOC=malloc ...
Slav's user avatar
  • 357
0 votes
1 answer
77 views

Valgrind stack measurement

I would like to clarify some points about using Valgrind soft in order to measure stack usage size. I'm using Linux OS. My main program is written on C++ and using 3-d party shared libraries(some ...
Greg's user avatar
  • 1
0 votes
1 answer
59 views

Enable/disable flags when doing a valgrind build

I have two targets in my Makefile, namely: all: $(TARGET) valgrind: $(TARGET) ... ... ... The valgrind target simply runs the executable with the valgrind program. The CFLAGS for this ...
Harith's user avatar
  • 7,265
0 votes
2 answers
61 views

Valgrind (C): Process terminating with default action of signal 11 (SIGSEGV)

I am doing a school project on AVL tree in C. And the code is presenting the following errors. It compiles nicely but it is terminating with Segmentation fault (core dumped). ==210456== Invalid read ...
Asteria101's user avatar
0 votes
0 answers
39 views

How to apply larger memory for Valgrind

I use Valgrind to check memleak in my project -- a trading system server. When the memory database size configured on the server is large (64G or more), valgrind will exit when I start detecting. How ...
epiphany ch's user avatar
0 votes
1 answer
99 views

EGL memory leak

I've been told EGL is a good choice to render graphics in wayland window. I'm not yet convinced and I still don't know if (except vulkan) it is the only way to have some openGL magic in a wayland ...
Lewis Anesa's user avatar
0 votes
0 answers
58 views

Unexpected double free in single linked list

`I am trying to do a simple linked list. Everything works fine, but after the program calls ~List() I am getting "double free in tcache2" and SIGABRT every time I run the program and ...
Juliusz Bednarek's user avatar
0 votes
0 answers
32 views

Valgrind massif shows ??? for simple c++ program compiled with -g

I have ran the C example provided in massif docs https://valgrind.org/docs/manual/ms-manual.html and it works as expected. However it shows??? for this simple c++ program. main.cc #include <string&...
zza's user avatar
  • 85
0 votes
1 answer
48 views

valgrind shows memory leak in my program in c (two versions)

int main() { double (*arr)[COLS] = (double*)malloc(sizeof(*arr) * ROWS); assert(arr!= NULL); for (int i = 0; i < ROWS; i++) { for (int j = 0; j < COLS; j++) {...
Κώστας Κατσάκος's user avatar
0 votes
1 answer
44 views

Invalid write trying to allocate a 2D sheet of structures

My allocution of memory is incorrect and therefore i got a seg fault. I want to create a board game represented by a 2D sheet of cases (structures). For the context, i'm coding a game of Tetris. The ...
R B's user avatar
  • 1
0 votes
0 answers
61 views

How to debug memory leaks when using DearImGUI with valgrind

I'm trying to detect memory leaks in my program by using valgrind, so I run: valgrind ./MCU_EMULATOR --leak-check=full the program consists of a GUI, but when running with valgrind the GUI never pops ...
Mrmudkip's user avatar
  • 101
0 votes
1 answer
101 views

Why do I keep getting a Valgrind set address range perms warning in my code?

I don't see what I could possibly be doing wrong to keep getting this valgrind error. I'm not leaking any memory.. In my project, I have to implement a graph, a fundamental graph algorithm, and have a ...
httpantwon's user avatar
-2 votes
1 answer
111 views

Why is my program spending 79.26% of its time in _dl_start?

I'm trying to profile a C++ program with callgrind, and I was certainly not expecting it to spend most of its time opening dynamic libraries. I don't see any of the functions that I know to take time (...
Thibault Lemaire's user avatar
0 votes
1 answer
122 views

Is there any way to use valgrind from C/C++ via the API?

I want to write tool, that collects different runtime information about executable including heap information. Valgrind is perfect tool to get such info. The key information, that I want to obtain is ...
Roman's user avatar
  • 37
0 votes
1 answer
123 views

Weird memory leak in Valgrind in a print function

So this is a C script for managing parking lots, and I have this struct: typedef struct { char name[MAXSIZE]; int capacity; char car_plates[MAXREGISTRATIONS][PLATE_SIZE]; char ...
baptzera's user avatar
0 votes
0 answers
84 views

Error Using Valgrind's callgrind and kcachegrind on a C++

I've been trying to analyze a simple C++ program that uses fork() to create a child process. The program compiles and runs fine. But, when I try to use Valgrind's callgrind tool to profile the program,...
Hassan Zubair's user avatar
1 vote
0 answers
65 views

How to correctly rebuild a C++ project as a Debug using CMake for further profiling with Valgrind?

I have a C++ project that I previously built using CMake. Now I need to rebuild it as Debug so that I can profile it with Valgrind to find code bottlenecks. However, I have a problem with the rebuild. ...
AlxDidorenko's user avatar
-1 votes
1 answer
73 views

Valgrind error when loading font in SFML project

This code: // g++ sfml.cpp -o sfml_test -lsfml-graphics -lsfml-window -lsfml-system #include <SFML/Graphics.hpp> #include <iostream> int main() { sf::Font font; if (!font....
Momus's user avatar
  • 5
1 vote
1 answer
192 views

Why does version 3.22.0 of Valgrind-based Helgrind thread error detector reports data races and version 3.18.1 does not?

1.Background The following C++ code from cppreference.com illustrates how std::condition_variable is used in combination with a std::mutex to facilitate inter-thread communication. #include <...
NeverStopLearning's user avatar
0 votes
0 answers
20 views

Filtering callgrind capture based on shared library name

I would like to have a coarse filter for my callgrind output. If I ask callgrind to capture a run, I want to tell it to prune at a .so level. For instance, I would like to tell it that it should not ...
Bram's user avatar
  • 8,083
1 vote
1 answer
75 views

C Program runs but GDB fails before main. Using GSL

I am writing a C program that loads two tables as matrices to perform operations on using the open-source GSL library. When compiled, the program prompts for the two files needed and enters an ...
DogIsGreat's user avatar
1 vote
0 answers
216 views

Thread #1: Bug in libpthread: sem_wait succeeded on semaphore without prior sem_post

I'm having an error feedback from Helgrind Thread #1: Bug in libpthread: sem_wait succeeded on semaphore without prior sem_post. This is for an exercise where I'm limited in the functions I can use ...
JADS's user avatar
  • 11
0 votes
1 answer
30 views

Valgrind and wildcard?

According to the valgrind docs: Locations may be names of either shared objects, functions, or source lines. They begin with obj:, fun:, or src: respectively. Function, object, and file names to ...
ABu's user avatar
  • 11.4k
0 votes
1 answer
32 views

Understanding stack matching rules for custom suppressions

I applied Valgrind over some C/C++ processes of mine, containing a lot of errors coming from libraries I'm not interested in and that I'd like to suppress. Let's call them banned libraries. The ...
ABu's user avatar
  • 11.4k
1 vote
1 answer
106 views

Can't detect a memory leak

I wrote a program to search for the longest sentence in several text files: /* lngst_sentence_file_competition.c */ #include <stdio.h> #include <stdlib.h> enum consts { str_len = 5 };...
Fyodor's user avatar
  • 105

1
2 3 4 5
85