Hi Alexei, You can try adding the instruction: pj_bzero(stream->rec_thread_desc, sizeof(pj_thread_desc)); or pj_bzero(stream->play_thread_desc, sizeof(pj_thread_desc)); before each call of pj_thread_register(). Please let me know the result since I can't try it here. Best regards, Ming On Sun, Dec 19, 2010 at 10:57 PM, Alexei Kuznetsov <eofster at gmail.com> wrote: > On 17 Dec, 2010, at 16:48, Ming wrote: > >> For the crash, unless you can somehow reproduce it using pjsua, we >> can't help you much since I can't reproduce it on my machine. > > For me it's 100% reproducible in my app. What can I do to fix this or to help you to fix this? Under what circumstances can this assertion be hit? I don't do anything special with pjsua-lib from my app, I don't make any pjsip function calls from secondary threads. > > I made a debug build of pjsip. Here's the backtrace when assertion was hit. > > Assertion failed: (thread->signature1 != 0xDEAFBEEF || thread->signature2 != 0xDEADC0DE || (thread->thread == pthread_self())), function pj_thread_register, file ../src/pj/os_core_unix.c, line 405. > Program received signal: ??SIGABRT?. > Data Formatters temporarily unavailable, will re-try after a 'continue'. (Not safe to call dlopen at this time.) > (gdb) bt > #0 ?0x00007fff8871dc75 in __abort () > #1 ?0x00007fff8871dcd9 in abort () > #2 ?0x00007fff8870ac90 in __assert_rtn () > #3 ?0x000000010017334b in pj_thread_register (cstr_thread_name=0x1001bd238 "coreaudio", desc=0x1028adb08, ptr_thread=0x1028add08) at ../src/pj/os_core_unix.c:403 > #4 ?0x00000001000e776f in output_renderer (inRefCon=0x1028ad828, ioActionFlags=0x1027f326c, inTimeStamp=0x101eb4d00, inBusNumber=0, inNumberFrames=471, ioData=0x115cf8930) at ../src/pjmedia-audiodev/coreaudio_dev.c:651 > #5 ?0x00000001025915d0 in dyld_stub_sprintf () > #6 ?0x0000000102591693 in dyld_stub_sprintf () > #7 ?0x00007fff851bac2f in AudioConverterChain::CallInputProc () > #8 ?0x00007fff851ba7da in AudioConverterChain::FillBufferFromInputProc () > #9 ?0x00007fff851ba75b in BufferedAudioConverter::GetInputBytes () > #10 0x00007fff851ba61f in CBRConverter::RenderOutput () > #11 0x00007fff851ba39f in BufferedAudioConverter::FillBuffer () > #12 0x00007fff851ba739 in BufferedAudioConverter::GetInputBytes () > #13 0x00007fff851fd647 in Resampler2Wrapper::RenderOutput () > #14 0x00007fff851ba39f in BufferedAudioConverter::FillBuffer () > #15 0x00007fff851ba739 in BufferedAudioConverter::GetInputBytes () > #16 0x00007fff851ba61f in CBRConverter::RenderOutput () > #17 0x00007fff851ba39f in BufferedAudioConverter::FillBuffer () > #18 0x00007fff851ba510 in AudioConverterChain::RenderOutput () > #19 0x00007fff851ba39f in BufferedAudioConverter::FillBuffer () > #20 0x00007fff851ba11b in AudioConverterFillComplexBuffer () > #21 0x000000010259174d in dyld_stub_sprintf () > #22 0x00000001025912e0 in dyld_stub_sprintf () > #23 0x000000010258f523 in dyld_stub_sprintf () > #24 0x000000010258e870 in dyld_stub_sprintf () > #25 0x0000000102593ceb in AUGenericOutputEntry () > #26 0x00007fff8216032d in HP_IOProc::Call () > #27 0x00007fff821600ff in IOA_Device::CallIOProcs () > #28 0x00007fff8215ff35 in HP_IOThread::PerformIO () > #29 0x00007fff8215df44 in HP_IOThread::WorkLoop () > #30 0x00007fff8215d817 in HP_IOThread::ThreadEntry () > #31 0x00007fff8215d745 in CAPThread::Entry () > #32 0x00007fff88668536 in _pthread_start () > #33 0x00007fff886683e9 in thread_start () > > Alexei > _______________________________________________ > 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 >