Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 124872 - sys-apps/file-4.17-r1 misidentifies FLAC files as MP3
Summary: sys-apps/file-4.17-r1 misidentifies FLAC files as MP3
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-03 14:16 UTC by Jason S.
Modified: 2006-12-12 10:06 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
file-4.17.ebuild (file-4.17.ebuild,1.43 KB, text/plain)
2006-03-04 00:25 UTC, SpanKY
Details
file-4.17-flac-id3.patch (file-4.17-flac-id3.patch,2.52 KB, patch)
2006-03-13 18:02 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason S. 2006-03-03 14:16:52 UTC
sys-apps/file is misidentifying FLAC files as MP3 files due to the leading ID3v2 data.
Per http://flac.sourceforge.net/faq.html, it would seem as though ID3 tags are acceptible, but discouraged as some players may not provide support for reading ID3 tags, and may be unable to use the actual FLAC audio data "behind" it.

Plain text example:
$ file 01\ -\ Monolithic\ -\ Silent\ Whisper.flac
01 - Monolithic - Silent Whisper.flac: MP3 file with ID3 version 2.3.0 tag

Since FLAC files are fairly large, and I don't know the policy, I'm going to ask if I should even upload FLAC files as test cases, or if you'd rather I provide a link offsite?

Alternatively, I could also make ~5 second FLAC file test cases if necessary to keep the file size down.
All of my current FLAC files are Vorbis Comment+ID3 tagged.
Let me know what, if any, test cases are required.
Comment 1 Jason S. 2006-03-03 14:52:55 UTC
Well ain't this a piece.

I can't seem to create a new FLAC file with this problem.
I suspect that the culprit is CDex, which I stopped using long ago, but had used to rip my collection.
However, I can't download it and recreate, because their site is broken (at least as of the moment of writing this).

I've found a smaller file (better test case?) that is just under 10MB:
$ file 09\ -\ Various\ -\ WWF\ The\ Music_\ Volume\ 2\ -\ Faarooq_Nation\ Of\ Domination.flac 
09 - Various - WWF The Music_ Volume 2 - Faarooq_Nation Of Domination.flac: MP3 file with ID3 version 2.3.0 tag
Comment 2 SpanKY gentoo-dev 2006-03-03 18:13:21 UTC
could you download and test 4.17 please ?  i dont have any .flac files myself ...

ftp://ftp.astron.com/pri/file-4.17.tar.gz
Comment 3 Jason S. 2006-03-03 23:34:08 UTC
~/tmp/bin $ ./file --version
file-4.17
magic file from /home/jason/tmp/share/file/magic

~/tmp/bin $ ./file /mnt/windows/federation/g/music/FLAC/Monolithic/Dividing\ Asunder/01\ -\ Monolithic\ -\ Silent\ Whisper.flac
/mnt/windows/federation/g/music/FLAC/Monolithic/Dividing Asunder/01 - Monolithic - Silent Whisper.flac: MP3 file with ID3 version 2.3.0 tag

Was it ok to do it this way, or do I need to install it over the entire existing version in order to use the new libs/magic files, etc. etc. ?

It's been a loooooooooooooooooooong time since I've done things without an ebuild :-)
Comment 4 SpanKY gentoo-dev 2006-03-04 00:25:23 UTC
> Was it ok to do it this way

no, building and running locally wont work

> or do I need to install it over the entire
> existing version in order to use the new libs/magic files, etc. etc. ?

correct ... i'll post an ebuild for you to use
Comment 5 SpanKY gentoo-dev 2006-03-04 00:25:52 UTC
Created attachment 81269 [details]
file-4.17.ebuild
Comment 6 Jason S. 2006-03-04 08:14:25 UTC
It went boom:

