[M3devel] pickle bug..solved?.. not supposed to work?
Rodney M. Bates
rodney_bates at lcwb.coop
Sun Dec 13 19:09:57 CET 2009
Randy Coleburn wrote:
> Jay:
>
> I've done a lot with Pickles and with NetObj.
>
> I switched to the v2 version a long time ago and never looked back.
>
> IMO, we should switch over to v2 exclusively and consider v1
> obsolete. Perhaps some others should comment on this to see if they
> share my opinion.
I am using pickles and have done work inside pickle code. I agree strongly
on this. V2 pickle code can read pickle files written by V1 pickle code
(or at least V2 pickles have code that appears to do so), so old pickle
files can still be read. This adaptation is made at dynamically at read
time by looking at the pickle file header, so no user action is required.
So there is really no benefit to using V1 pickle code.
There is one thing that has been a problem for me in the past. In
PM3, importing "Pickle" gets you version 2, while in
CM3, "Pickle" gets you V1 and you have to import "Pickle2" to
get V2. This means code that is to compile/run in either PM3
or CM3 has to have changes to actual source code. I have scripted
this, but it is a messy and fragile kludge. I will probably drop
maintaining PM3/CM3 compilability in the future. Anybody else
doing this?
There is one other messy problem that comes to mind. Both versions have
a few hard-coded signatures for a few language-predefined types
that do not consistently follow the byte order used in type signatures
in general. They differ both between the versions and from the
general rule. In some case(s), the byte ordering used is downright
bizarre. I don't remember for certain, but I think I fixed V2 to
adapt to V1's conventions on this when reading V1 pickle files.
>
> Regards,
> Randy
>
> >>> Jay K <jay.krell at cornell.edu> 12/13/2009 12:34 AM >>>
>
> https://projects.elego.de/cm3/ticket/1068
>
>
>
>
>
> I've only spent a few minutes here.
>
> Trying to find the relative code and such.
>
>
>
>
>
> The code is here:
>
>
>
>
>
> C:\dev2\cm3.2\m3-comm\netobj\tests\perf\src
>
>
>
> I found it by looking near the top of the stack in
>
> the bug report -- NetObjTest.m3 -- and
>
> then dir /s/b NetObjTest.m3.
>
>
>
> or find . | grep NetObjTest.m3$ on Unix.
>
>
>
>
>
> It appears that Pickle v1 and v2 are both
>
> available in the same library.
>
> There is INTERFACE Pickle and INTERFACE Pickle2.
>
>
>
>
>
> It appears netobj can use either.
>
>
>
> If you look at the stack in the bug, there is a lot of "v1" stuff.
>
>
>
>
>
> We provide Quake functions:
>
>
>
> readonly proc netobjv1(intf, type) is
> ...
>
> end
>
>
>
> readonly proc Netobjv1(intf, type) is
> ...
>
> end
>
>
>
> readonly proc netobjv2(intf, type) is
> ...
>
> end
>
>
>
> readonly proc netobj(intf, type) is
> netobjv1(intf, type)
> end
>
>
>
>
>
>
> v1 pickles cannot cross endian/wordsize boundaries.
>
>
>
>
>
> I think the bug is not so much in the pickle code, nor in the netobj code,
>
> but in the test code, or the running of it.
>
>
>
> Tests involving v1 won't work crossing endian/wordsize boundaries.
>
> V1 tests probably should still run, and maybe detect the mismatch
>
> and just claim success?
>
>
>
> And then v2 should get better coverage?
>
>
>
>
>
> Any more bugs then?
>
> I was procrastinating on this because I've never done anything with
> pickles
More information about the M3devel
mailing list