[sun-sparc-solaris2.6] crash in ObjectPointer_dispatchTo_arity_above_

nicolas n pelletier nicolasp at nortelnetworks.com
Tue Aug 10 01:45:55 PDT 2004


Lee Salzman <lsalzman1 at cox.net> writes:

> Okay, I walked around with a debugger on a sparc. It seems that
> map->dispatchID, while at a proper 8 byte boundary from the start of the
> Map struct, is still offset 4 bytes (the GC's allocator only guarentees
> 4 byte word alignment), which pisses off sparcs. However, the sparc
> version of GCC does not seem to have an option like -mno-strict-align to
> compile this. A short term fix would be to edit your sources to use
> memcpy() where it tries to copy the currentDispatchID into
> map->dispatchID.

Thanks,  that did  it for  the  non-optimized (-O0)  vm. However,  the
memcpy call gets optimized away as soon as optimizations are turned on
(-O1 or  -O2). Turning  the memcpy  into a loop  (!) at  vm.c:2723 and
vm.c:2743 as follows  fixes the problem. Optimized vm  (up to -O3) are
running ! :D

/* map at line 2723, def at line 2743 */
unsigned char *tmp = (unsigned char *) &map->dispatchID;
unsigned char *c = (unsigned char *) &currentDispatchID;
unsigned long int i = 0;

for (i = 0; i < sizeof (unsigned long long int); ++i)
{
   tmp [i] = c [i];
}

-- 
Nicolas




More information about the Slate mailing list