Using malloc_dump_unreferenced()

Hello.

I’m using QNX6.1.0 and I try to use the function malloc_dump_unreferenced()
Have anyone succeeded in doing a compile, link and run with this function in
the code?
All I get when I try to start my program is:

unknown symbol: malloc_dump_unreferenced
Could not resolve all symbols

regards, Mats P

Mats Pettersson <mats.pettersson@wavium.se> wrote:

Hello.

Hi Mats,

I’m using QNX6.1.0 and I try to use the function malloc_dump_unreferenced()
Have anyone succeeded in doing a compile, link and run with this function in
the code?
All I get when I try to start my program is:

unknown symbol: malloc_dump_unreferenced
Could not resolve all symbols

I’m investigating this issue.

Best Regards,

Marcin

regards, Mats P

Mats Pettersson <mats.pettersson@wavium.se> wrote:

Hello.

I’m using QNX6.1.0 and I try to use the function malloc_dump_unreferenced()
Have anyone succeeded in doing a compile, link and run with this function in
the code?
All I get when I try to start my program is:

unknown symbol: malloc_dump_unreferenced
Could not resolve all symbols

The problem is that your program is pooling the wrong malloc lib at the run
time. The SONAME of malloc.so from /usr/lib/ and /usr/lib/malloc_g are the
same “libmalloc.so.2”, as a result your program picks the malloc lib from
the /usr/lib, because it is first defined in the LD_LIBRARY_PATH. The work
around would be to export /usr/lib/malloc_g before /usr/lib/ ie.
export LD_LIBRARY_PATH=/usr/lib/malloc_g:$LD_LIBRARY_PATH

Best Regards,

Marcin

regards, Mats P