dHVjYW5v / python-spidermonkey

Automatically exported from code.google.com/p/python-spidermonkey
GNU General Public License v2.0
0 stars 0 forks source link

cx.bind_class eval_script will core #18

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
code:
from spidermonkey import Runtime

rt = Runtime()
cx = rt.new_context()
class Foo:

    def __init__(self):
        self.count = 0

    def hello(self):
        print "Hello World: %d" %(self.count)

def test2():
    cx.bind_class(Foo, bind_constructor = True)
    cx.eval_script("var f = new Foo(); f.hello();")

core stack:
#0  0x00007f04187f08a5 in raise () from /lib64/libc.so.6
#1  0x00007f04187f2085 in abort () from /lib64/libc.so.6
#2  0x00007f041882e7b7 in __libc_message () from /lib64/libc.so.6
#3  0x00007f04188340e6 in malloc_printerr () from /lib64/libc.so.6
#4  0x00007f0412715acc in __pyx_f_12spidermonkey_10ProxyClass___dealloc__ 
(o=<value optimized out>) at spidermonkey.c:3009
#5  __pyx_tp_dealloc_12spidermonkey_ProxyClass (o=<value optimized out>) at 
spidermonkey.c:5400
#6  0x00007f041271a64c in __pyx_tp_new_12spidermonkey_ProxyClass (t=<value 
optimized out>, a=<value optimized out>, k=<value optimized out>) at 
spidermonkey.c:5389
#7  0x00007f041948d253 in ?? () from /usr/lib64/libpython2.6.so.1.0
#8  0x00007f041943cc63 in PyObject_Call () from /usr/lib64/libpython2.6.so.1.0
#9  0x00007f04194c8c93 in PyEval_CallObjectWithKeywords () from 
/usr/lib64/libpython2.6.so.1.0
#10 0x00007f041271b978 in __pyx_f_12spidermonkey_7Context_bind_class 
(__pyx_v_self=0x7f041984a130, __pyx_args=<value optimized out>, 
__pyx_kwds=<value optimized out>) at spidermonkey.c:2023
#11 0x00007f04194cf6f1 in PyEval_EvalFrameEx () from 
/usr/lib64/libpython2.6.so.1.0
#12 0x00007f04194cfb8f in PyEval_EvalFrameEx () from 
/usr/lib64/libpython2.6.so.1.0

Original issue reported on code.google.com by guichun...@gmail.com on 27 Jan 2014 at 7:44