[Stackless] Exceptional state and pickling

hylje sealage at gmail.com
Fri Mar 28 22:03:13 CET 2008


Pickling causes an fairly unintuitive exception if there is exceptional
state lingering about, but not in all conditions.

Yours truly is tinkering with a simple application I'm sure most of you know
-- the stackless game. The game of actors, which do things with each other
on a plane. In normal usage the poor actors get pickled all swell upon
process quit. However, when there happens a certain kind of interaction
through channels, the pickler dies with an intimidating exception: a whole
lot of pickle-related stack trace, and behold!

ValueError: frame exec function at 080c8f00 is not registered! (For the
inquisitive, for me 080c8f00 is named restore_exception)

The true problem lies with how stackless pickles execution frames. Not all
frames are created equal, for stackless needs special frames for pickling.
Therein lies a source -- functions produce frames pickle cannot digest. This
is normal for vanilla extension modules (C modules), but should be worrisome
for stackless-internal functions (language-fundamental at that).

The trouble, however, is not only the incompatible frames. Those are to be
lived with, because before stackless rules the universe, there's little
actual need for explicit support for pickleable function state, for just
stackless. To finally get to it, the last straw is picking those "bad"
frames for pickling. As it is now, exceptional state -- apparently, a
try..except..finally block -- will try to get pickled, though pickle can't
eat it. Result is above.

This begs the question -- what to do with exceptional state with pickle?
(Disregard it? Re-raise stuff on the appropriate place? Where is that?)

p.s. greetings and credits for /stakkars/, from the #stacklesss IRC, for
helping me through this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20080328/00ce2fc0/attachment.htm>


More information about the Stackless mailing list