From: John Carter Organization: Dpt Water Affairs & Forestry (IWQS) To: djgpp AT sun DOT soe DOT clarkson DOT edu Date: Mon, 12 Jun 1995 15:01:19 +0200 Subject: malloc without malice Greetings all. I am getting a segmentation fault in malloc(). I tried to trace the fault by looking at the source code, but found alas two source code files. One of them in /libsrc/c/lib/malloc.c (date 28 Aug 1994 by Chris Kingsley) and the other in src/libgplus.262/libgplus/src/malloc.c. (date 14 Aug 1993 V2.5 by Doug Lea) Looking at the linker map indicates I'm linking to malloc in malloc.o in libc.a. Using 'nm --extern --demangle' on every lib*.a in the lib directory informs me that the libc.a and libc_p.a are the only places where malloc is defined. Notes :- 1) I'm using DJGPP V1.12m4 2) I'm programming in C++ mixed with bits of C generated by BISON and FLEX. 3) The src/libgplus.262/libgplus/src/malloc.c version is at least heavily commented. 4) I still have many megabytes more real & virtual memory to go before I run out of heap. Question 1) Any idea what is causing the fault? Question 2) Which is the best malloc? (And how do I convince it to link in?) PS: Much thanks to DJ, FSF & Co. Great software this! John Carter Institute for Water Quality Studies. Department of Water Affairs. Internet : ece AT dwaf-hri DOT pwv DOT gov DOT za Phone : 27-12-808-0374x194 Fax : 27-12-808-0338 I voted KISS in the election. Therefore it is highly unlikely (1:3000) that my views represent those of anyone else, let alone my employer. (Taglines are automagically selected via pmail variable signature feature, don't take offence if it is accidently too appropriate.)