[Python-Dev] [ 654866 ] pickle and cPickle not equivalent

Patrick K. O'Brien pobrien@orbtech.com
Tue, 17 Dec 2002 09:12:11 -0600


On Tuesday 17 December 2002 01:12 am, Martin v. Löwis wrote:
> "Patrick K. O'Brien" <pobrien@orbtech.com> writes:
> > I'd like to call attention to a bug report I just submitted to SF
> > concerning a potentially serious problem with the c-version of
> > pickle.
>
> [...]
>
> > I think this is a pretty serious problem, but I'm out of my league
> > when it comes to debugging the c-version of pickle.
>
> I hear such statements quite often recently, but I'm not impressed.

You don't hear statements like that from me. And impressing people on 
this list wasn't my goal. So I'm at a complete loss as to what I've 
done to deserve this kind of response from you.

> You have the full source, so there is no principle problem that would
> make it impossible to investigate the problem yourself. It might take
> you more time to investigate this than it may take somebody else, but
> I'm sure you have heard about the printf function; if not, you should
> read some book first.

And you don't think my asking for some help on this list is better use 
of two people's time? One who has an example that fails, and one who 
knows the cPickle implementation well enough to help track down the 
cause of failure.

I've already spent quite a lot of time tracking the problem down to the 
point that I have. And it is trivial for me to fix my own code so that 
the problem goes away. But the underlying problem isn't with my code. 
It is with cPickle. And I'm concerned about just walking away from this 
because I think it is a serious problem for anyone who wants to 
correctly unpickle objects that were pickled using cPickle.

Fortunately, Guido has responded to my SF bug report and I'm trying to 
reduce things to a simple example that illustrates the failure. I spent 
several hours on this last night, and I'll likely spend several hours 
on it today. And that's just getting us to a simple example that 
reproduces the problem. Frankly, I don't have the time nor the interest 
to get back up to speed on C. (I've read lots of C books and dabbled in 
it, but that was years ago.)

> Understanding software that does not work right is *always*
> difficult, and time-consuming, because it usually looks right -
> atleast that's what the author of the software thought when he wrote
> it.

Sure. And this is the first time I've seen cPickle do the wrong thing. 
Considering that the app that found this bug is an example of a banking 
app that logs account transactions as pickles, I think you might 
appreciate that it would be a good thing if those pickles maintained 
proper references to those accounts and could restore transactions 
appropriately, rather than creating new account instances that weren't 
part of the bank. (Say goodbye to your money on a system recovery.)

> It might be that you may not have the time to investigate this, but
> then, that might hold for everybody else.

And what harm did I do by asking if anyone had time to help, rather than 
letting this issue drop? Sorry if this isn't the kind of response you 
expected back from me. But I'm already irritated with the amount of 
time I've spent on this. Your reply really rubbed me the wrong way. If 
I didn't care about Python I sure as hell wouldn't be spending my time 
tracking this problem down.

-- 
Patrick K. O'Brien
Orbtech      http://www.orbtech.com/web/pobrien
-----------------------------------------------
"Your source for Python programming expertise."
-----------------------------------------------