python core dump (SIGBUS) on Solaris

Gary Pennington - UK Performance Centre Gary.Pennington at uk.sun.com
Thu Jul 8 07:54:14 EDT 1999


I agree, I think that is a bad design decision.

It would be more efficient to assume that you are processing a string and
only try to unpickle if the string is detected as a pickle. The tricky bit
is detecting that it is a pickled object in the string. Does a pickled
string start with some kind of magic sequence?

Pseudo-Code

if string contains pickle
    return loads(string)
return string

Gary


"A.M. Kuchling" wrote:

> On Wed, 07 Jul 1999 11:25:08 -0400,
>         Stephen J. Turner <sjturner at ix.netcom.com> wrote:
> >> >>> C.load("webJudgeUser=garyp;")
> ...
> >There's a bug in cPickle that causes heap corruption if loads is passed
> >a string (as opposed to a pickled object) starting with 'g', 'h' or
> >'j'.  Try applying the attached patch to the Python 1.5.2
>
>         Wait a sec... why is it automatically trying to unpickle the
> value of the cookie, when the value obviously wasn't pickled in the
> first place.  While the cPickle core-dumping bug should definitely be
> fixed, cookie.py also shouldn't try to unpickle things by default.
>
> --
> A.M. Kuchling                   http://starship.python.net/crew/amk/
> If Abaton's the unearthly reflection of all that we are, Britain's in far
> worse shape than I thought.
>     -- John Constantine in HELLBLAZER #93





More information about the Python-list mailing list