<p>Joshua C. Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10889">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Sean Bright: Looks good to me, but someone else must approve
Richard Mudgett: Looks good to me, but someone else must approve
Joshua C. Colp: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Test_cel: Fails when DONT_OPTIMIZE is off<br><br>A bug in GCC causes TEST_CEL to return failure under the following<br>conditions:<br>1. TEST_FRAMEWORK on<br>2. DONT_OPTIMIZE off<br>3. Fedora and Ubuntu<br>4. GCC 8.2.1<br>5. Test name: test_cel_dial_pickup<br>6. There must exist a certain combination of multithreading.<br>The bug affects arithmetic calculations when the optimization level<br>is bigger than O1 and the -fpartial-inline flag is on. Provided these<br>conditions, function ast_str_to_lower() fails to convert to lower case<br>due to said function being of type force_inline. The solution is to<br>remove the "force_inline" type declaration from function ast_str_to_lower()<br><br>Change-Id: Ied32e0071f12ed9d5f3b4cdd878b2532a1c769d7<br>---<br>M include/asterisk/strings.h<br>M main/strings.c<br>2 files changed, 16 insertions(+), 13 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h</span><br><span>index e4bef5f..aaf2737 100644</span><br><span>--- a/include/asterisk/strings.h</span><br><span>+++ b/include/asterisk/strings.h</span><br><span>@@ -1212,19 +1212,7 @@</span><br><span> *</span><br><span> * \retval str for convenience</span><br><span> */</span><br><span style="color: hsl(0, 100%, 40%);">-static force_inline char *attribute_pure ast_str_to_lower(char *str)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- char *str_orig = str;</span><br><span style="color: hsl(0, 100%, 40%);">- if (!str) {</span><br><span style="color: hsl(0, 100%, 40%);">- return str;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- for (; *str; ++str) {</span><br><span style="color: hsl(0, 100%, 40%);">- *str = tolower(*str);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- return str_orig;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(120, 100%, 40%);">+char *attribute_pure ast_str_to_lower(char *str);</span><br><span> </span><br><span> /*!</span><br><span> * \brief Convert a string to all upper-case</span><br><span>diff --git a/main/strings.c b/main/strings.c</span><br><span>index 640af61..a18bb48 100644</span><br><span>--- a/main/strings.c</span><br><span>+++ b/main/strings.c</span><br><span>@@ -421,3 +421,18 @@</span><br><span> </span><br><span> return 0;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+char *attribute_pure ast_str_to_lower(char *str)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ char *str_orig = str;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!str) {</span><br><span style="color: hsl(120, 100%, 40%);">+ return str;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ for (; *str; ++str) {</span><br><span style="color: hsl(120, 100%, 40%);">+ *str = tolower(*str);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ return str_orig;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10889">change 10889</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10889"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ied32e0071f12ed9d5f3b4cdd878b2532a1c769d7 </div>
<div style="display:none"> Gerrit-Change-Number: 10889 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Chris Savinovich <csavinovich@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Chris Savinovich <csavinovich@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua C. Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>