[Asterisk-code-review] res_pjsip_caller_id: Add ANI2/OLI parsing (asterisk[16])

N A asteriskteam at digium.com
Thu Jul 8 14:04:45 CDT 2021


Attention is currently required from: George Joseph.
N A has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16119 )

Change subject: res_pjsip_caller_id: Add ANI2/OLI parsing
......................................................................


Patch Set 3:

(1 comment)

Patchset:

PS3: 
> > It seems like a null string issue in pj_strdup_with_null, it's definitely consistent between multi […]
I went in and poked around in gdb, so far I'd say this is suspicious:
(gdb) print ident->hvalue
$5 = {ptr = 0x508948f0458b4810 <error: Cannot access memory at address 0x508948f0458b4810>, slen = 5803812775952861200}
set_id_from_oli, which is what invokes the function where the crash occurs, is called in the same place as the other functions that also do so. The crash still occurs if I move the call after other functions which successfully call the same function. Furthermore, on the latest core dump, I don't get that memory access error:
(gdb) bt
#0  __libc_siglongjmp (env=0x0, val=1) at longjmp.c:32
#1  0x00007f70d2bda007 in pj_throw_exception_ (exception_id=1) at ../src/pj/except.c:54
#2  0x00007f70d2bd687a in default_pool_callback (pool=0x7f70c0018040, size=140121966028000) at ../src/pj/pool_policy_malloc.c:87
#3  0x00007f70d2bdea02 in pj_pool_create_block (pool=0x7f70c0018040, size=140121966028000) at ../src/pj/pool.c:63
#4  0x00007f70d2bdec52 in pj_pool_allocate_find (pool=0x7f70c0018040, size=140121966024793) at ../src/pj/pool.c:138
#5  0x00007f70d2bde7a2 in pj_pool_alloc (pool=0x7f70c0018040, size=140121966024793) at ../include/pj/pool_i.h:62
#6  0x00007f70d2beb56d in pj_strdup_with_null (pool=0x7f70c0018040, dst=0x7f705bfc86a0, src=0x7f70b00296d8) at ../include/pj/string_i.h:52
#7  0x00007f70ac21b9ca in get_id_header (rdata=0x7f70b0019098, header_name=0x7f70ac41dca0 <from>) at res_pjsip_caller_id.c:130
#8  0x00007f70ac21ba65 in set_id_from_oli (rdata=0x7f70b0019098, ani2=0x7f705bfc874c) at res_pjsip_caller_id.c:163
#9  0x00007f70ac21c30c in caller_id_incoming_request (session=0x7f70c00232c0, rdata=0x7f70b0019098) at res_pjsip_caller_id.c:450
#10 0x00007f706e055208 in handle_incoming_request (session=0x7f70c00232c0, rdata=0x7f70b0019098) at res_pjsip_session.c:4406
#11 0x00007f706e0532e1 in new_invite (invite=0x7f705bfc8a10) at res_pjsip_session.c:4044
#12 0x00007f706e053779 in handle_new_invite_request (rdata=0x7f70b0019098) at res_pjsip_session.c:4112
#13 0x00007f706e054246 in session_on_rx_request (rdata=0x7f70b0019098) at res_pjsip_session.c:4234
#14 0x00007f70d2b34357 in pjsip_endpt_process_rx_data (endpt=0x55efe7c820b8, rdata=0x7f70b0019098, p=0x7f70b532cb40 <param>, p_handled=0x7f705bfc8cb4) at ../src/pjsip/sip_endpoint.c:930
#15 0x00007f70b50fd2a3 in distribute (data=0x7f70b0019098) at res_pjsip/pjsip_distributor.c:955
#16 0x000055efe6cbe707 in ast_taskprocessor_execute (tps=0x55efe8369130) at taskprocessor.c:1237
#17 0x000055efe6cc82cb in execute_tasks (data=0x55efe8369130) at threadpool.c:1354
#18 0x000055efe6cbe707 in ast_taskprocessor_execute (tps=0x55efe7c7e4e0) at taskprocessor.c:1237
#19 0x000055efe6cc5ecd in threadpool_execute (pool=0x55efe7c7c6f0) at threadpool.c:367
#20 0x000055efe6cc7b0c in worker_active (worker=0x7f70980037f0) at threadpool.c:1137
#21 0x000055efe6cc787e in worker_start (arg=0x7f70980037f0) at threadpool.c:1056
#22 0x000055efe6cd374b in dummy_start (data=0x7f7098003780) at utils.c:1428
#23 0x00007f70d0c194a4 in start_thread (arg=0x7f705bfc9700) at pthread_create.c:456
#24 0x00007f70cf4dad0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
(gdb) frame 7
#7  0x00007f70ac21b9ca in get_id_header (rdata=0x7f70b0019098, header_name=0x7f70ac41dca0 <from>) at res_pjsip_caller_id.c:130
130             pj_strdup_with_null(rdata->tp_info.pool, &header_content, &ident->hvalue);
(gdb) print ident
$1 = (pjsip_generic_string_hdr *) 0x7f70b0029698
(gdb) print ident->hvalue
$2 = {ptr = 0x7f70b0029720 "\240\064\344\322p\177", slen = 140121966024792}
(gdb) print header_content
$3 = {ptr = 0x55efe6d6e710 <__PRETTY_FUNCTION__.19235> "ast_party_id_copy", slen = 7574980235416}
(gdb) print rdata->tp_info.pool
$4 = (pj_pool_t *) 0x7f70c0018040



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16119
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ifc938a7a7d45ce33999ebf3656a542226f6d3847
Gerrit-Change-Number: 16119
Gerrit-PatchSet: 3
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: George Joseph <gjoseph at digium.com>
Gerrit-Comment-Date: Thu, 08 Jul 2021 19:04:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: N A <mail at interlinked.x10host.com>
Comment-In-Reply-To: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210708/6d4a077e/attachment-0001.html>


More information about the asterisk-code-review mailing list