lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, 18 Aug 2009 12:42:37 -0400
David Haley <dchaley@gmail.com> wrote:

> Hi Rob,
> 
> On Tue, Aug 18, 2009 at 12:33 PM, Rob Hoelz<rob@hoelzro.net> wrote:
> > On Tue, 18 Aug 2009 12:29:05 -0400
> > David Haley <dchaley@gmail.com> wrote:
> >
> >> Hi Lua,
> >>
> >> I'm having some trouble getting Pluto to work. I'm on x86_64, gcc
> >> 4.3.3, with lua 5.1.4. (Is Pluto known to work on x86_64?)
> >> <snip>
> >
> > I've had troubles using Pluto on a 64-bit system; if I remember
> > correctly, I found that the string serialization/deserialization
> > routine writes the string size out as an int, and reads it in as a
> > long (or something along those lines), so that it's the same size
> > on a 32-bit system, but not a 64-bit one.  If you'd like, I can
> > send you a patched version I made; everything but live coroutine
> > restoration seems to work.
> 
> Ah, so it's a 64-bit problem after all. Does it work out of the box on
> 32-bit systems? (All the computers I have access to at the moment are
> 64-bit, so I can't verify this myself presently.)
> 
> I would be very happy to get a patched version -- I don't need live
> coroutine restoration (not at the moment, at least). Do you know what
> it is about live coroutines that don't work? (Normally, Pluto can
> handle them, right?)
> 
> Cheers,
> - David

Patch is attached.  I've never had a problem with Pluto on a 32-bit
system; only this issue with 64-bit string (de)serialization.  I've
never tried restoring live coroutines on a 32-bit system, though.

-Rob
--- ../pluto-pristine/pluto.c	2008-04-15 12:58:16.000000000 -0500
+++ pluto.c	2009-08-18 11:51:49.472726525 -0500
@@ -890,10 +890,10 @@
 static void unpersiststring(UnpersistInfo *upi)
 {
 					/* perms reftbl sptbl ref */
-	int length;
+	size_t length;
 	char* string;
 	lua_checkstack(upi->L, 1);
-	verify(LIF(Z,read)(&upi->zio, &length, sizeof(int)) == 0);
+	verify(LIF(Z,read)(&upi->zio, &length, sizeof(size_t)) == 0);
 	string = pdep_newvector(upi->L, length, char);
 	verify(LIF(Z,read)(&upi->zio, string, length) == 0);
 	lua_pushlstring(upi->L, string, length);

Attachment: signature.asc
Description: PGP signature