malloc_g won't run (Could not resolve all symbols)

I’m trying to use malloc_g, but I can’t get the executable to run. I get:
unknown symbol: malloc_dump_unreferenced
Could not resolve all symbols

I link the executable with -lmalloc_g
I’ve replaced /usr/include/malloc_g/malloc.h with the one posted in this
newsgroup on March 21.

objdump -x | grep NEEDED lists:
NEEDED libmalloc.so.2
NEEDED libc.so.2

But there’s no reference to libmalloc_g.so.2

Here’s the source file:


//-----------------------------------------------
// SourceFile: $RCSfile: MallocTestMain.c $
//-----------------------------------------------

#if !defined NDEBUG
#include <malloc_g/malloc.h>
#else
#include <malloc.h>
#endif

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

void myExitHandler(void);

int main(int argc, char *argv[])
{
int *foo;
int *p;
int i;

printf( “Beginning Malloc package test.”);

#if !defined NDEBUG
mallopt(MALLOC_CKACCESS, 1);
mallopt(MALLOC_WARN, M_HANDLE_IGNORE | M_HANDLE_DUMP);
atexit(myExitHandler);
#endif


printf( “Running!!!”);

foo = (int )malloc(104);
for (p = foo, i = 0; i < 12; p++, i++)
p = 89;
free(foo); /
a fatal error is generated here */

printf(“Malloc package test complete.”);
}

void myExitHandler(void)
{
#if !defined NDEBUG
int lFD;
lFD = open(“malloc_g.dump”, O_WRONLY);
malloc_dump_unreferenced(lFD, 0); // Report all unreferenced memory
allocations
close(lFD);
#endif
}


\



Marty Doane
Siemens Dematic

No responses, but I’ve resolved this by linking with -lmalloc_gS. Is that
the correct solution?

Marty Doane
Siemens Dematic

“Marty Doane” <marty.doane@rapistan.com> wrote in message
news:ace6ag$9im$1@inn.qnx.com

I’m trying to use malloc_g, but I can’t get the executable to run. I get:
unknown symbol: malloc_dump_unreferenced
Could not resolve all symbols

I link the executable with -lmalloc_g
I’ve replaced /usr/include/malloc_g/malloc.h with the one posted in this
newsgroup on March 21.

objdump -x | grep NEEDED lists:
NEEDED libmalloc.so.2
NEEDED libc.so.2

But there’s no reference to libmalloc_g.so.2

Here’s the source file:


//-----------------------------------------------
// SourceFile: $RCSfile: MallocTestMain.c $
//-----------------------------------------------

#if !defined NDEBUG
#include <malloc_g/malloc.h
#else
#include <malloc.h
#endif

#include <stdio.h
#include <sys/types.h
#include <sys/stat.h
#include <fcntl.h

void myExitHandler(void);

int main(int argc, char *argv[])
{
int *foo;
int *p;
int i;

printf( “Beginning Malloc package test.”);

#if !defined NDEBUG
mallopt(MALLOC_CKACCESS, 1);
mallopt(MALLOC_WARN, M_HANDLE_IGNORE | M_HANDLE_DUMP);
atexit(myExitHandler);
#endif


printf( “Running!!!”);

foo = (int )malloc(104);
for (p = foo, i = 0; i < 12; p++, i++)
p = 89;
free(foo); /
a fatal error is generated here */

printf(“Malloc package test complete.”);
}

void myExitHandler(void)
{
#if !defined NDEBUG
int lFD;
lFD = open(“malloc_g.dump”, O_WRONLY);
malloc_dump_unreferenced(lFD, 0); // Report all unreferenced memory
allocations
close(lFD);
#endif
}


\



Marty Doane
Siemens Dematic

\