Menu

#336 Regression from 14.3.2 to 14.4.0 around stdin

closed-out-of-date
nobody
None
5
2020-08-12
2013-07-23
No

Going from 14.3.2 (tested both a Ubuntu build and a self-built binary) to 14.4.0 (Debian/stable binary) I see this regression: sox cannot operate on wav files from stdin anymore.

[ this is 14.4]
$ cat l2.wav | sox - /tmp/cracauer/l.wav stat
sox FAIL formats: can't open input `-': WAVE: RIFF header not found

$ cat l2.wav | /tmp/sox-14.3.2/src/sox - /tmp/cracauer/l.wav stat
Samples read: 579699712
Length (seconds): 6038.538667
Scaled by: 2147483647.0
[all stats there]

An strace reveals that both versions do an fstat on fd 0.

The old version then goes on to use read(2) on fd 0 both in the case of a file and of a pipe.

The new version behaves differently based on the outcome of the stat. If it likes what it sees, a file, it will do an fseek(0). If it didn't like the stat it will not attempt the fseek and simply print the about error message.

Side-bug: the error message is incorrect/misleading/unhelpful

Clarification: the fseek doesn't fail, it is not attempted

Reproduce hint: at least in bash do not test with "sox ... < file" because that results in a seekable fd0. You need a useless use of cat to reproduce this.

Clarification 2: this is not related to missing file length info in the wav file header. The above test file has the header field (written by mpg123).

Discussion

  • Ulrich Klauer

    Ulrich Klauer - 2013-08-04

    This is already fixed in 14.4.1. You should upgrade; the 14.4.0 in Debian stable has more bugs that have been fixed in 14.4.1.

     
  • Mans Rullgard

    Mans Rullgard - 2020-08-12

    Ticket moved from /p/sox/patches/100/

    Can't be converted:

    • _milestone:
     
  • Mans Rullgard

    Mans Rullgard - 2020-08-12
    • status: open --> closed-out-of-date
     

Log in to post a comment.

Monday.com Logo