jniemann66 / ReSampler

High quality command-line audio sample rate converter
GNU Lesser General Public License v2.1
162 stars 26 forks source link

Segfault upon completion of conversion (gcc / minGW only) #3

Closed jniemann66 closed 6 years ago

jniemann66 commented 7 years ago

Description: occasional crash at the end of the conversion Affects: version 2.0.0+ when compiled with gcc or minGW

Suspect double-free or some other deallocation issue

2.0.0-pre-release 64-bit version                                                                                                                                                   
Input file: ./inputs/96khz_sweep-3dBFS_32f.wav                                                                                                                                     
Output file: ./outputs/96khz_sweep-3dBFS_32f-to44k-dp-steep.wav                                                                                                                    
Using double precision for calculations.                                                                                                                                           
input bit format: 32f (float)                                                                                                                                                      
source file channels: 1                                                                                                                                                            
input sample rate: 96000                                                                                                                                                           
output sample rate: 44100                                                                                                                                                          
Scanning input file for peaks ...Done                                                                                                                                              
Peak input sample: 0.707107 (-3.010297 dBFS) at 0:0:0.215438                                                                                                                       
LPF transition frequency: 21047.73 Hz (95.45 %)                                                                                                                                    
Conversion ratio: 0.459375 (147:320)                                                                                                                                               
Writing Metadata                                                                                                                                                                   
Converting ...Done                                                                                                                                                                 
Peak output sample: 0.707107 (-3.010297 dBFS)                                                                                                                                      
Time=329 ms [24.3x]                                                                                                                                                                

*** Error in `../ReSampler': double free or corruption (out): 0x0000000001a7edc0 ***              

Update 24/02/18: fixed channel output buffer size out-by-one bug. See attached valgrind output valgrind-session-ReSampler-bug.txt

Update 17/02/18: crashing as soon as std::vector<std::vector> outputChannelBuffers; is destroyed. Still not exactly sure why.