Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#129 Segmentation fault when transcoding from FLAC to WAV

closed-out-of-date
nobody
None
5
2014-08-18
2009-03-24
Ben Johnson
No

sox -V -V "/audio/830.flac" --rate 44100 --channels 2 -2 "/audio/830.wav"
sox: SoX v14.0.1
sox auto: Detected file format type: flac

Input File : '/audio/830.flac'
Sample Size : 16-bit (2 bytes)
Sample Encoding: FLAC
Channels : 2
Sample Rate : 44100
Duration : 00:05.00 = 220500 samples = 375 CDDA sectors
Endian Type : little
Reverse Nibbles: no
Reverse Bits : no
Comments :
Artist=CSZ (CoolStuffZone)
Title=Help Me Spock
Date=2009
Description=Purchased from the indietorrent.org Music Marketplace. Music copyright CSZ (CoolStuffZone), all rights reserved. See http://creativecommons.org/licenses/by-nc-nd/3.0/ for licensing terms.
Album=Cool Stuff Zone
DISCNUMBER=1/1
TRACKNUMBER=1/1
Genre=ComedyI

Segmentation fault

----------------------

This FLAC file was encoded with "reference libFLAC 1.2.0 20070715".

When I change the artist tag's value to anything other than the string "CSZ (CoolStuffZone)", using metaflac, or any other tagging utility, the segmentation fault does not occur. I have tried changing several of the characters in the artist tag string and changing any one of them solves the problem. For example, changing the artist tag string value to "CSZ (CoolStuffZon)" solves the problem, as does "CS (CoolStuffZone)". Modifying any of the other tag fields does not solve the problem.

Here is the output when I modify the artist tag value:

sox -V -V "/audio/830.flac" --rate 44100 --channels 2 -2 "/audio/830.wav"
sox: SoX v14.0.1
sox auto: Detected file format type: flac

Input File : '/audio/830.flac'
Sample Size : 16-bit (2 bytes)
Sample Encoding: FLAC
Channels : 2
Sample Rate : 44100
Duration : 00:05.00 = 220500 samples = 375 CDDA sectors
Endian Type : little
Reverse Nibbles: no
Reverse Bits : no
Comments :
Artist=CS (CoolStuffZone)
Title=Help Me Spock
Date=2009
Description=Purchased from the indietorrent.org Music Marketplace. Music copyright CSZ (CoolStuffZone), all rights reserved. See http://creativecommons.org/licenses/by-nc-nd/3.0/ for licensing terms.
Album=Cool Stuff Zone
DISCNUMBER=1/1
TRACKNUMBER=1/1
Genre=ComedyI

sox wav: Do not support FLAC with 16-bit data. Forcing to Signed.
sox wav: Writing Wave file: Microsoft PCM format, 2 channels, 44100 samp/sec
sox wav: 176400 byte/sec, 4 block align, 16 bits/samp

Output File : '/var/www/vhosts/dev.indietorrent.org/tmp/830.wav'
Sample Size : 16-bit (2 bytes)
Sample Encoding: signed (2's complement)
Channels : 2
Sample Rate : 44100
Duration : 00:05.00 = 220500 samples = 375 CDDA sectors
Endian Type : little
Reverse Nibbles: no
Reverse Bits : no
Comments :
Artist=CS (CoolStuffZone)
Title=Help Me Spock
Date=2009
Description=Purchased from the indietorrent.org Music Marketplace. Music copyright CSZ (CoolStuffZone), all rights reserved. See http://creativecommons.org/licenses/by-nc-nd/3.0/ for licensing terms.
Album=Cool Stuff Zone
DISCNUMBER=1/1
TRACKNUMBER=1/1
Genre=ComedyI

sox sox: effects chain: input 44100Hz 2 channels 16 bits (multi)
sox sox: effects chain: output 44100Hz 2 channels 16 bits (multi)
sox wav: Finished writing Wave file, 882000 data bytes 220500 samples

----------------------

This problem is occurring on a CentOS 5 server, with uname -a output: Linux indietorrent.org 2.6.9-023stab046.2-enterprise #1 SMP Mon Dec 10 15:22:33 MSK 2007 i686 i686 i386 GNU/Linux

This problem does not occur with the same exact version of SoX on Windows Vista; the conversion completes without issue.

Discussion

  • Ben Johnson
    Ben Johnson
    2009-03-24

    Five-second FLAC audio clip -- changing the artist tag value to any other string solves segfault

     
    Attachments
  • robs
    robs
    2009-03-24

    I've tried the 830.flac with sox 14.0.1 on Linux:
    2.6.26-1-amd64 #1 SMP Wed Nov 26 18:26:02 UTC 2008 x86_64 GNU/Linux
    &
    2.6.24-23-generic #1 SMP Mon Jan 26 00:13:11 UTC 2009 i686 GNU/Linux
    but no fault found. Is it the right file (it seems to be 2 seconds, not 5)?

    However, 14.0.1 is pretty old now; are you able to try with a newer version of SoX?

     
  • Ben Johnson
    Ben Johnson
    2009-10-25

    Hi, robs, I know it has been ages since I filed this report. Thank you for not closing it already :) I decided to come back and update the ticket, because the problem is still occurring with a significant percentage of the files that I transcode with SoX.

    To answer your questions, yes, you are testing with the correct file. I put 5 seconds in the description, but then decided to trim the file down to 2 seconds, to minimize the size. The segfault occurs no matter the length of the audio stream within the file, so I figured, the smaller the better. Sorry about that.

    While I could try with a newer version of SoX, the problem is that I'm "stuck" with 14.0.1 on my production server, because the version of glibc that's installed (2.5). Versions of SoX later than 14.0.1 (and libraries on which it depends) appear to be linked against newer versions of glibc. I've read enough horror stories about glibc upgrades to know better than to attempt an upgrade. My production server is running CentOS 5.0 Final, and it would be a major pain for me to upgrade it. I'd have to migrate everything to a new box.

    The interesting thing is that the same problem does NOT occur on Windows, with the exact same version of SoX. This leads me to believe that the problem is not with SoX, but with a library against which SoX is linked. I just don't know which one.

    If you have any suggestions as to how I might make such a determination, please let me know. Thanks!

     
  • Ben Johnson
    Ben Johnson
    2010-03-01

    I thought it prudent to update this report, since others may be having the same issue.

    I was able to work around the problem by stripping all of the meta-data tags (vorbis comments) from the file, using metaflac, before attempting to operate on the file's audio using SoX.

    As I mentioned in my previous comment, this problem is most likely with a library upon which SoX is dependent, not SoX itself. Please feel free to close the defect if appropriate.

     
  • Jan Starý
    Jan Starý
    2013-02-02

    14.4.0 handles the file fine for me.

     
  • Ulrich Klauer
    Ulrich Klauer
    2013-02-17

    • status: open --> closed-out-of-date