Category : valgrind

I implement the stack with a minimum. In this program, I get an error from valgrind. Something is wrong with the push() and main() functions. When I add delete st; to the push() function, I get even more errors. I check it through valgrind ./a.out. Sorry for the long code. I also wrote the rest ..

Read more

I have a relatively large code base built by catkin_make and I would like to generate the call graph of the same. However I am not able to generate build symbols from CMake. To reproduce, I have my CMake as follows – cmake_minimum_required(VERSION 3.10) project(mytest) set(CMAKE_CXX_STANDARD 11) set(CMAKE_BUILD_TYPE RelWithDebInfo) set(CMAKE_CXX_FLAGS "-g -pg") #set(CMAKE_CXX_FLAGS_DEBUG "-g -pg") ..

Read more

I am getting memory leak, and it seems like it is caused by allocating variables on stack. I will include what I get when I run valgrind, Functions used to allocate variable and some lines of code that valgrind is pointing tobas a coment. CompanyTracker::CompanyTracker(int n) { numCompanies = n; companies = new Company*[numCompanies]; for ..

Read more

I am trying to write a C++ code using MPI (version: OpenMPI/4.0.1-GCC-8.3.0-2.32), in which I will gather some std::vectors as follows: #include <iostream> #include <vector> #include <mpi.h> int main() { MPI_Init(NULL, NULL); int world_size; MPI_Comm_size(MPI_COMM_WORLD, &world_size); int world_rank; MPI_Comm_rank(MPI_COMM_WORLD, &world_rank); int num = 10; std::vector<double> yield; yield.resize(num, 0); for (int i = 0; i < ..

Read more

I am trying to write a C++ code using MPI (version: OpenMPI/4.0.1-GCC-8.3.0-2.32), in which I will gather some std::vectors as follows: #include <iostream> #include <vector> #include <mpi.h> int main() { MPI_Init(NULL, NULL); int world_size; MPI_Comm_size(MPI_COMM_WORLD, &world_size); int world_rank; MPI_Comm_rank(MPI_COMM_WORLD, &world_rank); int num = 10; std::vector<double> yield; yield.resize(num, 0); for (int i = 0; i < ..

Read more