Hi, I could reproduce this by adding -threads to swig as you suggested. What is the workaround again? Best regards, Benny On Fri, Mar 7, 2014 at 8:18 PM, Tom?? Valenta <vali at kamarad.cz> wrote: > Hi Ming, > > thanks for answer. I guess it is either a bug in SWIG or there is a > collision between C/C++ memory allocation and that from a memory pool. > > Anyway the workaround recorded below. > > Cheers, > - Vali > > > Dne 7.3.2014 2:41, Ming napsal(a): > >> Hi Tomas, >> >> In our pygui pjsua2 python sample app, we also iterate media using the >> same method and it runs fine (it's in call.py onCallMediaState()). >> >> Regards, >> Ming >> >> >> On Thu, Mar 6, 2014 at 7:59 PM, Tom?? Valenta <Vali at kamarad.cz >> <mailto:Vali at kamarad.cz>> wrote: >> >> Hi, >> >> I found a strange crash in Python PJSUA2 when iterating call info >> medias. See the patch pjproject-fdport.patch, file >> pjproject/pjsip_apps/src/swig/python/audio_fd.py. If you replace >> for i in range(...) >> with >> for mi in info.media >> as in the comment, you get the crash: >> >> Program received signal SIGSEGV, Segmentation fault. >> [Switching to Thread 0x7ffff47e8700 (LWP 24109)] >> 0x0000000000501bb8 in ?? () >> (gdb) bt >> #0 0x0000000000501bb8 in ?? () >> #1 0x0000000000501fae in ?? () >> #2 0x00007ffff5ce7b95 in ~SwigPtr_PyObject (this=0x7fffec01ce38, >> __in_chrg=<optimized out>) at pjsua2_wrap.cpp:3697 >> #3 ~SwigPtr_PyObject (this=0x7fffec01ce38, __in_chrg=<optimized out>) >> at pjsua2_wrap.cpp:4745 >> #4 ~SwigPyIterator (this=0x7fffec01ce30, __in_chrg=<optimized out>) >> at pjsua2_wrap.cpp:4003 >> #5 ~SwigPyIterator_T (this=0x7fffec01ce30, __in_chrg=<optimized out>) >> at pjsua2_wrap.cpp:4646 >> #6 ~SwigPyIteratorClosed_T (this=0x7fffec01ce30, >> __in_chrg=<optimized out>) >> at pjsua2_wrap.cpp:4745 >> #7 >> swig::SwigPyIteratorClosed_T<__gnu_cxx::__normal_iterator< >> pj::CallMediaInfo*, >> std::vector<pj::CallMediaInfo, std::allocator<pj::CallMediaInfo> > >, >> pj::CallMediaInfo, swig::from_oper<pj::CallMediaInfo> >> >::~SwigPyIteratorClosed_T (this=0x7fffec01ce30, >> __in_chrg=<optimized out>) at pjsua2_wrap.cpp:4745 >> #8 0x00007ffff5c3cb41 in _wrap_delete_SwigPyIterator >> (args=<optimized out>) >> at pjsua2_wrap.cpp:8008 >> #9 0x00000000004d91b6 in PyObject_Call () >> #10 0x00000000004d9e1b in PyObject_CallFunctionObjArgs () >> #11 0x00007ffff5c04045 in SwigPyObject_dealloc (v=0x7ffff544e2d0) >> at pjsua2_wrap.cpp:1698 >> #12 0x000000000042618d in ?? () >> #13 0x0000000000501dc8 in ?? () >> #14 0x000000000054d0a2 in PyEval_EvalFrameEx () >> #15 0x0000000000575d92 in PyEval_EvalCodeEx () >> #16 0x0000000000577ab0 in ?? () >> #17 0x00000000004d91b6 in PyObject_Call () >> #18 0x00000000004c91fa in ?? () >> #19 0x00000000004d91b6 in PyObject_Call () >> #20 0x000000000042e317 in PyObject_CallMethod () >> #21 0x00007ffff5c7766d in SwigDirector_Call::onCallMediaState >> (this=0x7fffec013cc0, >> prm=...) at pjsua2_wrap.cpp:7146 >> #22 0x00007ffff5d396d3 in >> pj::Call::processMediaUpdate(pj::OnCallMediaStateParam&) () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #23 0x00007ffff5d1d4ed in pj::Endpoint::on_call_media_state(int) () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #24 0x00007ffff5d590ef in pjsua_call_on_media_update () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #25 0x00007ffff5d79ad4 in inv_negotiate_sdp () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #26 0x00007ffff5d7a2dd in process_answer () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #27 0x00007ffff5d7a789 in pjsip_inv_answer () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #28 0x00007ffff5d55bfe in pjsua_call_answer2 () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #29 0x00007ffff5d361d3 in pj::Call::answer(pj::CallOpParam const&) () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #30 0x00007ffff5c7cbbb in _wrap_Call_answer (args=<optimized out>) >> at pjsua2_wrap.cpp:77213 >> #31 0x0000000000550138 in PyEval_EvalFrameEx () >> #32 0x0000000000575d92 in PyEval_EvalCodeEx () >> #33 0x000000000054c028 in PyEval_EvalFrameEx () >> #34 0x0000000000575d92 in PyEval_EvalCodeEx () >> #35 0x0000000000577ab0 in ?? () >> #36 0x00000000004d91b6 in PyObject_Call () >> #37 0x00000000004c91fa in ?? () >> #38 0x00000000004d91b6 in PyObject_Call () >> #39 0x000000000042e317 in PyObject_CallMethod () >> #40 0x00007ffff5c7860d in SwigDirector_Account::onIncomingCall >> (this=0x9cde40, prm=...) >> at pjsua2_wrap.cpp:6806 >> #41 0x00007ffff5d1c721 in pj::Endpoint::on_incoming_call(int, int, >> pjsip_rx_data*) () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #42 0x00007ffff5d54357 in pjsua_call_on_incoming () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #43 0x00007ffff5d5c525 in mod_pjsua_on_rx_request () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #44 0x00007ffff5da257b in pjsip_endpt_process_rx_data () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #45 0x00007ffff5da28c0 in endpt_on_rx_msg () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #46 0x00007ffff5dab4cb in pjsip_tpmgr_receive_packet () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #47 0x00007ffff5dac33f in udp_on_read_complete () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #48 0x00007ffff5e78298 in ioqueue_dispatch_read_event () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #49 0x00007ffff5e7a39d in pj_ioqueue_poll () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #50 0x00007ffff5da224b in pjsip_endpt_handle_events2 () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #51 0x00007ffff5d5f177 in pjsua_handle_events () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #52 0x00007ffff5d5c798 in worker_thread () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #53 0x00007ffff5e7b41f in thread_main () >> from /home/tom/pjproject-2.2/pjsip-apps/src/swig/python/_pjsua2. >> so >> #54 0x00007ffff7bc4e9a in start_thread () from >> /lib/x86_64-linux-gnu/libpthread.so.0 >> #55 0x00007ffff699e3fd in clone () from /lib/x86_64-linux-gnu/libc.so. >> 6 >> #56 0x0000000000000000 in ?? () >> >> Ubuntu 12.04.4 precise x64 >> gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 >> Python 2.7.3 >> SWIG Version 2.0.4 >> >> Cheers, >> - Vali >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip at lists.pjsip.org <mailto:pjsip at lists.pjsip.org> >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> >> >> >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip at lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20140311/63979056/attachment-0001.html>