When I compile duma 2.5.15 for Linux X86 it works fine, but when I try to cross compile ot for ARM (via Yocto recipe) I get this issue when I run it :
~> LD_PRELOAD=/home/root/libduma.so.2.5.15 ./sigsegv-heap-overflow
DUMA 2.5.15 (shared library, NO_LEAKDETECTION)
Copyright (C) 2006 Michael Eddington meddington@gmail.com
Copyright (C) 2002-2008 Hayati Ayguen h_ayguen@web.de, Procitec GmbH
Copyright (C) 1987-1999 Bruce Perens bruce@perens.com
DUMA Aborting: malloc() is not bound to duma.
DUMA Aborting: Preload lib with 'LD_PRELOAD=libduma.so <prog>'.
Illegal instruction
I tried to run dumatest and get the exact same message.
I looked in the source code and this message is sent from duma.c line 999
#ifndef DUMA_NO_GLOBAL_MALLOC_FREE
/
* Check whether malloc and free is available
/
testAlloc = malloc(123);
if (_duma_s.numAllocs == 0)
DUMA_Abort("malloc() is not bound to duma.\nDUMA Aborting: Preload lib with 'LD_PRELOAD=libduma.so <prog>'.\n");
Is there anything different to care about the malloc between x86 and ARM ?
Maybe it's something very stupid I forgeot to do...
Here is what I chenged in the makefile to match with my cross toolchain and I just set OS as linux:
OS = linux
CXX = $(CPP)
INSTALL=install
RM=rm
RMFORCE=rm -f
ECHO=echo
ECHOLF=echo
Please find attached the recipe I used to build it.
Before doing this with 2.5.15 i used the default recipe from oe-core with 2.5.7 and I get the exact same thing.
Thanks
Hi Florent,
I have the same problem. Using an ARM architecture also and cross-compilation. I was thinking if you did find a solution for this problem ? Maybe you can share your solution with us.
Thank you
Have a good day.
Hi Ayoub,
Unfortunately I haven't been working on that lately. And back in 2014, what I did is to use electric fence instead.
But in case, have you have been trying to check in Yocto, Openembedded, buildroot or Debian, they all have ARM port and dedicated patches sometimes?
Those are places where sometimes you can find patches which may fix the issue :
http://git.openembedded.org/openembedded/tree/recipes/duma/duma_2.5.7.bb?h=testing-next => version 2.5.7
https://git.buildroot.net/buildroot/tree/package/duma?id=23a9d0384a7e1fe495c5f24031a3fbef8745f030 => version 2.5.15
https://packages.debian.org/stretch/electric-fence => no duma but electric fence instead
Good luck,
Florent.
Thank you for your answer,
After many hours .... I managed to resolve my problem.
As I used a custom toolchain to integrate DUMA within my project, this toolchain sets the "-O2" in C_FLAGS. And that was the cause of my problem.
So I forced the -O0 flag to be used instead.
Check https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html for Optimization options. Maybe it will help !
Hope this answer helps anyone with the same problem.