users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dl_malloc


From: Edmund GRIMLEY EVANS
Subject: dl_malloc
Date: Fri, 13 Oct 2000 14:25:29 +0100
User-agent: Mutt/1.3.10i

We were having some weird memory allocation problems (usually a
segmentation fault in the C library's free) on Linux until I rebuilt
our code using a version of gprolog in which EnginePl/mem_alloc.c had
been modified not to include dl_malloc.c.

I think the problem is that on Linux gprolog includes its own version
of malloc, free, etc, with the same names. When an executable is
built, the symbols get bound locally, however, when a shared library
is built, and a whole load of shared libraries are linked at run time,
it looks as though calls to the different memory allocation systems
are getting mixed up.

To avoid this problem, perhaps a different symbol name could be used,
along the lines of #define malloc mALLOc.

But what was the reason for dl_malloc in the first place? Daniel, I
think you said something about Linux's malloc returning incompatible
addresses. If this happens, what is the symptom? I would like to know
if I might have broken anything by not using dl_malloc on Linux ...

Edmund



reply via email to

[Prev in Thread] Current Thread [Next in Thread]