ReSampler icon indicating copy to clipboard operation
ReSampler copied to clipboard

Segementation fault in flac to oga conversion

Open D-W-L opened this issue 2 years ago • 1 comments

build from master uname -a: Linux zoo 5.16.0-5-amd64 #1 SMP PREEMPT Debian 5.16.14-1 (2022-03-15) x86_64 GNU/Linux command line: ReSampler -i SplendidGrandPiano/Samples/FF\ A0.flac --doubleprecision -o FF\ A0.oga -r 480000 --vorbisQuality 7 -b vorbis source of sound file is from: https://github.com/sfzinstruments/SplendidGrandPiano/blob/master/Samples/FF%20A0.flac gdb backtrace: `(gdb) run -i SplendidGrandPiano/Samples/FF\ A0.flac --doubleprecision -o FF\ A0.oga -r 480000 --vorbisQuality 7 -b vorbis Starting program: ReSampler -i SplendidGrandPiano/Samples/FF\ A0.flac --doubleprecision -o FF\ A0.oga -r 480000 --vorbisQuality 7 -b vorbis [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". 2.1.0 64-bit version AVX build ... using FMA (Fused Multiply-Add) instruction ... Input file: SplendidGrandPiano/Samples/FF A0.flac Output file: FF A0.oga Changing output bit format to vorbis Changing output file format to oga Using double precision for calculations. input bit format: 16 source file channels: 2 input sample rate: 44100 output sample rate: 480000 Scanning input file for peaks ...Done Peak input sample: 0.999939 (-0.000530 dBFS) at 0:0:0.107619 LPF transition frequency: 20045.45 Hz (90.91 %) Conversion ratio: 10.884354 (1600:147) Writing Metadata setting vorbis quality level to 7.0 Converting (multi-stage) ... [New Thread 0x7ffff5c94640 (LWP 135959)] [New Thread 0x7ffff5493640 (LWP 135960)] [Thread 0x7ffff5493640 (LWP 135960) exited] [Thread 0x7ffff5c94640 (LWP 135959) exited] [New Thread 0x7ffff5493640 (LWP 135961)] [New Thread 0x7ffff5c94640 (LWP 135962)] [Thread 0x7ffff5c94640 (LWP 135962) exited] [Thread 0x7ffff5493640 (LWP 135961) exited] [New Thread 0x7ffff5c94640 (LWP 135991)] [New Thread 0x7ffff5493640 (LWP 135992)] [Thread 0x7ffff5493640 (LWP 135992) exited] [Thread 0x7ffff5c94640 (LWP 135991) exited] [New Thread 0x7ffff5493640 (LWP 135999)] [New Thread 0x7ffff5c94640 (LWP 136000)] [Thread 0x7ffff5c94640 (LWP 136000) exited] [Thread 0x7ffff5493640 (LWP 135999) exited] [New Thread 0x7ffff5c94640 (LWP 136001)] [New Thread 0x7ffff5493640 (LWP 136002)] [Thread 0x7ffff5493640 (LWP 136002) exited] [Thread 0x7ffff5c94640 (LWP 136001) exited] [New Thread 0x7ffff5493640 (LWP 136003)] [New Thread 0x7ffff5c94640 (LWP 136004)] [Thread 0x7ffff5c94640 (LWP 136004) exited] [Thread 0x7ffff5493640 (LWP 136003) exited] [New Thread 0x7ffff5c94640 (LWP 136005)] [New Thread 0x7ffff5493640 (LWP 136006)] [Thread 0x7ffff5493640 (LWP 136006) exited] [Thread 0x7ffff5c94640 (LWP 136005) exited] [New Thread 0x7ffff5493640 (LWP 136007)] [New Thread 0x7ffff5c94640 (LWP 136008)] [Thread 0x7ffff5c94640 (LWP 136008) exited] [Thread 0x7ffff5493640 (LWP 136007) exited] [New Thread 0x7ffff5c94640 (LWP 136009)] [New Thread 0x7ffff5493640 (LWP 136010)] [Thread 0x7ffff5493640 (LWP 136010) exited] [Thread 0x7ffff5c94640 (LWP 136009) exited] [New Thread 0x7ffff5493640 (LWP 136011)] [New Thread 0x7ffff5c94640 (LWP 136012)] [Thread 0x7ffff5c94640 (LWP 136012) exited] [Thread 0x7ffff5493640 (LWP 136011) exited] [New Thread 0x7ffff5c94640 (LWP 136013)] [New Thread 0x7ffff5493640 (LWP 136014)] [Thread 0x7ffff5493640 (LWP 136014) exited] [Thread 0x7ffff5c94640 (LWP 136013) exited] [New Thread 0x7ffff5493640 (LWP 136015)] [New Thread 0x7ffff5c94640 (LWP 136016)] [Thread 0x7ffff5c94640 (LWP 136016) exited] [Thread 0x7ffff5493640 (LWP 136015) exited] [New Thread 0x7ffff5c94640 (LWP 136017)] [New Thread 0x7ffff5493640 (LWP 136018)] [Thread 0x7ffff5493640 (LWP 136018) exited] [Thread 0x7ffff5c94640 (LWP 136017) exited] [New Thread 0x7ffff5493640 (LWP 136019)] [New Thread 0x7ffff5c94640 (LWP 136020)] [Thread 0x7ffff5c94640 (LWP 136020) exited] [Thread 0x7ffff5493640 (LWP 136019) exited] [New Thread 0x7ffff5c94640 (LWP 136021)] [New Thread 0x7ffff5493640 (LWP 136022)] [Thread 0x7ffff5493640 (LWP 136022) exited] [Thread 0x7ffff5c94640 (LWP 136021) exited] [New Thread 0x7ffff5493640 (LWP 136023)] [New Thread 0x7ffff5c94640 (LWP 136024)] [Thread 0x7ffff5c94640 (LWP 136024) exited] [Thread 0x7ffff5493640 (LWP 136023) exited] [New Thread 0x7ffff5c94640 (LWP 136025)] [New Thread 0x7ffff5493640 (LWP 136026)] [Thread 0x7ffff5493640 (LWP 136026) exited] [New Thread 0x7ffff5493640 (LWP 136027)] [Thread 0x7ffff5c94640 (LWP 136025) exited] [New Thread 0x7ffff5c94640 (LWP 136028)]

