[Gc] Bus error in GC6.3

Ben Hutchings ben.hutchings at businesswebsoftware.com
Tue Sep 7 06:55:45 PDT 2004

Simon Johansson <simon.johansson at ladok.umu.se
<mailto:simon.johansson at ladok.umu.se> > wrote: 

	I will get this error every time I use my application after a


	I am using GC6.3 on a Solaris 8 server. 


	I am compiling with this options -DGC_SOLARIS_PTHREADS


	Have also tested with -DGC_PTHREADS but the error is the same.


	The error look like this:


	#0  0xff146050 in GC_malloc (lb=1624) at malloc.c:305

	305             *opp = obj_link(op);

	(gdb) where

	#0  0xff146050 in GC_malloc (lb=1624) at malloc.c:305

	#1  0xa23f0 in enqueue ()

	#2  0xa2734 in AddToUnifaceQueue ()

	#3  0x7afac in GetData ()

	#4  0x7ddd0 in Main_CT_Thread ()


	The bus error I am getting is: Signal 10 SIGBUS Sigcode 1 ADRALN
Sigsender 0.

This indicates to me that a free list has become corrupt. If I
understand it correctly the free list is maintained as a linked list of
memory blocks. So I think there is probably a bug in your program that
results in it writing to memory blocks that it has freed. This is one of
the sorts of bug that the garbage collector is supposed to help you
avoid! Try building the collector with the macro IGNORE_FREE defined. If
that seems to solve the problem then I suggest you carefully examine
your calls to free to find out which of them are in the wrong place or
have the wrong condition.

	The line in the source code that is not working, look like this.


	if ((p = (elem *)malloc(sizeof(elem))) == NULL)

The details of the malloc() call are not that relevant to the problem,
though I think the memory blocks that are being written to after being
freed must be of approximately the same size as the one requested here,
i.e. sizeof(elem).


-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://napali.hpl.hp.com/pipermail/gc/attachments/20040907/1a5e9120/attachment.htm

More information about the Gc mailing list