[ZODB-Dev] [ zodb-Bugs-537508 ] ZODB crashes on commit

noreply@sourceforge.net noreply@sourceforge.net
Wed, 15 May 2002 09:29:15 -0700


Bugs item #537508, was opened at 2002-03-31 21:32
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=115628&aid=537508&group_id=15628

Category: None
Group: None
>Status: Closed
Resolution: None
Priority: 5
Submitted By: Andreas Jung (ajung)
Assigned to: Jeremy Hylton (jhylton)
Summary: ZODB crashes on commit 

Initial Comment:
The following code crashes the ZODB

from ZODB import FileStorage,DB
from normalizer import Normalizer
fs = FileStorage.FileStorage('Data.fs')
db =DB(fs)
connection = db.open()
root = connection.root()

n = Normalizer([])
root['norm'] = n

get_transaction().commit()
db.close()

Normalizer returns a instance of a C extension.

gdb:

(gdb) where
#0  PyObject_Hash (v=0x40208c00) at Objects/object.c:954
#1  0x08092009 in PyDict_GetItem (op=0x811699c,
key=0x40208c00) at Objects/dictobject.c:448
#2  0x401ba3aa in save (self=0x8169c78, args=0x8180198,
pers_save=0) at
/usr/home/ajung/new/Python-2.1.2/Modules/cPickle.c:1925
#3  0x401b977a in save_dict (self=0x8169c78,
args=0x817760c) at
/usr/home/ajung/new/Python-2.1.2/Modules/cPickle.c:1476
#4  0x401ba698 in save (self=0x8169c78, args=0x817760c,
pers_save=0) at
/usr/home/ajung/new/Python-2.1.2/Modules/cPickle.c:1885
#5  0x401b977a in save_dict (self=0x8169c78,
args=0x8139dfc) at
/usr/home/ajung/new/Python-2.1.2/Modules/cPickle.c:1476
#6  0x401ba698 in save (self=0x8169c78, args=0x8139dfc,
pers_save=0) at
/usr/home/ajung/new/Python-2.1.2/Modules/cPickle.c:1885
#7  0x401ba891 in dump (self=0x8169c78, args=0x8139dfc)
at /usr/home/ajung/new/Python-2.1.2/Modules/cPickle.c:2001
#8  0x401baca9 in Pickler_dump (self=0x8169c78,
args=0x80eafc4) at
/usr/home/ajung/new/Python-2.1.2/Modules/cPickle.c:2164
#9  0x0805a272 in call_cfunction (func=0x8188250,
arg=0x80eafc4, kw=0x0) at Python/ceval.c:2850
#10 0x080589ae in eval_code2 (co=0x8145340,
globals=0x8149864, locals=0x0, args=0x8169e84,
argcount=3, kws=0x8169e90, kwcount=0, defs=0x0,
    defcount=0, closure=0x0) at Python/ceval.c:1952
#11 0x0805a68c in fast_function (func=0x80fedbc,
pp_stack=0xbffff364, n=3, na=3, nk=0) at
Python/ceval.c:3027
#12 0x080588f9 in eval_code2 (co=0x813f2f8,
globals=0x80ff00c, locals=0x0, args=0x80d7910,
argcount=1, kws=0x80d7914, kwcount=0,
    defs=0x80fe0a0, defcount=1, closure=0x0) at
Python/ceval.c:1976
#13 0x0805a68c in fast_function (func=0x80fdd04,
pp_stack=0xbffff464, n=1, na=1, nk=0) at
Python/ceval.c:3027
#14 0x080588f9 in eval_code2 (co=0x81139e0,
globals=0x80de83c, locals=0x80de83c, args=0x0,
argcount=0, kws=0x0, kwcount=0, defs=0x0,
    defcount=0, closure=0x0) at Python/ceval.c:1976
#15 0x080555a5 in PyEval_EvalCode (co=0x81139e0,
globals=0x80de83c, locals=0x80de83c) at Python/ceval.c:341
#16 0x08070057 in run_node (n=0x80ef0f8,
filename=0xbffff75e "test.py", globals=0x80de83c,
locals=0x80de83c, flags=0xbffff558)
    at Python/pythonrun.c:1049
#17 0x0806f243 in PyRun_SimpleFileExFlags
(fp=0x80d35c0, filename=0xbffff75e "test.py",
closeit=1, flags=0xbffff558) at Python/pythonrun.c:666
#18 0x08051eaa in Py_Main (argc=2, argv=0xbffff5f4) at
Modules/main.c:320
#19 0x08051a37 in main (argc=2, argv=0xbffff5f4) at
Modules/python.c:10
#20 0x40083306 in __libc_start_main (main=0x8051a20
<main>, argc=2, ubp_av=0xbffff5f4, init=0x8050e78
<_init>, fini=0x80a9a10 <_fini>,
    rtld_fini=0x4000d2dc <_dl_fini>,
stack_end=0xbffff5ec) at
../sysdeps/generic/libc-start.c:129
(gdb)

The behaviour is reproducable with Zope 2.5.1.
The ZODB should not crash but provide an error message.

-aj



----------------------------------------------------------------------

>Comment By: Jeremy Hylton (jhylton)
Date: 2002-05-15 16:29

Message:
Logged In: YES 
user_id=31392

Andreas-- I'm not going to pursue this unless you want to
dig in on the last suggestion re pickle.


----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2002-04-22 19:20

Message:
Logged In: YES 
user_id=31392

I haven't had time to spend on this bug, but I did realize 
that the exception is coming from cPickle.  Can you try to 
pickle a Normalizer object and see what happens?  Try it 
with cPickle and plain old pickle.  I expect we'll see an 
error there, too, which will help track down the source of 
the problem.


----------------------------------------------------------------------

Comment By: Andreas Jung (ajung)
Date: 2002-04-01 23:18

Message:
Logged In: YES 
user_id=11084

I don't think it is a refcounter problem as the extension
still crashes after removing checkList() and
CopyTranslationTable() call from the newnormalizer()
constructor call. 



----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2002-04-01 16:44

Message:
Logged In: YES 
user_id=31392

There are a number of ref counting problems in the C 
extension that probably explain the crash.  For example, 
getTable() is exposed as a method of the normalizer object, 
but it doesn't INCREF its return value.  It looks like 
there are also some missing DECREFs (that affect 
correctness but should not cause crashes).  I don't think 
this is a ZODB bug, but I'll leave the bug report open if 
you want to fix the normalizer bugs and see if the problem 
persists.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=115628&aid=537508&group_id=15628