Review Board 1.7.16

res_pjsip: dtls_handler causes Asterisk to crash

Review Request #4409 - Created Feb. 6, 2015 and submitted

Kevin Harwell
There have been a couple of times where a crash occurred in the dtls_handler section of the code for res_pjsip. Unfortunately, in working this issue the problem was unable to be reproduced. After looking at the backtraces and through the code the current best guess as to why this happened might be due to a reentrance problem and the strtok function. So, the current fix is to convert the strtok function into the reentrant version of the function, strtok_r.
Ran through the pjsip testsuite tests to make sure no crashes occurred or anything else out of the ordinary. Also while running asterisk with res_pjsip configured to use realtime issued reloads every 0.1 seconds while also executing the show endpoint command at the same interval in an attempt to potentially cause two threads to enter the dtls_handler function at the same time. No crashes occurred.
Review request changed
Updated (Feb. 11, 2015, 12:24 p.m.)
  • changed from pending to submitted
Committed in revision 431715 runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to