Clipping detected ! [Thread 0x7ffff5c94640 (LWP 136028) exited] Adjusting gain by -0.000478 dB [Thread 0x7ffff5493640 (LWP 136027) exited] Writing to output file ... Done Peak output sample: 1.000000 (-0.000001 dBFS) --Type <RET> for more, q to quit, c to continue without paging--c

Thread 1 "ReSampler" received signal SIGSEGV, Segmentation fault. 0x00007ffff7729bf7 in vorbis_analysis_wrote () from /lib/x86_64-linux-gnu/libvorbis.so.0 (gdb) bt #0 0x00007ffff7729bf7 in vorbis_analysis_wrote () from /lib/x86_64-linux-gnu/libvorbis.so.0 #1 0x00007ffff7d360ee in ?? () from /lib/x86_64-linux-gnu/libsndfile.so.1 #2 0x00007ffff7d11b75 in ?? () from /lib/x86_64-linux-gnu/libsndfile.so.1 #3 0x000055555556c0a7 in SndfileHandle::SNDFILE_ref::~SNDFILE_ref (this=0x5555556abab0, __in_chrg=) at /usr/include/sndfile.hh:169 #4 0x000055555556c30c in SndfileHandle::~SndfileHandle (this=0x5555556906f0, __in_chrg=) at /usr/include/sndfile.hh:265 #5 0x0000555555598c66 in std::default_delete<SndfileHandle>::operator() (this=0x7fffffff8b90, __ptr=0x5555556906f0) at /usr/include/c++/11/bits/unique_ptr.h:85 #6 0x0000555555576176 in std::unique_ptr<SndfileHandle, std::default_delete<SndfileHandle> >::~unique_ptr (this=0x7fffffff8b90, __in_chrg=) at /usr/include/c++/11/bits/unique_ptr.h:361 #7 0x000055555558f55d in ReSampler::convert<SndfileHandle, double> (ci=...) at ReSampler.cpp:979 #8 0x000055555556852b in ReSampler::convert_SndfileHandle_Double (ci=...) at ReSampler.cpp:311 #9 0x0000555555569dbe in ReSampler::runCommand (argc=12, argv=0x7fffffffe0d8) at ReSampler.cpp:1571 #10 0x0000555555560373 in main (argc=12, argv=0x7fffffffe0d8) at main.cpp:74 `

D-W-L avatar Mar 26 '22 18:03 D-W-L

Saw, that i set the output sample rate to 480_000 but not 48_000. That seems to give an overflow. With 48_000 it works.

D-W-L avatar Mar 31 '22 13:03 D-W-L

Yes, I think libsndfile might be getting overwhelmed with the huge Sample rate :-)

jniemann66 avatar Jul 26 '23 15:07 jniemann66

Ok - I tested this (on Windows on this particular occasion), and can also confirm that attempting to do 480kHz Vorbis definitely crashes it :-) I understand that from your last message that this was probably just a typo and that you intended 48kHz. Nevertheless, I was curious to experiment with it. As far I can tell from the specs, Vorbis supports samplerates from 8kHz to 192kHz. I can see that when attempting to do the conversion, ReSampler is doing the upsampling (to 480kHz) ok, but when it tries to write out the .oga file, libsndfile is crashing.

Anyway, it's been interesting checking this out. Closing Now. Thanks !

jniemann66 avatar Jul 26 '23 15:07 jniemann66