Hi, I'm porting an application from Zope 2.0 to Zope 2.4.1 and am experiencing strange crashes. We use a session manager written in C with a Python interface. When calling the get() method of the session object in DTML (be it in a var-, call- or if- tag), Zope crashes, but when passing the session object down to an External Method and calling get() from there, it works! I put a printf() in the first line of the get() function and realized that Zope crashes before calling the function. The crashing DTML Method looks like this: <!--#var standard_html_header --> <dtml-call "test2(REQUEST.session2)"> <dtml-call "test3(REQUEST)"> <dtml-let s="REQUEST.session2"> <dtml-call "test2(s)"> <dtml-var "s.get('pop_show')"><br> </dtml-let> The standard_html_header prepares the session object and puts it in REQUEST.session2 test2 is an External Method looking like this: def test2(a): print "test:" + str(a) print "test2:" + str(a.get('pop_show')) and test3 looks like this: def test3(REQUEST): s = REQUEST.session2 print "test3:" + str(s.get('pop_show')) print "test3:" + str(REQUEST.session2.get('pop_show')) The DTML method crashes in <dtml-var "s.get('pop_show')">. test2() and test3() work as they should. Is there a way to find out where Zope crashes (I have a feeling it's somewhere in the C Codes)? Where shall I put strategic printf()s?? thanx, bs
I wrote:
Hi,
I'm porting an application from Zope 2.0 to Zope 2.4.1 and am experiencing strange crashes. We use a session manager written in C with a Python interface. When calling the get() method of the session object in DTML (be it in a var-, call- or if- tag), Zope crashes, but when passing the session object down to an External Method and calling get() from there, it works! I put a printf() in the first line of the get() function and realized that Zope crashes before calling the function.
Update: Python crashes in PyObject_Hash on an PyObject with ob_type==NULL. Probably an error in our session manager, triggered only with DTML. I just cant figure out where such an object is created. :P So, ignore my message until i find out more... Here the top of stacktrace: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1026 (LWP 1592)] PyObject_Hash (v=0x4038cc80) at Objects/object.c:954 954 if (tp->tp_hash != NULL) (gdb) bt #0 PyObject_Hash (v=0x4038cc80) at Objects/object.c:954 #1 0x0808b47c in dict_get (mp=0x83692e4, args=0x884d194) at Objects/dictobject.c:1151 #2 0x08058e5a in call_cfunction (func=0x826c7d8, arg=0x884d194, kw=0x0) at Python/ceval.c:2845 #3 0x080578ed in eval_code2 (co=0x8251598, globals=0x837050c, locals=0x0, args=0x884cfcc, argcount=3, kws=0x884cfd8, kwcount=0, defs=0x83688a8, defcount=1, closure=0x0) at Python/ceval.c:1948 #4 0x08059214 in fast_function (func=0x83728bc, pp_stack=0xbf7fe454, n=3, na=3, nk=0) at Python/ceval.c:3022 #5 0x080579a5 in eval_code2 (co=0x828f900, globals=0x828fda4, locals=0x0, args=0x865a230, argcount=3, kws=0x0, kwcount=0, defs=0x8363d08, defcount=1, closure=0x0) at Python/ceval.c:1972 #6 0x08059119 in call_eval_code2 (func=0x8372af4, arg=0x865a224, kw=0x0) at Python/ceval.c:2966 #7 0x08058d42 in call_object (func=0x8372af4, arg=0x865a224, kw=0x0) at Python/ceval.c:2805 #8 0x08058c3d in PyEval_CallObjectWithKeywords (func=0x8372af4, arg=0x865a224, kw=0x0) at Python/ceval.c:2740 #9 0x4019b189 in callMethodWithPossibleHook (inst=0x87f9010, meth=0x8372af4, args=0x865a224, kw=0x0) at ././../Components/ExtensionClass/src/ExtensionClass.c:752 #10 0x4019b262 in call_PMethod (self=0x83a3cb0, inst=0x87f9010, args=0x874fdfc, kw=0x0) at ././../Components/ExtensionClass/src/ExtensionClass.c:779 #11 0x4019b2a2 in PMethod_call (self=0x83a3cb0, args=0x874fdfc, kw=0x0) at ././../Components/ExtensionClass/src/ExtensionClass.c:789 #12 0x08058dad in call_object (func=0x83a3cb0, arg=0x874fdfc, kw=0x0) at Python/ceval.c:2813 #13 0x080594bb in do_call (func=0x83a3cb0, pp_stack=0xbf7fe6cc, na=2, nk=0) at Python/ceval.c:3123 #14 0x080579bf in eval_code2 (co=0x8879b20, globals=0x885d6c4, locals=0x885d6c4, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:1975 #15 0x08054dc9 in PyEval_EvalCode (co=0x8879b20, globals=0x885d6c4, locals=0x885d6c4) at Python/ceval.c:341 #16 0x0809b2ef in builtin_eval (self=0x0, args=0x8750ee4) at Python/bltinmodule.c:760 #17 0x08058e5a in call_cfunction (func=0x80c8ab8, arg=0x8750ee4, kw=0x0) at Python/ceval.c:2845
I wrote:
Update: Python crashes in PyObject_Hash on an PyObject with ob_type==NULL. Probably an error in our session manager, triggered only with DTML. I just cant figure out where such an object is created. :P
So, ignore my message until i find out more...
Ok, found the bug. The type of the typeobject of the sessionclass was not correctly set. Now I get an access violation on the get() method, but that's better than a crash. Sorry for the noise.
participants (1)
-
Berthold Stöger