[asterisk-bugs] [JIRA] (ASTERISK-28445) res_pjsip_session: ast_json_vpack: Invalid UTF-8 string on hangup when TEST_FRAMEWORK enabled

Kevin Harwell (JIRA) noreply at issues.asterisk.org
Thu Sep 12 15:51:47 CDT 2019


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=248000#comment-248000 ] 

Kevin Harwell commented on ASTERISK-28445:
------------------------------------------

I ran into this issue while testing for another one, and can consistently replicate it. Here is what I did:

1. Compiled Asterisk using '--enable-dev-mode' and make sure the TEST_FRAMEWORK flag is enabled.
2. Setup 2000 endpoints with associated auths and aors in realtime using a postgresql database.
3. At 30-50 cps had endpoints 1000-1999 call 2000-2999.
4. After a few seconds (probably less than a minute) observed the following:
{noformat}

[2019-09-12 15:33:39] ERROR[3747]: json.c:607 ast_json_vpack: Error building JSON from '{s: s, s: s, s: s, s: s, s: i, s: s}': Invalid UTF-8 string.
[2019-09-12 15:33:39] ERROR[10357]:   Got 16 backtrace records
# 0: asterisk ast_json_vpack()
# 1: asterisk ast_json_pack()
# 2: asterisk __ast_test_suite_event_notify()
# 3: [0x7f82104eacb5] res_pjsip_session.so res_pjsip_session.c:2201 session_destructor()
# 4: asterisk __ao2_ref()
# 5: asterisk __ao2_cleanup_debug()
# 6: [0x7f82104ef0ab] res_pjsip_session.so res_pjsip_session.c:3520 session_end_completion()
# 7: asterisk ast_taskprocessor_execute()
# 8: asterisk <unknown>()
# 9: asterisk ast_taskprocessor_execute()
#10: asterisk <unknown>()
#11: asterisk <unknown>()
#12: asterisk <unknown>()
#13: asterisk <unknown>()
#14: [0x7f827c8516db] libpthread.so.0 pthread_create.c:463 start_thread()
#15: [0x7f827ba3a88f] libc.so.6 clone.S:97 clone()
{noformat}
I also added some logging and printed out the data just before packing and saw something like the following:
{noformat}
state=SESSION_DESTROYED, appfile=res_pjsip_session.c, func=session_destructor, line=2200, data=Endpoint: ���<�
{noformat}
So maybe something is getting corrupted when setting the variable parameters string:
{noformat}
va_start(ap, fmt);
ast_str_set_va(&buf, 0, fmt, ap);
va_end(ap);
{noformat}
Because logging the data before seemingly looked okay.

> res_pjsip_session: ast_json_vpack: Invalid UTF-8 string on hangup when TEST_FRAMEWORK enabled
> ---------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-28445
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28445
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip_session
>    Affects Versions: 16.2.1
>         Environment: Debian Buster
>            Reporter: Bernhard Schmidt
>            Severity: Minor
>              Labels: pjsip
>         Attachments: aor, endpoint
>
>
> On every hangup the following error is logged
> {code}
> [2019-06-12 00:11:07] ERROR[12584]: json.c:607 ast_json_vpack: Error building JSON from '{s: s, s: s, s: s, s: s, s: i, s: s}': Invalid UTF-8 string.
> [2019-06-12 00:11:07] ERROR[12584]:   Got 11 backtrace records
> # 0: /usr/sbin/asterisk(ast_json_pack+0x99) [0x5557a3eda459]
> # 1: /usr/sbin/asterisk(__ast_test_suite_event_notify+0x1be) [0x5557a3f6bbae]
> # 2: /usr/sbin/asterisk(__ao2_ref+0xa6) [0x5557a3e503a6]
> # 3: /usr/lib/asterisk/modules/res_pjsip_session.so(+0x6564) [0x7f8665c19564]
> # 4: /usr/sbin/asterisk(ast_taskprocessor_execute+0xd8) [0x5557a3f62f58]
> # 5: /usr/sbin/asterisk(+0x1821c0) [0x5557a3f6d1c0]
> # 6: /usr/sbin/asterisk(ast_taskprocessor_execute+0xd8) [0x5557a3f62f58]
> # 7: /usr/sbin/asterisk(+0x1819a4) [0x5557a3f6c9a4]
> # 8: /usr/sbin/asterisk(+0x18843f) [0x5557a3f7343f]
> # 9: /lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3) [0x7f868888efa3]
> #10: /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f86885e94cf]
> {code}
> Other than being a big fat RED ERROR in the console it seems to have no ill consequences. 
> There is no non-ASCII character in the callerid or in the dialplan
> Possibly related judging from the backtrace, the Debian package for Asterisk builds with TEST_FRAMEWORK to run the testsuite in CI tests.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list