Floating point exception (core dumped) on torchaudio.load
🐛 Describe the bug
I also encountered the same problem as 2870, which caused a Floating point exception (core dumped) when loading ADPCM encoded audio and caused the service to crash directly.
This problem will occur in torchaudio version 0.11.0 and all versions after, while previous versions are normal.
This is because 0.11.0 fixed a bug about reading 24bit audio at that time 2084, the fixed code is as follows torchaudio/csrc/pybind/sox/effects_chain.cpp
if (sf->encoding.bits_per_sample > 0)
*osamp /= (sf->encoding.bits_per_sample / 8);
If the bits_per_sample of the audio is less than 8 (as is the case with ADPCM encoded audio), this line of code will directly cause an exception to divide by zero
Versions
Collecting environment information... PyTorch version: 1.13.0+cu117 Is debug build: False CUDA used to build PyTorch: 11.7 ROCM used to build PyTorch: N/A
OS: Ubuntu 22.04.1 LTS (x86_64) GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Clang version: Could not collect CMake version: Could not collect Libc version: glibc-2.35
Python version: 3.10.6 (main, Nov 2 2022, 18:53:38) [GCC 11.3.0] (64-bit runtime) Python platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.35 Is CUDA available: True CUDA runtime version: Could not collect CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3060 Ti GPU 1: NVIDIA GeForce RTX 3080 Ti
Nvidia driver version: 510.85.02 cuDNN version: Could not collect HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True
Versions of relevant libraries: [pip3] numpy==1.23.4 [pip3] pytorch-lightning==1.6.5 [pip3] pytorch-metric-learning==1.6.2 [pip3] torch==1.13.0 [pip3] torch-audiomentations==0.11.0 [pip3] torch-pitch-shift==1.2.2 [pip3] torchaudio==0.13.0 [pip3] torchmetrics==0.10.2 [pip3] torchvision==0.14.0 [conda] Could not collect
Hi @zengruizhao
- Can you try the nightly and see if it helps?
- Can you provide a sample wav file that we can test on? (or a command to generate a synthetic one)
Hi,@mthrok, thanks for your fast reply, i can provide the ADPCM encode audio. Sometimes due to the version dependency in the project, the version of torchaudio cannot be directly upgraded
hi @mthrok, can the issue be fixed?