OpenBSD 4.9/i386 segfaults

Andy Dougherty doughera at lafayette.edu
Mon Jul 18 19:28:53 UTC 2011


On Mon, 18 Jul 2011, Jonathan "Duke" Leto wrote:

> Howdy,
> 
> What did you use for the boundaries of the bisect?

RELEASE_3_5_0 (which built) and RELEASE_3_5_0-204-g1d4f49f (which did 
not).
> 
> How much memory does that machine have?
> I run into a similar problem on one of the GCC Compile Farm OpenBSD machines.
> 
> I think this is more of a "our build doesn't work on small memory
> machines" error.

This machine has 1 GB of ram, and parrot-nqp doesn't seem to be even close 
to exhausting it.

The segfault occors in when gc_gms_is_pmc_ptr() is passed in a ptr,
and assigns "item" with PMC2PAC.

	/* We allocate additional space in front of PObj* to store additional pointer */
	typedef struct pmc_alloc_struct {
	    void *ptr;
	    PMC   pmc;   /* NB: Value! */
	} pmc_alloc_struct;
	
	#define PMC2PAC(p) ((pmc_alloc_struct *)((char*)(p) - sizeof (void *)))

	pmc_alloc_struct * const item = PMC2PAC(ptr);

The problem seems to be that 'ptr' doesn't have that 4-byte header,
so parrot is looking somewhere that parrot has no business looking.
I don't know if all ptrs passed to this function automatically have this
"header" up front and this one somehow got corrupted, or if other OSes
are more tolerant of parrot peaking in places it's not supposed to.

-- 
    Andy Dougherty		doughera at lafayette.edu


More information about the parrot-dev mailing list