[Home]

Summary:ASTERISK-27224: Crash when freeing log message
Reporter:Richard Kenner (kenner)Labels:
Date Opened:2017-08-27 21:16:13Date Closed:2017-09-05 15:21:46
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Core/Logging
Versions:14.6.0 Frequency of
Occurrence
One Time
Related
Issues:
Environment:CentOS 7Attachments:
Description:I have a crash at stringfields.c:94.

See below:
{noformat}
#3  logger_thread (data=data@entry=0x0) at logger.c:1721
1721                            logmsg_free(msg);
(gdb) print *msg
$15 = {type = LOGMSG_NORMAL, level = 4, sublevel = -1, line = 2724,
 lwp = 30375, callid = 0, __field_mgr_pool = 0x7f9d540cc448,
 date = 0x7f9d540cc4c0 "Aug 27 19:50:44",
 file = 0x7f9d540cc4da "rtp_engine.c",
 function = 0x7f9d540cc4ea "ast_rtp_dtls_cfg_parse",
 message = 0x7f9d540cc46a "dtlscafile file /etc/pki/tls/certs/server-ca.crt does not exist or is not readable\n", level_name = 0x7f9d540cc4d2 "ERROR",
 __field_mgr = {last_alloc = 0x7f9d540cc4ea "ast_rtp_dtls_cfg_parse",
   embedded_pool = 0x7f9d540cc448, string_fields = {elems = 0x7f9d5408f510,
     max = 5, current = 5}}, list = {next = 0x0}}
(gdb) p msg->__field_mgr.string_fields.elems[0]
$16 = (const char **) 0x696b702f6374652f
(gdb) p $16
$17 = (const char **) 0x696b702f6374652f
(gdb) p *$16
Cannot access memory at address 0x696b702f6374652f
{noformat}
Comments:By: Asterisk Team (asteriskteam) 2017-08-27 21:16:15.465-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2017-08-28 05:36:37.667-0500

We need more information than this. Do you have a full backtrace? Is it occurring constantly? If you resolve the error it is referencing does it go away?

By: Richard Kenner (kenner) 2017-08-28 07:05:28.329-0500

I'm setting up Asterisk on a new server and don't plan to fix the error any time soon.  This was a one-shot crash, but I can't deploy the system live until each crash is understood and resolved.

Unfortunately, the full backtrace isn't very useful:
{noformat}
#0  reset_field (p=0x696b702f6374652f) at stringfields.c:94
#1  __ast_string_field_free_memory (mgr=mgr@entry=0x7f9d540cc418,
   pool_head=pool_head@entry=0x7f9d540cc3e8,
   cleanup_type=cleanup_type@entry=AST_STRINGFIELD_DESTROY,
   file=file@entry=0x64ba65 "logger.c", lineno=lineno@entry=182,
   func=func@entry=0x64bf58 <__PRETTY_FUNCTION__.16670> "logmsg_free")
   at stringfields.c:122
#2  0x000000000053e5cf in logmsg_free (msg=0x7f9d540cc3d0) at logger.c:182
#3  logger_thread (data=data@entry=0x0) at logger.c:1721
#4  0x00000000005f90da in dummy_start (data=<optimized out>) at utils.c:1233
#5  0x00007f9df16d6dc5 in start_thread () from /lib64/libpthread.so.0
#6  0x00007f9df099676d in clone () from /lib64/libc.so.6
{noformat}

By: Rusty Newton (rnewton) 2017-08-29 17:34:18.862-0500

Do you have an Asterisk log showing what was happening at the time? Hopefully one with high verbosity or debug.

Also, can you provide sanitized Asterisk configuration? Preferably for your SIP channel driver, RTP configuration and anything else relevant.

By: Richard Kenner (kenner) 2017-08-29 20:18:09.999-0500

Absolutely nothing was going on at the time.  This was a new installation that hadn't processed any calls yet.  The relevant configuration issue is that I had an entry in sip.conf:

[XXXX](phones)
fullname=sipjs Test
md5secret=xx
transport=ws,wss
avpf=yes
encryption=yes
transport=udp,ws
force_avp=yes
dtlsenable = yes
dtlscafile = /etc/pki/tls/certs/server-ca.crt
dtlscertfile = /etc/pki/tls/certs/server.crt
dtlsprivatekey = /etc/pki/tls/private/server.key
dtlsverify=no
dtlssetup=actpass
;cesupport=yes
allow=h264

and  /etc/pki/tls/certs/server-ca.crt doesn't exist.

By: Rusty Newton (rnewton) 2017-09-05 15:21:46.548-0500

Well, this one is no fun, but I don't see anything to go on here. If you or someone else is able to reproduce in the future, or get more informative traces then we'll reopen.

By: Richard Kenner (kenner) 2017-09-05 15:27:13.073-0500

I strongly suspect this was caused by the problem fixed in ASTERISK-27225.

By: Asterisk Team (asteriskteam) 2017-09-05 15:27:13.668-0500

This issue has been reopened as a result of your commenting on it as the reporter. It will be triaged once again as applicable.