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.