for frag in Magdir/acorn Magdir/adi Magdir/adventure Magdir/allegro Magdir/alliant Magdir/alpha Magdir/amanda Magdir/amigaos Magdir/animation Magdir/apl Magdir/apple Magdir/applix Magdir/archive Magdir/asterix Magdir/att3b Magdir/audio Magdir/basis Magdir/bflt Magdir/blender Magdir/blit Magdir/bout Magdir/bsdi Magdir/btsnoop Magdir/cad Magdir/c-lang Magdir/c64 Magdir/cddb Magdir/chi Magdir/chord Magdir/cisco Magdir/citrus Magdir/claris Magdir/clipper Magdir/cracklib Magdir/spec Magdir/commands Magdir/communications Magdir/compress Magdir/console Magdir/convex Magdir/ctags Magdir/dact Magdir/database Magdir/diamond Magdir/diff Magdir/digital Magdir/dolby Magdir/dump Magdir/editors Magdir/elf Magdir/encore Magdir/epoc Magdir/esri Magdir/fcs Magdir/filesystems Magdir/flash Magdir/fonts Magdir/frame Magdir/freebsd Magdir/fsav Magdir/games Magdir/geos Magdir/gcc Magdir/gimp Magdir/gnu Magdir/grace Magdir/gringotts Magdir/hitachi-sh Magdir/hp Magdir/human68k Magdir/ibm370 Magdir/ibm6000 Magdir/iff Magdir/images Magdir/intel Magdir/interleaf Magdir/island Magdir/ispell Magdir/java Magdir/jpeg Magdir/karma Magdir/lecter Magdir/lex Magdir/lif Magdir/linux Magdir/lisp Magdir/mach Magdir/macintosh Magdir/magic Magdir/mail.news Magdir/maple Magdir/mathematica Magdir/matroska Magdir/mcrypt Magdir/mime Magdir/mips Magdir/mirage Magdir/misctools Magdir/mkid Magdir/mlssa Magdir/mmdf Magdir/modem Magdir/motorola Magdir/msdos Magdir/msvc Magdir/mup Magdir/natinst Magdir/ncr Magdir/netbsd Magdir/netscape Magdir/news Magdir/nitpicker Magdir/ocaml Magdir/octave Magdir/olf Magdir/os2 Magdir/os9 Magdir/osf1 Magdir/palm Magdir/parix Magdir/pbm Magdir/pdf Magdir/pdp Magdir/perl Magdir/pgp Magdir/pkgadd Magdir/plan9 Magdir/plus5 Magdir/printer Magdir/project Magdir/psdbms Magdir/psion Magdir/pulsar Magdir/pyramid Magdir/python Magdir/revision Magdir/riff Magdir/rpm Magdir/rtf Magdir/sc Magdir/sccs Magdir/sendmail Magdir/sequent Magdir/sgi Magdir/sgml Magdir/sharc Magdir/sinclair Magdir/sketch Magdir/smalltalk Magdir/sniffer Magdir/dyadic Magdir/scientific Magdir/softquad Magdir/spectrum Magdir/sql Magdir/sun Magdir/sysex Magdir/teapot Magdir/terminfo Magdir/tex Magdir/tgif Magdir/ti-8x Magdir/timezone Magdir/troff Magdir/tuxedo Magdir/typeset Magdir/unknown Magdir/uuencode Magdir/varied.out Magdir/varied.script Magdir/vax Magdir/vicar Magdir/virtutech Magdir/visx Magdir/vms Magdir/vmware Magdir/vorbis Magdir/vxl Magdir/wordprocessors Magdir/xdelta Magdir/xenix Magdir/xo65 Magdir/xwindows Magdir/zilog Magdir/zyxel; do \
  if test -f ./$frag; then \
    f=./$frag; \
  else \
    f=$frag; \
  fi; \
          cat $f; \
done >> magic
../src/file -C -m magic
make[2]: *** [magic.mgc] Segmentation fault


Here's my emerge --info since I have not yet provided it:
Portage 2.1_pre5-r2 (default-linux/x86/2006.0, gcc-3.4.5, glibc-2.3.6-r3, 2.6.15-gentoo-r5 i686)
=================================================================
System uname: 2.6.15-gentoo-r5 i686 Pentium III (Coppermine)
Gentoo Base System version 1.12.0_pre16
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.3.5-r2, 2.4.2-r1
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -mtune=pentium3 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=pentium3 -mtune=pentium3 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.mirrors.easynews.com/linux/gentoo/"
LINGUAS="en ja ko zh_CN"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://gentoo.mirrors.easynews.com/gentoo-portage"
USE="x86 7zip X X509 aac aalib acl aim alsa apache apache2 apm ares arts asf avi bash-completion bitmap-fonts bzip2 cdda cddb cdparanoia cdrom cgi cjk cli crypt csv ctype cups curl curlwrappers dba dedicated divx4linux ecore editor emboss encode escreen esd etwin expat extras fastcgi ffmpeg firefox flac foomaticdb fortran frontendonly ftp gdbm gif gmail gmailtimestamps gnome gnutls gpm gstreamer gtk gtk2 icq id3 idn imagemagick imap imlib immqt-bc jabber jack java jp2 jpeg jpeg2k kde lame libcaca libg++ libwww live lj mad md5sum mikmod mmx mode-paranoid modplug monkey motif mozxmlterm mp3 mp4live mpeg mpeg2 mpeg4 mplayer mpm-prefork musepack musicbrainz mysql mysqli mythtv ncurses nls nntp nptl offensive ogg oggvorbis opengl openssl oss pam pcre pdflib pear perl php player png pop python qt quicktime rar readline real rogue rss ruby samba sasl sdl server session sid simplexml slang smime speex spell sqlite sse ssl subversion svg svga svgz symlink tcltk tcpd theora tidy tiff tools truetype truetype-fonts type1-fonts udev unicode vhosts videos vim vim-pager vim-with-x visualization vorbis win32codecs wxgtk1 xanim xchatdccserver xine xinerama xml xml2 xmlreader xmlrpc xmms xsl xv xvmc yahoo yp zip zlib elibc_glibc input_devices_mouse input_devices_keyboard kernel_linux linguas_en linguas_ja linguas_ko linguas_zh_CN userland_GNU video_cards_radeon"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, LDFLAGS
Comment 7 Jason S. 2006-03-12 03:25:37 UTC
Since I'm unable to upload this, and modifications will strip out the data:
http://vxjasonxv.com/flacid3testcase.flac

