More info:

It just happens with some classes. Some work and some won't, and I don't yet know why. Some info: In my webapp when user logs in I save a User object (subclassing class Storable). And then I redirect. Works ok, no problem.

Then, in another page I try to save a Website object (subclassing from both Storable and Website). It segfaults.

Could it be something related to multiple inheritance? In my ignorance I thought so, but then when I try to save a Dbobj class just for testing purposes it also crashes. Dbobj inherits from object directly and has some methods defined as classmethod.

My question is: how does mod_python knows where to look for a class while trying to retrieve it? Imagine I start a session in namespace a and then in namespace b I save a class instance which is only known to namespace b. What happens when namespace a tries to save the session or when it tries to load it again? How does it knows where to look for the class instance only known to namespace b?

Maybe the problem lies there?

Anyway I will save the object_id in the session instead of the class instance and I will load the object from it.



I'm really sorry for the spam. My head starts spinning really fast when I see segfaults.


dharana wrote:
This is driving me crazy. I'm finding it hard to make a simple testcase.

I use a custom handler and somewhere in the code I do this:

-- [snip] -------------------------------------------------------------
from mypackage.mysubpackage.mysubsubpackage import db

def run(req):
    req.sess['foo'] = object
    # req.sess['foo'] = db
    req.sess.save()
    return

# I redirect the user another path with util.redirect and then the segfault
# happens
----------------------------------------------------------------------


The moment I try to assign my own classes (ie: assigning db instead of object I must manually delete the pysid cookie to stop the segfaults.

It seems as if mp corrupts or somehow leaves in an usable state the session after trying to save my objects. I tried with different objects and it happens with all of them. Does anyone knows how I can retrieve more info from the segfault? I don't like segfaults :( they don't tell why they don't like you.

dharana wrote:


Reply via email to