Questions tagged [dmalloc]

Dmalloc is a debug malloc library for C and C++ users

The debug memory allocation or dmalloc library has been designed as a drop in replacement for the system's malloc, realloc, calloc, free and other memory management routines while providing powerful debugging facilities configurable at runtime. These facilities include such things as memory-leak tracking, fence-post write detection, file/line number reporting, and general logging of statistics.

The library is reasonably portable having been run successfully on at least the following operating systems: AIX, BSD/OS, DG/UX, Free/Net/OpenBSD, GNU/Hurd, HPUX, Irix, Linux, MS-DOG, NeXT, OSF, SCO, Solaris, SunOS, Ultrix, Unixware, Windoze, and even Unicos on a Cray T3E. It also provides support for the debugging of threaded programs.

16 questions
4
votes
1 answer

'ld' cannot link symbols, although they are in library

I have a problem while trying to compile and link my program with "dmalloc". bin +--dmalloc include +--dmalloc.h lib +--libdmalloc.a +--libdmallocth.a main.c I have the following directory structure Now I try to compile my program with the…
Melon
  • 604
  • 1
  • 7
  • 30
2
votes
1 answer

How to use dmalloc in a makefile?

I use WSL2 from vscode to develop and build, but I am a novice linux user. I am currently developing in C and using unity for unit testing and dmalloc to check for correct memory usage. Following the dmalloc documentation here, once the library has…
bjoubert89
  • 61
  • 5
2
votes
0 answers

php7.1RC5 enable dmalloc compiling error

I just wanted to build PHP7 with enable-dmalloc enveronment: the version of PHP is 7.1.0RC5 debian 8 gcc6.2 dmalloc 5.5.2 used this command: ./configure --prefix=/usr/local/php/70 --with-config-file-path=/usr/local/lib/php/70/etc --enable-fpm…
lilin
  • 137
  • 9
2
votes
2 answers

Why does this sample code (f90, MPI, derived types) causes invalid read/write (valgrind or dmalloc)?

This is the incriminated code (it is related to another question I asked, here): program foo use mpi implicit none type double_st sequence real(kind(0.d0)) :: x,y,z integer :: acc end type double_st integer, parameter ::…
janou195
  • 1,175
  • 2
  • 10
  • 25
1
vote
1 answer

dmalloc output "not freed: '0x7f2e20d36808|s1' (1182 bytes) from 'unknown'" when using 'printf' and 'fgetc'

We have been using dmalloc as part of our tools set to verify that our core libraries are free of memory leaks. However, recently we have discovered that using printf or fgetc would cause dmalloc to throw the following warnings in dmalloc.log. not…
Tung Pham
  • 79
  • 6
1
vote
1 answer

Double-Free exercise doesn't act as expected

I am reading the book "Effective C" by Robert C. Seacord. In this book, it has an exercise where you intentionally double-free a pointer so you can test using dmalloc to debug the cause. However, it doesn't fail as expected. #include…
Raven King
  • 155
  • 1
  • 12
1
vote
2 answers

The dmalloc provide return-address information show `unknown'?

When I want to use dmalloc-5.5.2 to check memory leak on cross platform. I include dmalloc.h, compile it by mips-gcc-4.3 and link it with ./libdmalldm.a. The app work normally and the memory run out at the end. But show log like that: 1451616386:…
Ken Hu
  • 49
  • 1
  • 6
1
vote
0 answers

dmalloc log is not formatting stack addresses

By building dmalloc lib with following setting in conf.h file #define HAVE_VPRINTF 0 #define HAVE_SNPRINTF 0 #define HAVE_VSNPRINTF 0 and run my code after linking , log file content have unformatting address info to function names and line…
venkatesh
  • 11
  • 1
1
vote
1 answer

Are there standard workarounds for dmalloc's assumptions on vsnprintf?

I'm trying to use dmalloc version 5.5.2 and glibc 2.17. Linking in dmalloc always causes a segfault. Debugging, I found that dmalloc calls vsnprintf(...) when it wants to format a helpful debugging message. Unfortunately vsnprintf(..) itself calls…
1
vote
2 answers

Programs configured to use dmalloc bail-out citing header file error

While trying to compile lynx, I used the 'with-dmalloc' configure option. But compilation aborted, producing this error: /usr/include/dmalloc.h:460: error: expected identifier or '(' before '__extension__' > /usr/include/dmalloc.h:484: error:…
KNMC
  • 11
  • 4
1
vote
2 answers

Using dmalloc with recent g++

I am trying to use dmalloc with g++ 4.7. The error message i am getting are: /usr/include/dmalloc.h:457:32: error: declaration of 'char* strdup(const char*)' has a different exception specifier /usr/include/string.h:130:14: error: from previous…
arved
  • 4,401
  • 4
  • 30
  • 53
0
votes
0 answers

In Dmalloc tool is there way i will give check only specific memory range?

We are running dmalloc tool for specific app but we are getting too many traces that are not from app they are from c libraries and we are getting huge log, to avoid is there any way we can feed address range or any other option we can try. 6567117:…
0
votes
0 answers

Valgrind App crash due to Kernel panic Error while accessing external DDR memory

I am running one application on linux with valgrind on my custom hardware ARM architecture board, which access external DDR memory (not present on board) causing application to crash with following reason Bad mode in Error handler detected on CPU3.…
0
votes
0 answers

Getting function names and line numbers in log

I am really in need of help in debugging some memory corruption bug that keeps surfacing. A few bits of information: Boost::Asio is used to receive som protobuf packets over UDP. I am pretty sure that it is related to this. Using valgrind makes the…
0
votes
1 answer

Where is dmalloc in openSUSE?

Which openSUSE rpm contains dmalloc? No repository have it. Tried to build it from src.rpm found for SLE 12. However it does not contain libdmalloc* libraries. How to do LD_PRELOAD="libdmalloc.so" ./my_program? Or it is not necessary?
Aleksey Kontsevich
  • 4,671
  • 4
  • 46
  • 101
1
2