[Sndobj-devel] R: Problem with PushIn and Numpy array from h5py
Status: Abandoned
Brought to you by:
veplaini
From: Luigi C. <lui...@ya...> - 2009-06-30 15:07:03
|
--- Mar 30/6/09, Luigi Curzi <lui...@ya...> ha scritto: > Da: Luigi Curzi <lui...@ya...> > Oggetto: [Sndobj-devel] Problem with PushIn and Numpy array from h5py > A: snd...@li... > Data: Martedì 30 giugno 2009, 13:38 > > i use python-sndobj. > i created a sndthread with a callback function that pushes > in a slice from a numpy array in sndobj; the numpy array is > a view from an h5py file (created using h5py library > facilities) > > def __process_callback(self, channels): > if self.stream.pos_ptr < stop: > for i in > range(channels): > >self.channels[i].PushIn(self.stream.audiodata.get_slice(self.stream.pos_ptr, > > > > > self.stream.pos_ptr + 256, i) * 32768) > self.stream.pos_ptr += 256 > i forgot to explain that get_slice() is a method that retrieves a slice from an array stored in a h5 file (through h5py). > i think that the problem is in h5py + sndthread, because > also without pushin function in the callback, application > crashes. > if i use same array in a qthread or in a python thread it > works without problems; > > this is the bt: > (gdb) bt full > > > > > #0 PyDict_SetItem (op=0x0, key=0xb7d8c3a0, > value=0x81453c0) at ../Objects/dictobject.c:624 > hash = <value optimized > out> > > > > n_used = <value optimized > out> > > > > #1 0x08088d42 in PyDict_SetItemString (v=0x0, > key=0x813f9f2 "exc_type", item=0x81453c0) > at ../Objects/dictobject.c:2186 > > > > > kv = (PyObject *) > 0xb7d8c3a0 > > > > err = -1 > > > > > > #2 0x080f2a51 in PySys_SetObject (name=0x813f9f2 > "exc_type", v=0xa047d40) > > at ../Python/sysmodule.c:82 > > > > > sd = (PyObject *) 0x0 > > > > > #3 0x080cdd66 in PyEval_EvalFrameEx (f=0x9f4b744, > throwflag=0) at ../Python/ceval.c:2994 > exc = (PyObject *) > 0x81453c0 > > > > val = (PyObject *) > 0xa047cec > > > > tb = (PyObject *) > 0xa0434dc > > > > b = (PyTryBlock *) > 0x9f4b78c > > > > stack_pointer = (PyObject **) > 0x9f4b87c > > > next_instr = (unsigned char *) > 0x9f35311 "SWn\032" > > > opcode = <value optimized > out> > > > > oparg = 0 > > > > > > why = <value optimized > out> > > > > err = 0 > > > > > > x = (PyObject *) > 0x814a398 > > > > v = (PyObject *) 0x0 > > > > > w = (PyObject *) 0x0 > > > > > u = (PyObject *) 0x0 > > > > > t = <value optimized > out> > > > > stream = (PyObject *) 0x0 > > > > > freevars = (PyObject **) > 0x9f4b87c > > > > retval = (PyObject *) 0x0 > > > > > tstate = (PyThreadState *) > 0xa2f1e60 > > > > co = (PyCodeObject *) > 0x9f35338 > > > > instr_ub = -1 > > > > > > instr_lb = 0 > > > > > > instr_prev = -1 > > > > > first_instr = (unsigned char *) > 0x9f35304 "y\017" > > > ---Type <return> to continue, or q <return> to > quit--- > > > names = (PyObject *) > 0x9f00e14 > > > > consts = (PyObject *) > 0x9f1454c > > > > #4 0x080cf89d in PyEval_EvalFrameEx (f=0x9f5f5fc, > throwflag=0) at ../Python/ceval.c:3698 > sp = (PyObject **) > 0x9f5f748 > > > > stack_pointer = (PyObject **) > 0x9f5f748 > > > next_instr = (unsigned char *) > 0x9818b02 "}\002" > > > opcode = <value optimized > out> > > > > oparg = 0 > > > > > > why = <value optimized > out> > > > > err = 0 > > > > > > x = (PyObject *) 0x0 > > > > > v = (PyObject *) > 0x9f0f8ac > > > > w = (PyObject *) 0x0 > > > > > u = (PyObject *) 0x0 > > > > > t = <value optimized > out> > > > > stream = (PyObject *) 0x0 > > > > > freevars = (PyObject **) > 0x9f5f744 > > > > retval = (PyObject *) 0x0 > > > > > tstate = (PyThreadState *) > 0xa2f1e60 > > > > co = (PyCodeObject *) > 0x9f1bd10 > > > > instr_ub = -1 > > > > > > instr_lb = 0 > > > > > > instr_prev = -1 > > > > > first_instr = (unsigned char *) > 0x9818afc "t" > > > names = (PyObject *) > 0x9f011ac > > > > consts = (PyObject *) > 0x9f0114c > > > > #5 0x080d00c5 in PyEval_EvalCodeEx (co=0x9f1bd10, > globals=0x9f0f8ac, locals=0x0, > > args=0xa0a5378, argcount=1, kws=0xa0a537c, > kwcount=0, defs=0x9f14dd8, defcount=1, > closure=0x0) at ../Python/ceval.c:2875 > > > > > f = (PyFrameObject *) > 0x9f5f5fc > > > > retval = <value optimized > out> > > > > freevars = (PyObject **) > 0x9f5f744 > > > > tstate = (PyThreadState *) > 0xa2f1e60 > > > > x = <value optimized > out> > > > > u = (PyObject *) > 0x9eabdac > > > > ---Type <return> to continue, or q <return> to > quit--- > > > #6 0x080ce9fc in PyEval_EvalFrameEx (f=0xa0a520c, > throwflag=0) at ../Python/ceval.c:3708 > sp = (PyObject **) > 0xa0a537c > > > > stack_pointer = (PyObject **) > 0xa0a537c > > > next_instr = (unsigned char *) > 0x9fea5a7 "\001z�\001t\003" > > > opcode = <value optimized > out> > > > > oparg = 0 > > > > > > why = <value optimized > out> > > > > err = 0 > > > > > > x = (PyObject *) > 0x9c165cc > > > > v = (PyObject *) > 0x9e9ed74 > > > > w = (PyObject *) 0x0 > > > > > u = (PyObject *) 0x0 > > > > > t = <value optimized > out> > > > > stream = (PyObject *) 0x0 > > > > > freevars = (PyObject **) > 0xa0a5378 > > > > retval = (PyObject *) 0x0 > > > > > tstate = (PyThreadState *) > 0xa2f1e60 > > > > co = (PyCodeObject *) > 0x9ea6650 > > > > instr_ub = -1 > > > > > > instr_lb = 0 > > > > > > instr_prev = -1 > > > > > first_instr = (unsigned char *) > 0x9fea594 "|" > > > names = (PyObject *) > 0x9ea412c > > > > consts = (PyObject *) > 0x9ea64f4 > > > > #7 0x080d00c5 in PyEval_EvalCodeEx (co=0x9ea6650, > globals=0x9e9ed74, locals=0x0, > > args=0xa047ab8, argcount=2, kws=0x0, > kwcount=0, defs=0x0, defcount=0, closure=0x0) > > at ../Python/ceval.c:2875 > > > > > f = (PyFrameObject *) > 0xa0a520c > > > > retval = <value optimized > out> > > > > freevars = (PyObject **) > 0xa0a5378 > > > > tstate = (PyThreadState *) > 0xa2f1e60 > > > > x = <value optimized > out> > > > > u = (PyObject *) 0x0 > > > > > #8 0x08116b91 in function_call (func=0x9eb241c, > arg=0xa047aac, kw=0x0) > > at ../Objects/funcobject.c:517 > > > > > ---Type <return> to continue, or q <return> to > quit--- > > > result = <value optimized > out> > > > > argdefs = <value optimized > out> > > > > d = (PyObject **) 0x0 > > > > > nk = <value optimized > out> > > > > nd = 0 > > > > > > #9 0x0805d4b7 in PyObject_Call (func=0xa0311d0, > arg=0xa047aac, kw=0x0) > > at ../Objects/abstract.c:1861 > > > > > result = <value optimized > out> > > > > call = (ternaryfunc) 0 > > > > > > #10 0x0806369f in instancemethod_call (func=0x9eb241c, > arg=0xa047aac, kw=0x0) > at ../Objects/classobject.c:2519 > > > > self = (PyObject *) > 0xa042dec > > > klass = (PyObject *) 0x1 > > > > result = <value optimized > out> > > > #11 0x0805d4b7 in PyObject_Call (func=0xa0311d0, > arg=0xa039ccc, kw=0x0) > at ../Objects/abstract.c:1861 > > > > result = <value optimized > out> > > > call = (ternaryfunc) 0 > > > > #12 0x080a24d7 in call_method (o=0xa042dec, name=0x812842f > "__getitem__", nameobj=0x8168874, > format=0x812d8fe "(O)") at > ../Objects/typeobject.c:929 > > > args = (PyObject *) > 0xa039ccc > > > > func = (PyObject *) > 0x9c16644 > > > > retval = <value optimized > out> > > > > #13 0x080a2cf0 in slot_mp_subscript (self=0xa042dec, > arg1=0xa04412c) > > at ../Objects/typeobject.c:4371 > > > > > cache_str = (PyObject *) > 0xb7d53048 > > > > #14 0x080cbee4 in PyEval_EvalFrameEx (f=0xa289394, > throwflag=0) at ../Python/ceval.c:1214 > stack_pointer = (PyObject **) > 0xa2894e4 > > > next_instr = (unsigned char *) > 0x9f188ea "S" > > > opcode = <value optimized > out> > > > > oparg = 0 > > > > > > why = <value optimized > out> > > > > err = 0 > > > > > > x = (PyObject *) > 0xa04412c > > > > v = (PyObject *) > 0xa042dec > > > > ---Type <return> to continue, or q <return> to > quit--- > > > w = (PyObject *) > 0xa04412c > > > > u = (PyObject *) 0x0 > > > > > > t = <value optimized > out> > > > > stream = (PyObject *) 0x6 > > > > > freevars = (PyObject **) > 0xa2894dc > > > > retval = (PyObject *) 0x0 > > > > > tstate = (PyThreadState *) > 0xa2f1e60 > > > > co = (PyCodeObject *) > 0x9f1b6e0 > > > > instr_ub = -1 > > > > > > instr_lb = 0 > > > > > > instr_prev = -1 > > > > > > first_instr = (unsigned char *) > 0x9f188d4 "|" > > > names = (PyObject *) > 0x9efe70c > > > > consts = (PyObject *) > 0x9efe6ec > > > > #15 0x080d00c5 in PyEval_EvalCodeEx (co=0x9f1b6e0, > globals=0x9f12c64, locals=0x0, > > args=0xb26019c0, argcount=4, kws=0xb26019d0, > kwcount=0, defs=0x9efe918, defcount=1, > closure=0x0) at ../Python/ceval.c:2875 > > > > > f = (PyFrameObject *) > 0xa289394 > > > > retval = <value optimized > out> > > > > freevars = (PyObject **) > 0xa2894dc > > > > tstate = (PyThreadState *) > 0xa2f1e60 > > > > x = <value optimized > out> > > > > u = (PyObject *) > 0xb26019c0 > > > > #16 0x080ce9fc in PyEval_EvalFrameEx (f=0xb2601874, > throwflag=0) at ../Python/ceval.c:3708 > sp = (PyObject **) > 0xb26019d0 > > > > stack_pointer = (PyObject **) > 0xb26019d0 > > > > next_instr = (unsigned char *) > 0x9e073f6 "d\003" > > > opcode = <value optimized > out> > > > > oparg = 3 > > > > > > why = <value optimized > out> > > > > err = 0 > > > > > > x = (PyObject *) > 0x96500ac > > > > v = (PyObject *) > 0xb2600010 > > > > w = (PyObject *) > 0xb6d73037 > > > > u = (PyObject *) 0x1d6fa0 > > > > > ---Type <return> to continue, or q <return> to > quit--- > > > t = <value optimized > out> > > > > stream = (PyObject *) > 0xa1d6fa0 > > > > freevars = (PyObject **) > 0xb26019b8 > > > > retval = (PyObject *) 0x0 > > > > > tstate = (PyThreadState *) > 0xa2f1e60 > > > > co = (PyCodeObject *) > 0x9f09608 > > > > instr_ub = -1 > > > > > > instr_lb = 0 > > > > > > instr_prev = -1 > > > > > > first_instr = (unsigned char *) > 0x9e07394 "|" > > > names = (PyObject *) > 0x982270c > > > > consts = (PyObject *) > 0x9f23e9c > > > > #17 0x080d00c5 in PyEval_EvalCodeEx (co=0x9f09608, > globals=0x9f04bdc, locals=0x0, > > args=0xa047b58, argcount=2, kws=0x0, > kwcount=0, defs=0x0, defcount=0, closure=0x0) > > at ../Python/ceval.c:2875 > > > > > > f = (PyFrameObject *) > 0xb2601874 > retval = <value optimized > out> > freevars = (PyObject **) > 0xb26019b8 > tstate = (PyThreadState *) > 0xa2f1e60 > x = <value optimized > out> > u = (PyObject *) > 0xa1cb000 > #18 0x08116b91 in function_call (func=0x9a4abc4, > arg=0xa047b4c, kw=0x0) > at ../Objects/funcobject.c:517 > > > > result = <value optimized > out> > > > argdefs = <value optimized > out> > > > d = (PyObject **) 0x0 > > > > nk = <value optimized > out> > > > nd = 0 > > > > > #19 0x0805d4b7 in PyObject_Call (func=0xa0311d0, > arg=0xa047b4c, kw=0x0) > at ../Objects/abstract.c:1861 > > > > result = <value optimized > out> > call = (ternaryfunc) 0 > #20 0x0806369f in instancemethod_call (func=0x9a4abc4, > arg=0xa047b4c, kw=0x0) > at ../Objects/classobject.c:2519 > self = (PyObject *) 0x9afadac > ---Type <return> to continue, or q <return> to > quit--- > klass = (PyObject *) 0x1 > result = <value optimized > out> > #21 0x0805d4b7 in PyObject_Call (func=0xa0311d0, > arg=0xa04278c, kw=0x0) > at ../Objects/abstract.c:1861 > result = <value optimized > out> > call = (ternaryfunc) 0 > #22 0x080c88fc in PyEval_CallObjectWithKeywords > (func=0x9c165a4, arg=0xa04278c, kw=0x0) > at ../Python/ceval.c:3481 > result = <value optimized > out> > #23 0xb55d9d6f in ?? () from > /usr/lib/python2.5/site-packages/_sndobj.so > No symbol table info available. > #24 0xb5429992 in threadfunc () from > /usr/lib/libsndobj.so.2.6.5 > No symbol table info available. > #25 0xb7f284e5 in start_thread (arg=0xb1dfeb90) at > pthread_create.c:300 > __res = <value optimized > out> > __ignore1 = <value optimized > out> > __ignore2 = <value optimized > out> > pd = (struct pthread *) > 0xb1dfeb90 > now = <value optimized > out> > unwind_buf = {cancel_jmp_buf = > {{jmp_buf = {-1208778764, 0, 4001536, -1310726984, > 1504832600, 58672724}, > mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, > data = {prev = 0x0, cleanup = 0x0, canceltype > = 0}}} > not_first_call = <value > optimized out> > #26 0xb7e7621e in clone () at > ../sysdeps/unix/sysv/linux/i386/clone.S:130 > No locals. > thanks in advice. Luigi |