On Monday 28 April 2008 10:41:27 Mark Glines wrote:

> On Sun, 27 Apr 2008 17:24:53 -0700
>
> chromatic <[EMAIL PROTECTED]> wrote:
> > Here's another proposed patch for testing on various platforms.  I'm
> > trying to get rid of some dodgy casts (which likely don't help C++
> > and processors with stricter alignment than 32-bit x86).  I'd also
> > like to remove unnecessary members from a few structs.  This is the
> > next step.
> >
> > Are there any weird errors or unexpected crashes on anything more
> > exotic than 32-bit x86 GNU/Linux?
>
> This seems to cause memory corruption on linux/amd64.  Only two tests
> fail, the rest pass, but those are failing pretty gloriously.  See
> attached log.

I had a similar problem on my 32-bit Linux system, until I added this part of 
the patch:

=== src/gc/smallobject.c
==================================================================
--- src/gc/smallobject.c.   (revision 27223)
+++ src/gc/smallobject.c.   (local)
@@ -523,9 +517,9 @@
     free_list_end  = &dest->free_list;
-
     while (*free_list_end)
-        free_list_end = (void **)*free_list_end;
+        free_list_end = &PMC_struct_val((PObj *)free_list_end);
-
-    *free_list_end = source->free_list;
+    PMC_struct_val((PObj *)free_list_end) = source->free_list;
-
     /* now append source arenas */
     cur_arena = source->last_Arena;

My backtrace was different, though.  I was getting segfaults trying to walk 
the free list when the next pointer was flag values, not a pointer.

If there's an error on 64-bit systems, I still suspect it's in there.

-- c

Reply via email to