Approx, ~10MB in size.
Comment #1 corresponds to this file.
Comment 8 SpanKY gentoo-dev 2006-03-13 16:48:59 UTC
ok, 4.17 also fails in the same way:

$ file --version
file-4.17
$ file flacid3testcase.flac
flacid3testcase.flac: MP3 file with ID3 version 2.3.0 tag
Comment 9 Jonathan Heaney 2006-03-13 17:46:35 UTC
(In reply to comment #6)

*snip*

Same segfault here with file-4.17.  I know this should probably go in a seperate bug report.
Comment 10 SpanKY gentoo-dev 2006-03-13 17:52:42 UTC
that's already been reported & fixed elsewhere
Comment 11 SpanKY gentoo-dev 2006-03-13 18:02:12 UTC
Created attachment 82065 [details, diff]
file-4.17-flac-id3.patch

patch from upstream ... seems to work for me, what about you ?
Comment 12 Olliver Schinagl 2006-03-14 12:01:20 UTC
(In reply to comment #10)
> that's already been reported & fixed elsewhere
> 

Since 'file' is too common to look for, I was glad enough to find _any_ info on this matter. You should have linked 'elsewhere' in your post.

Also, I just did an emerge -ve system (with the new glibc 2.4 and nptl nptlonly flags set) and get the same segmentation fault. I'll try to look for the real 'file' bug report.
Comment 13 SpanKY gentoo-dev 2006-03-14 12:30:40 UTC
> Since 'file' is too common to look for

so then search for "file" and "4.17"
Comment 14 Jason S. 2006-03-19 04:00:59 UTC
(In reply to comment #11)
> patch from upstream ... seems to work for me, what about you ?

Would love to find out if it works... but.
( Here we go again :P )

>>> Unpacking file-4.17.tar.gz to /var/tmp/portage/file-4.17/work

gzip: stdin: decompression OK, trailing garbage ignored
tar: Child returned status 2
tar: Error exit delayed from previous errors

!!! ERROR: sys-apps/file-4.17 failed.
Call stack:
  ebuild.sh, line 1557:   Called dyn_unpack
  ebuild.sh, line 719:   Called src_unpack
  file-4.17.ebuild, line 20:   Called unpack 'file-4.17.tar.gz'

^ This is bizarre, because when you had initially provided me with the ebuild, it was not having this problem at all.
Comment 15 Jason S. 2006-03-19 06:55:35 UTC
Time for me to spamzzzzz the bug report some more :D.
Well, I ponied up, and compiled from source with your patch and the 4.17 sources you provided in Comment #2 (zomg!).

First:
As I think I said previously, Tagging software is fixing this (notably: MusicBrainz) because the test case I gave you:
09 - James Alan Johnston - Nation of Domination.flac: Audio file with ID3 version 23.0 tag, FLAC encoding, 6 channels

However, like I said before.  ID3 data is "acceptible, but discouraged", but is acceptible.
Do I need to provide another testcase or three?

A legacy (i.e. ID3v2) tagged file:
01 - Adema - Adema - Everyone.flac: Audio file with ID3 version 23.0 tag, MP3 encoding

Still says MP3 :/
Do I need to up that test case as well?
I tested at least one song from every album in my not yet MusicBrainz tagged FLAC files, and all of them said something to that effect.
(P.S. nitpick: ID3 version 23.0? WHOOOA! :D)
Comment 16 SpanKY gentoo-dev 2006-03-19 10:56:04 UTC
dont use the ebuild i posted here, file-4.17-r1 is in portage now ... use that
Comment 17 Jason S. 2006-03-20 07:30:26 UTC
r1 doesn't have the patch, and I don't know how to apply the patch to /usr/portage/distfiles sources

(No, you don't have to tell me, but if there's a link or something I'm very willing to learn.)

Long story short, per Comment #15 with the patch, the problem persisted.
I'll get another test case up tonight.
Comment 18 SpanKY gentoo-dev 2006-12-12 10:06:40 UTC
please post an attachment of a file that is misidentified