You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cause i try to use NUTAG_APPL_METHOD("PRACK") to handle PRACK and 200OK for PRACK by application layer.
But sometime the network transmission is not satisfactory, the network problems caused sofia received 200ok for invite before receiving 200ok for prack.
And after handle 200OK for invite the nua_server_request_destroy function remove 200OK for INVITE from ds_sr list, then call su_free to release INVITE server request(nua_server.c:336) and the pointor sr0 will release and use to other new address, a new pointer will point to the freed memory,and maybe change the "sr_signal" pointer variable.
The "dr_sr" list only contains a request for prack, until 200 OK for prack arrives and processing at nua_prack_server_report, it will check the sr->sr_irq->irq_magic->sr_signal(nua_session.c:2986), and i know sr->sr_irq is equal to the previously released invite request sr, but at this time sofia don't know the sr->sr_irq is a released memory, maybe sr_signal is any number but not null ! It will call sr_signal at (nua_session.c:2989), the illegal memory address accessed.lead to all process to core dump.
I know this is a wrong order. 200ok for invite was received before 200ok for prack.So this is why i call it a fault tolerant repair.
I think we should check whether there are unprocessed requests before processing 200ok for invite. If there are, send 500 error.
About my gdb backtrace info:
(gdb) backtrace
#0 0x00007ff7968ff889 in su_msg_data () from /usr/local/lib/libsofia-sip-ua.so.0 #1 0x00007ff7968947e3 in nua_event_data () from /usr/local/lib/libsofia-sip-ua.so.0 #2 0x00007ff79689487b in nua_signal_data () from /usr/local/lib/libsofia-sip-ua.so.0 #3 0x00007ff7968b5db6 in nua_prack_server_report () from /usr/local/lib/libsofia-sip-ua.so.0 #4 0x00007ff796898a70 in nua_server_report () from /usr/local/lib/libsofia-sip-ua.so.0 #5 0x00007ff796897bf0 in nua_stack_respond () from /usr/local/lib/libsofia-sip-ua.so.0 #6 0x00007ff796894706 in nua_stack_signal () from /usr/local/lib/libsofia-sip-ua.so.0 #7 0x00007ff796901b15 in su_base_port_execute_msgs () from /usr/local/lib/libsofia-sip-ua.so.0 #8 0x00007ff7969018a3 in su_base_port_getmsgs () from /usr/local/lib/libsofia-sip-ua.so.0 #9 0x00007ff796901c0a in su_base_port_run () from /usr/local/lib/libsofia-sip-ua.so.0 #10 0x00007ff7968fdf60 in su_port_run () from /usr/local/lib/libsofia-sip-ua.so.0 #11 0x00007ff7968ff03a in su_root_run () from /usr/local/lib/libsofia-sip-ua.so.0 #12 0x00007ff796902a6c in su_pthread_port_clone_main () from /usr/local/lib/libsofia-sip-ua.so.0 #13 0x00007ff795b32ea5 in start_thread () from /lib64/libpthread.so.0 #14 0x00007ff795186b0d in clone () from /lib64/libc.so.6
(gdb)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cause i try to use NUTAG_APPL_METHOD("PRACK") to handle PRACK and 200OK for PRACK by application layer.
But sometime the network transmission is not satisfactory, the network problems caused sofia received 200ok for invite before receiving 200ok for prack.
And after handle 200OK for invite the nua_server_request_destroy function remove 200OK for INVITE from ds_sr list, then call su_free to release INVITE server request(nua_server.c:336) and the pointor sr0 will release and use to other new address, a new pointer will point to the freed memory,and maybe change the "sr_signal" pointer variable.
The "dr_sr" list only contains a request for prack, until 200 OK for prack arrives and processing at nua_prack_server_report, it will check the sr->sr_irq->irq_magic->sr_signal(nua_session.c:2986), and i know sr->sr_irq is equal to the previously released invite request sr, but at this time sofia don't know the sr->sr_irq is a released memory, maybe sr_signal is any number but not null ! It will call sr_signal at (nua_session.c:2989), the illegal memory address accessed.lead to all process to core dump.
I know this is a wrong order. 200ok for invite was received before 200ok for prack.So this is why i call it a fault tolerant repair.
I think we should check whether there are unprocessed requests before processing 200ok for invite. If there are, send 500 error.