[Home]

Summary:ASTERISK-29888: res_pjsip_outbound_authenticator_digest: ABRT attempting to clean up auth_sess
Reporter:George Joseph (gjoseph)Labels:
Date Opened:2022-01-31 07:03:29.000-0600Date Closed:2022-02-01 07:23:21.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_pjsip_outbound_authenticator_digest
Versions:16.23.0 18.9.0 19.1.0 Frequency of
Occurrence
Related
Issues:
is duplicated byASTERISK-29908 pjsip: Asterisk asserts on nonexistent registration auth and crashes
Environment:Attachments:
Description:{code}
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007fb396fdd8b3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007fb396f906a6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fb396f7a7d3 in __GI_abort () at abort.c:79
#4  0x00007fb396f7a6fb in __assert_fail_base (fmt=<optimized out>, assertion=<optimized out>, file=<optimized out>, line=<optimized out>, function=<optimized out>) at assert.c:92
#5  0x00007fb396f89396 in __GI___assert_fail (assertion=assertion@entry=0x7fb397dfb2c7 "sess && sess->endpt", file=file@entry=0x7fb397dfaf58 "../src/pjsip/sip_auth_client.c", line=line@entry=523, function=function@entry=0x7fb397dfb400 <__PRETTY_FUNCTION__.7> "pjsip_auth_clt_deinit") at assert.c:101
#6  0x00007fb397d5a4d4 in pjsip_auth_clt_deinit (sess=sess@entry=0x7fb3356b26c0) at ../src/pjsip/sip_auth_client.c:523
#7  0x00007fb39469c5aa in digest_create_request_with_auth (auth_ids_vector=<optimized out>, challenge=0x7fb2f8127648, old_request=0x7fb2fc0064c8, new_request=0x7fb3356b27c8) at res_pjsip_outbound_authenticator_digest.c:567
#8  0x00007fb394685342 in handle_registration_response (data=0x7fb2f800fdc0) at res_pjsip_outbound_registration.c:1093
#9  0x0000000000596567 in ast_taskprocessor_execute (tps=tps@entry=0x7fb2f8148530) at taskprocessor.c:1235
#10 0x000000000059c840 in execute_tasks (data=0x7fb2f8148530) at threadpool.c:1350
#11 0x0000000000596567 in ast_taskprocessor_execute (tps=0x1d64fc0) at taskprocessor.c:1235
#12 0x000000000059d330 in threadpool_execute (pool=0x1d63a30) at threadpool.c:367
#13 worker_active (worker=0x7fb300000bd0) at threadpool.c:1137
#14 worker_start (arg=arg@entry=0x7fb300000bd0) at threadpool.c:1056
#15 0x00000000005a467a in dummy_start (data=<optimized out>) at utils.c:1572
#16 0x00007fb396fdba87 in start_thread (arg=<optimized out>) at pthread_create.c:435
#17 0x00007fb397060640 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
{code}

Very corner case where a reload was done that deleted an endpoint and its companion outbound registration and auth.   Only happens in dev-mode.

* The auth got deleted first.
* The registration tried to unregister with the remote system, got a 401.
* Tried to get the auths which didn't exist anymore.
* Failed and skipped to its cleanup step.
* Tried to call pjsip_auth_clt_deinit() with a session that wasn't initialized.
* Which pjsip_auth_clt_deinit() detected and aborted.

Simple fix to not call pjsip_auth_clt_deinit() if teh session was never initialized.
Comments:By: Friendly Automation (friendly-automation) 2022-02-01 07:23:21.653-0600

Change 17969 merged by Friendly Automation:
res_pjsip_outbound_authenticator_digest: Prevent ABRT on cleanup

[https://gerrit.asterisk.org/c/asterisk/+/17969|https://gerrit.asterisk.org/c/asterisk/+/17969]

By: Friendly Automation (friendly-automation) 2022-02-01 07:29:32.290-0600

Change 17968 merged by Friendly Automation:
res_pjsip_outbound_authenticator_digest: Prevent ABRT on cleanup

[https://gerrit.asterisk.org/c/asterisk/+/17968|https://gerrit.asterisk.org/c/asterisk/+/17968]

By: Friendly Automation (friendly-automation) 2022-02-01 07:30:48.493-0600

Change 17967 merged by Friendly Automation:
res_pjsip_outbound_authenticator_digest: Prevent ABRT on cleanup

[https://gerrit.asterisk.org/c/asterisk/+/17967|https://gerrit.asterisk.org/c/asterisk/+/17967]

By: Friendly Automation (friendly-automation) 2022-02-01 07:39:51.629-0600

Change 17946 merged by Joshua Colp:
res_pjsip_outbound_authenticator_digest: Prevent ABRT on cleanup

[https://gerrit.asterisk.org/c/asterisk/+/17946|https://gerrit.asterisk.org/c/asterisk/+/17946]