Benny Prijono wrote: > On Fri, Aug 8, 2008 at 7:33 PM, Pedro Gon?alves > <pedro.pandre at gmail.com <mailto:pedro.pandre at gmail.com>> wrote: > > > > > How can you print the tdata and check->tdata in > > pj_stun_session_on_rx_pkt()? Where did you get the pointers from? > I had some work tracing back the variables, but here is how I am > gettting them: > > > Okay, I don't know about that (haven't read them, sorry). > > But can you add these snippet just before the assert, and try again, > and send back the log? > > PJ_LOG(3,("", "on_stun_request_complete")); > PJ_LOG(3,("", " stun_sess=%p, status=%d" > " tdata=%p, check->tdata=%p" > , stun_sess, status, tdata, check->tdata)); > > if (tdata != check->tdata) { > char dump[1024]; > > PJ_LOG(3,("", "Gotcha!")); > PJ_LOG(3,("", " src_addr=%s", > pj_sockaddr_print(src_addr, dump, sizeof(dump),3))); > PJ_LOG(3,("", " tdata message: ")); > if (tdata && tdata->msg) { > pj_stun_msg_dump(tdata->msg, dump, sizeof(dump), NULL); > PJ_LOG(3,("", "%s", dump)); > } > PJ_LOG(3,("", " check->tdata message: ")); > if (check->tdata && check->tdata->msg) { > pj_stun_msg_dump(check->tdata->msg, dump, sizeof(dump), NULL); > PJ_LOG(3,("", "%s", dump)); > } > PJ_LOG(3,("", " response: ")); > if (response) { > pj_stun_msg_dump(response, dump, sizeof(dump), NULL); > PJ_LOG(3,("", "%s", dump)); > } > PJ_LOG(3,("", " Dude, you're gonna crash!")); > pj_thread_sleep(1000); > } > > Cheers > Benny > I already added that code; however, now the application is crashing in other place (I guess it's just a matter of time until the assert fails again, and I will send you the log the next time the assert fails), in sip_uri.h's pjsip_uri_cmp(), because uri1's vptr has invalid value (everytime this fails, vptr's value is 0x00000007). If I trace back the stack to mod_ua_on_rx_request, I can see that uri1's vptr already has that invalid value. Any ideas that can help understanding this? Here is the stack trace: > PCCommunicator.exe!pjsip_uri_cmp(pjsip_uri_context_e context=PJSIP_URI_IN_REQ_URI, const void * uri1=0x0c02fd98, const void * uri2=0x0c02fdd0) Line 275 + 0x13 bytes C PCCommunicator.exe!pjsip_dlg_on_rx_request(pjsip_dialog * dlg=0x0f89e85c, pjsip_rx_data * rdata=0x0c02f05c) Line 1545 + 0x2d bytes C PCCommunicator.exe!mod_ua_on_rx_request(pjsip_rx_data * rdata=0x0c02f05c) Line 743 + 0xd bytes C PCCommunicator.exe!endpt_on_rx_msg(pjsip_endpoint * endpt=0x09a2705c, int status=0x00000000, pjsip_rx_data * rdata=0x0c02f05c) Line 902 + 0x11 bytes C PCCommunicator.exe!pjsip_tpmgr_receive_packet(pjsip_tpmgr * mgr=0x0c1a4b68, pjsip_rx_data * rdata=0x0c02f05c) Line 1447 + 0x17 bytes C PCCommunicator.exe!udp_on_read_complete(pj_ioqueue_key_t * key=0x0c23d78c, pj_ioqueue_op_key_t * op_key=0x0c02f068, long bytes_read=0x00000400) Line 165 + 0x16 bytes C PCCommunicator.exe!ioqueue_dispatch_read_event(pj_ioqueue_t * ioqueue=0x0c23d1d8, pj_ioqueue_key_t * h=0x0c23d78c) Line 550 + 0x16 bytes C PCCommunicator.exe!pj_ioqueue_poll(pj_ioqueue_t * ioqueue=0x0c23d1d8, const pj_time_val * timeout=0x0dcafcac) Line 763 + 0x17 bytes C PCCommunicator.exe!pjsip_endpt_handle_events2(pjsip_endpoint * endpt=0x09a2705c, const pj_time_val * max_timeout=0x0dcafe7c, unsigned int * p_count=0x00000000) Line 718 + 0x10 bytes C PCCommunicator.exe!pjsip_endpt_handle_events(pjsip_endpoint * endpt=0x09a2705c, const pj_time_val * max_timeout=0x0dcafe7c) Line 745 + 0xf bytes C PCCommunicator.exe!EventHandler(void * __formal=0x00000000) Line 630 + 0x16 bytes C++ PCCommunicator.exe!thread_main(void * param=0x0bb3df94) Line 413 + 0x11 bytes C Best Regards Pedro Gon?alves