Menu

#32 DUMA Aborting: malloc() is not bound to duma. => duma_init in duma.c:999(2.5.15)

v1.0 (example)
open
nobody
malloc (1)
1
2017-12-18
2014-10-17
Florent
No

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:

some defaults:

OS = linux

CC = $(CC)

CXX = $(CPP)

AR = $(AR)

RANLIB = $(RANLIB)

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

1 Attachments

Discussion

  • Ayoub

    Ayoub - 2017-12-15

    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.

     
  • Ayoub

    Ayoub - 2017-12-18

    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.

     

Log in to post a comment.