Anyone using Storable.pm on x86_64? Seems to be broken

M

Marinos Yannikos

According to the manpage, Storable should be able to read data
generated on a 32 bit platform under e.g. Debian x86_64. It doesn't -
data written by Perl 5.8.4/Storable 2.12 under 32 bit Debian x86
causes this under Debian x86_64 (also Perl 5.8.4/Storable 2.12):

Byte order is not compatible at ../../lib/Storable.pm (autosplit into
.../../lib/auto/Storable/_retrieve.al) line 328, at ./testdesc.pl line
4

Are there any known solutions for this?
 
B

bob.truel

I recently tried something similar, reading x86 storables on amd64.
There were a couple of problems. The error reported is because the
byte order is not the same between the two platforms: amd64 had a byte
order of "12345678" while x86 had a byte order of "1234." Fixing that
check in Storable.xs and putting in a better croak message was
relatively easy.

Secondly, longs and pointers are of different sizes, 8 vs. 4. I
removed the check for this. This left me with a Storable that seemed
to work, although I didn't verify that it properly unpacked everything.

I don't think that longs should be a problem, because I don't think
that there would be any in the x86 storable, but pointers are another
matter. I was having a bit of difficulty understanding the code
through the maze of XS and other macros, and so I wasn't able to
actually isolate where the pointers were being extracted and properly
promote them to quads before I lost interest in the project. It
doesn't seem like it should be a difficult fix for those more familiar
with the code, however.

Bob Truel
 
A

A. Sinan Unur

(e-mail address removed) wrote in

[Top-posting fixed. Please don't do that. ]
I recently tried something similar, reading x86 storables on amd64.
There were a couple of problems. The error reported is because the
byte order is not the same between the two platforms: amd64 had a
byte order of "12345678" while x86 had a byte order of "1234." Fixing
that check in Storable.xs and putting in a better croak message was
relatively easy.

I am confused.

Did you edit the source of Storable instead of storing objects using
nstore? AFAIK, nstore is the only way to make sure that data can be
shared across multiple platforms.

Sinan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top