linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] Problem with an infinite loop in bcg729 codec


From: Johan Pascal
Subject: Re: [Linphone-developers] Problem with an infinite loop in bcg729 codec
Date: Thu, 17 Sep 2020 23:41:46 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0

Hi Frederic,

Thanks for the bug report.

I do not reproduce the fails in tests. Do you use the latest version of the code(not that it changed recently but you could use an older version)? The patterns for testing are downloaded automatically and have been updated with bug fixes, this allow the repository to be lighter for people who does not want to run the tests but I never made a version management for patterns so old code won't pass the tests as the patterns evolved.

I do not get the runtime errors from ASAN. (some memory leaks on the tests executables nothing more)

I do reproduce the infinite loop (using the encoderVADTest test program), I just pushed a fix.

https://gitlab.linphone.org/BC/public/bcg729/commit/6c7c7f3576e3c2f2aad864e1da0404b21c33b492


Regards,

Johan

On 14/09/2020 16:48, BOITEUX, FREDERIC wrote:
	Hello,

  I've progressed on this bcg729 codec problem :

- the problem is occurring when encoding data coming from a G711 decoded stream, using VAD on this stream.


- I actually got a [short] stream which let reproduces the bug (endless loop) 😊


- I've seen that the bcg729 codec have intrinsic tests : I've compiled and run them, and I got some « fails » :

$ ./testCampaignAll                                     
Test LP2LSPConversion bloc                                                         
  speech  ... Pass
  tame  ... Pass                                                                   
  lsp  ... Pass                          
…
Test postFilter bloc                     
  test  ... Pass                                                                   
  parity  ... Pass
  speech  ... Pass                                                                 
  erasure  ... Pass                      
  tame  ... Pass                                                                   
  algthm ... Fail                        
  fixed  ... Pass                        
  lsp ... Fail    
  pitch  ... Pass                                                                  
  overflow  ... Pass
…
Test decoder bloc 
  speechDecode 3750 frames in 0.092994 seconds : 24.798400 us/frame                
  ... Pass          
  lspDecode 2232 frames in 0.055679 seconds : 24.945789 us/frame                   
 ... Fail                                
…
  algthmDecode 35 frames in 0.000884 seconds : 25.257143 us/frame                  
 ... Fail                                                                          
…


- When I'm compiling the codec with ASAN checker (included in GCC), I get a lot of runtime errors about integer overflow or undefined behaviour :
src/qLSP2LP.c:87:10: runtime error: left shift of negative value -67560105
src/qLSP2LP.c:93:10: runtime error: left shift of negative value -10805
src/postFilter.c:226:28: runtime error: left shift of negative value -1032
src/computeLP.c:76:30: runtime error: left shift of negative value -118198051
src/computeLP.c:91:9: runtime error: left shift of negative value -75628195
src/computeLP.c:94:24: runtime error: left shift of negative value -6604576
src/LP2LSPConversion.c:65:11: runtime error: left shift of negative value -7304
src/LP2LSPConversion.c:66:11: runtime error: left shift of negative value -411
src/LP2LSPConversion.c:141:8: runtime error: left shift of negative value -3003
src/LP2LSPConversion.c:105:22: runtime error: left shift of negative value -552
src/LP2LSPConversion.c:105:22: runtime error: left shift of negative value -552
src/LP2LSPConversion.c:137:17: runtime error: left shift of negative value -2057
src/g729FixedPointMath.h:259:7: runtime error: left shift of negative value -7173
src/g729FixedPointMath.h:300:25: runtime error: left shift of negative value -2563
src/dtx.c:165:27: runtime error: left shift of negative value -3037
src/g729FixedPointMath.h:259:7: runtime error: left shift of negative value -7069
src/g729FixedPointMath.h:300:25: runtime error: left shift of negative value -2664
src/g729FixedPointMath.h:144:6: runtime error: left shift of negative value -5
src/g729FixedPointMath.h:144:6: runtime error: left shift of negative value -5
src/computeWeightedSpeech.c:63:18: runtime error: left shift of negative value -1
src/utils.c:136:18: runtime error: left shift of negative value -1
src/computeWeightedSpeech.c:55:18: runtime error: left shift of negative value -1
src/computeLP.c:195:37: runtime error: left shift of negative value -35
src/computeLP.c:75:23: runtime error: left shift of negative value -293242880
src/cng.c:205:8: runtime error: left shift of negative value -1
src/LPSynthesisFilter.c:41:18: runtime error: left shift of negative value -2
src/postFilter.c:106:18: runtime error: left shift of negative value -2
src/g729FixedPointMath.h:144:6: runtime error: left shift of negative value -1
src/g729FixedPointMath.h:144:6: runtime error: left shift of negative value -1
src/g729FixedPointMath.h:144:6: runtime error: left shift of negative value -4
src/g729FixedPointMath.h:144:6: runtime error: left shift of negative value -4
src/fixedCodebookSearch.c:214:28: runtime error: left shift of negative value -1
…


- I've written my failing stream sample in the bcg729 test format, and added an encoderTest2 which is same as encoderTest but is activating VAD, and I can reproduce the problem ! I've attached both to this e-mail, hope it will be accepted by the list system.


Could you confirm that you can also reproduce the problem ?

What about the failed intrinsic tests, do you have the same results ?

About ASAN runtime errors, I've tried to circumvent them checking sign in left-shift macros, but it leads to get another runtime errors about integer overflows…


    With regards,

	Frédéric Boiteux - Odigo IVR product development
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

_______________________________________________
Linphone-developers mailing list
Linphone-developers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/linphone-developers

reply via email to

[Prev in Thread] Current Thread [Next in Thread]