Taperssection.com

Gear / Technical Help => Post-Processing, Computer / Streaming / Internet Devices & Related Activity => Topic started by: it-goes-to-eleven on September 16, 2005, 12:29:47 PM

Title: Serious FLAC bug found
Post by: it-goes-to-eleven on September 16, 2005, 12:29:47 PM
I discovered a really nasty flac bug this morning..  I have been archiving some masters and intermediate versions under Linux, compressing them with flac. After compression, I would do a 'flac -t' to verify that the archive was good before removing the WAV file..

Well, flac didn't properly handle some WAV files from recordings that were ended without writing the proper size in the header. It issued a warning but still produced a FLAC file and gave an exit code (0) which suggested everything was Fine.  The FLAC file tested fine. Unforunately, a 1.9GB WAV resulted in a 4KB FLAC file!


So I've reported this bug and I'm sure it will get fixed.. But I will be using gzip for my master archives.
Title: Re: Serious FLAC bug found
Post by: F.O.Bean on September 16, 2005, 02:30:43 PM
what version ??? ive had no such problems w/ 1.1.2a

also, id immediately notice if i had a file that was 4KB, and my anal side does each set/show twice in flac frontend anyway, and coming from cd wave>wav>flac frontend ive had really zero problems, those 2 programs like each other!
Title: Re: Serious FLAC bug found
Post by: it-goes-to-eleven on September 16, 2005, 02:47:44 PM
what version ??? ive had no such problems w/ 1.1.2a

1.1.1. I'll try a newer version in a bit but I don't think it will make a diff.

I'd been leaning pretty heavily on the flac -t output for verification..  It goes through the whole file and is expected to catch problems that simply looking at file size would not.. But it failed me this time.. It was the small size that gave it away. I am trying to clean up about 10 shows, each with about 4 or 5 versions.



Title: Re: Serious FLAC bug found
Post by: F.O.Bean on September 16, 2005, 03:13:59 PM
what version ??? ive had no such problems w/ 1.1.2a

1.1.1. I'll try a newer version in a bit but I don't think it will make a diff.

I'd been leaning pretty heavily on the flac -t output for verification.. It goes through the whole file and is expected to catch problems that simply looking at file size would not.. But it failed me this time.. It was the small size that gave it away. I am trying to clean up about 10 shows, each with about 4 or 5 versions.





whats the flac -t thing you speak of ???

i verify all of my files and delet input files and fix sector boundary errors, all on the encoding, but that all i do and ive had nothing but great results!
Title: Re: Serious FLAC bug found
Post by: it-goes-to-eleven on September 16, 2005, 03:20:00 PM
I really like flac.. This just took me by surprise.

-t extracts the flac file contents without writing the output files.

I suppose I could write a script to flac it, then extract it and compare the original and flac version... That's probably what I'll do.

Title: Re: Serious FLAC bug found
Post by: RRobar on September 16, 2005, 03:20:35 PM
he's using the linux version, not the windowz version.
Title: Re: Serious FLAC bug found
Post by: nic on September 16, 2005, 04:12:38 PM
whats the flac -t thing you speak of ???

i verify all of my files and delet input files and fix sector boundary errors, all on the encoding, but that all i do and ive had nothing but great results!

hes using the command line version, not the flac frontend gui
Title: Re: Serious FLAC bug found
Post by: scb on September 16, 2005, 04:18:11 PM
what version ??? ive had no such problems w/ 1.1.2a

1.1.1. I'll try a newer version in a bit but I don't think it will make a diff.

I'd been leaning pretty heavily on the flac -t output for verification.. It goes through the whole file and is expected to catch problems that simply looking at file size would not.. But it failed me this time.. It was the small size that gave it away. I am trying to clean up about 10 shows, each with about 4 or 5 versions.





why not just use the -v option when encoding? it'll verify it
Title: Re: Serious FLAC bug found
Post by: it-goes-to-eleven on September 16, 2005, 04:26:59 PM
-v also fails.  It produces a bogus flac file and exits with a return code of 0 (implying there were no errors).
Title: Re: Serious FLAC bug found
Post by: scb on September 16, 2005, 04:32:17 PM
what's this improper header size?  is flac actually writing the number of bytes the header says to, instead of how many are in the file?
Title: Re: Serious FLAC bug found
Post by: it-goes-to-eleven on September 16, 2005, 04:47:37 PM
what's this improper header size?  is flac actually writing the number of bytes the header says to, instead of how many are in the file?

Exactly.  It doesn't check for a discrepency.
Title: Re: Serious FLAC bug found
Post by: ethan on September 16, 2005, 04:48:58 PM
I discovered a really nasty flac bug this morning..  I have been archiving some masters and intermediate versions under Linux, compressing them with flac. After compression, I would do a 'flac -t' to verify that the archive was good before removing the WAV file..

Well, flac didn't properly handle some WAV files from recordings that were ended without writing the proper size in the header. It issued a warning but still produced a FLAC file and gave an exit code (0) which suggested everything was Fine.  The FLAC file tested fine. Unforunately, a 1.9GB WAV resulted in a 4KB FLAC file!


So I've reported this bug and I'm sure it will get fixed.. But I will be using gzip for my master archives.


Sounds like a bug with whatever is writing bad headers to me...
Title: Re: Serious FLAC bug found
Post by: F.O.Bean on September 16, 2005, 04:49:19 PM
thanks scott, i was like, 'hmmm, ive never seen the -t thing except here at ts.com'
Title: Re: Serious FLAC bug found
Post by: scb on September 16, 2005, 04:52:28 PM
what's this improper header size?  is flac actually writing the number of bytes the header says to, instead of how many are in the file?

Exactly.  It doesn't check for a discrepency.


what was the warning you got?
Title: Re: Serious FLAC bug found
Post by: it-goes-to-eleven on September 16, 2005, 05:05:17 PM
Sounds like a bug with whatever is writing bad headers to me...

I disagree with shifting this away from being a flac bug. Flac is an archive program that a lot of people rely upon.  It needs to be extremely conservative and fault tolerant in regard to whatever it does. 'do no harm'  Minimally, it should exit and throw an error code.  I'm sure it will get fixed..  The important thing is to be aware of it and remember that the code is a little lazy in this area and may be in others as well..  This type of bug tells me that I shouldn't trust flac for archiving masters.  But intermediate versions, sure.

The header issue happens when digital recorders crash while recording and don't get a chance to update the size in the header. These were laptop recordings.  Since they are masters, I wouldn't normally tweak them.  Since I'm archiving a bunch of shows, I wouldn't normally dig into any particular one (oh, this is the umphreys where my laptop crashed right after the show finished..).

Quote
what was the warning you got?

umb.1.wav: WARNING: skipping unknown sub-chunk 'p9'