[Home]

Summary:ASTERISK-27558: [patch] codec_gsm: Avoid shifting a negative signed value.
Reporter:Alexander Traud (traud)Labels:patch
Date Opened:2018-01-06 04:51:19.000-0600Date Closed:2018-01-09 06:00:56.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Codecs/codec_gsm
Versions:13.18.5 15.1.5 Frequency of
Occurrence
Related
Issues:
is related toASTERISK-27630 [patch] editline: Avoid shifting a negative signed value.
Environment:Attachments:( 0) libgsm_left_shift_unsigned.patch
Description:The compiler _clang_ (5.0.1) reports:{code}src/short_term.c:67:2: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
       STEP(  -2560,  -16,  13107 );
       ^      ~~~~~
src/short_term.c:70:2: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
       STEP(  -1792,   -8,  17476 );
       ^      ~~~~~
src/short_term.c:71:2: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
       STEP(   -341,   -4,  31454 );
       ^       ~~~~
src/short_term.c:72:2: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
       STEP(  -1144,   -4,  29708 );
       ^      ~~~~~
src/short_term.c:60:32: note: expanded from macro 'STEP'
               temp1    = GSM_SUB( temp1, B << 1 );            \
                                          ~ ^{code}This is an external library, which is still maintained by its original author [Jutta Degener|http://twitter.com/juttadegener]: http://www.quut.com/gsm/

The latest upstream change happened in 2017 and that version is called '1.0 Patchlevel 17' aka 1.0.17. The copy within Asterisk is '1.0 Patchlevel 10' aka 1.0.10 from 1996. Debian 9, Ubuntu 18.04 LTS, FreeBSD 11.1, and CentOS 7.4 have 1.0.13 (from 2009). OpenBSD 6.2 has the current version.

Therefore, the *short*-term workaround is to use the precompiled libgsm of your Unix distribution, for example in Debian/Ubuntu: {{sudo apt install libgsm1-dev}}. As *mid*-term solution, I created/attached the difference between 1.0.10 and 1.0.17 for the file {{src/codec.c}}, which resolves the clang issue above. As *long*-term approach within Asterisk, that external library should be
A) updated to the latest upstream version. Or
B) removed and relied solely on precompiled Unix packages.
Comments:By: Friendly Automation (friendly-automation) 2018-01-09 06:00:57.972-0600

Change 7854 merged by Jenkins2:
codec_gsm: Avoid shifting a negative signed value.

[https://gerrit.asterisk.org/7854|https://gerrit.asterisk.org/7854]

By: Friendly Automation (friendly-automation) 2018-01-09 06:19:45.414-0600

Change 7855 merged by Jenkins2:
codec_gsm: Avoid shifting a negative signed value.

[https://gerrit.asterisk.org/7855|https://gerrit.asterisk.org/7855]

By: Friendly Automation (friendly-automation) 2018-01-09 06:23:41.910-0600

Change 7853 merged by Jenkins2:
codec_gsm: Avoid shifting a negative signed value.

[https://gerrit.asterisk.org/7853|https://gerrit.asterisk.org/7853]