You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by Michael Kleehammer <mi...@kleehammer.com> on 2003/11/18 06:23:30 UTC

DbmSession/dbhash crashes using mod_python 3.1.2b

Whenever I attempt to use sessions, the DbmSession class chooses the
dbhash module and crashes when attempting to create the database.  (The
file is never created.)

* Fedora Core 1 (basically RH9)
* Newly compiled Apache 2.0.48
* Python 2.3
* mod_python 3.1.2b

Here is a small handler that exhibits the problem on my box.  If it runs
on anyone else's box, that would be good to know.

  from mod_python import apache
  import dbhash
  
  def handler(req):
      req.log_error("open", apache.APLOG_NOTICE)
  
      # seg fault in here
      result = dbhash.open('/tmp/mp_sess.dbm', 'c', apache.APLOG_NOTICE)
  
      req.log_error("opened")
      return apache.OK

The relevant Apache error log lines are:

  [notice] mod_python: (Re)importing module 'controller'
  [notice] [client 127.0.0.1] open
  [notice] child pid 11211 exit signal Segmentation fault (11)

Naturally, I've tested similar code outside of mod_python and it works
fine.  I'm wondering if dbhash is thread safe.

Obviously I can call DbmSession instead of Session and pass dumbdbm (or
another type -- I haven't tested any others yet), but I'm wondering why
the default setup isn't working.

Any thoughts?

Michael Kleehammer


Re: [mod_python] DbmSession/dbhash crashes using mod_python 3.1.2b

Posted by Conrad Steenberg <co...@hep.caltech.edu>.
Hi Michael

Since you compiled Apache yourself, please make sure that the version of
libdb that Apache and mod_python (and Python?) are the same.

I've seen the same behaviour when e.g. Apache was linked against
libdb-4.0 and mod_python against libdb-4.1.

HTH

Conrad

On Mon, 2003-11-17 at 22:23, Michael Kleehammer wrote:
> Whenever I attempt to use sessions, the DbmSession class chooses the
> dbhash module and crashes when attempting to create the database.  (The
> file is never created.)
> 
> * Fedora Core 1 (basically RH9)
> * Newly compiled Apache 2.0.48
> * Python 2.3
> * mod_python 3.1.2b
> 
> Here is a small handler that exhibits the problem on my box.  If it runs
> on anyone else's box, that would be good to know.
> 
>   from mod_python import apache
>   import dbhash
>   
>   def handler(req):
>       req.log_error("open", apache.APLOG_NOTICE)
>   
>       # seg fault in here
>       result = dbhash.open('/tmp/mp_sess.dbm', 'c', apache.APLOG_NOTICE)
>   
>       req.log_error("opened")
>       return apache.OK
> 
> The relevant Apache error log lines are:
> 
>   [notice] mod_python: (Re)importing module 'controller'
>   [notice] [client 127.0.0.1] open
>   [notice] child pid 11211 exit signal Segmentation fault (11)
> 
> Naturally, I've tested similar code outside of mod_python and it works
> fine.  I'm wondering if dbhash is thread safe.
> 
> Obviously I can call DbmSession instead of Session and pass dumbdbm (or
> another type -- I haven't tested any others yet), but I'm wondering why
> the default setup isn't working.
> 
> Any thoughts?
> 
> Michael Kleehammer
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python@modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
-- 
Conrad Steenberg <co...@hep.caltech.edu>
-- 
Conrad Steenberg <co...@hep.caltech.edu>