Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 335728 - libsndfile ebuild must not append large file flags
Summary: libsndfile ebuild must not append large file flags
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-02 21:43 UTC by Stephen Fairchild
Modified: 2010-09-05 09:27 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Fairchild 2010-09-02 21:43:05 UTC
The following test code appears to indicate that libsndfile does not support 16 bit wav file writing at 44100 sample rate, also tried FLAC 24 bit and failed.

I was happily using libsndfile in one of my programs I'm developing until it stopped working. Tried revdep-rebuild and even emerge -e libsndfile. Reverting to a previously known working version of my program also failed.

#include <stdio.h>
#include <sndfile.h>

int main(void)
{
    SF_INFO sfinfo;

    sfinfo.samplerate = 44100;
    sfinfo.channels = 2;
    sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16;

    printf("sf_format_check returns %d\n", sf_format_check(&sfinfo));
    return 0;
}

Compiled with
$ gcc testsndfile.c `pkg-config --cflags --libs sndfile` -o testsndfile
$ ./testsndfile
sf_format_check returns 0

This is the failure return code.

Reproducible: Always

Steps to Reproduce:



Expected Results:  
This test program should have indicated a return code of 1.
Comment 1 Ross Smith 2010-09-02 21:49:43 UTC
Please attach your emerge --info to this bug as well.   

Were there any new packages or updates installed around the time that it stopped working?   also, does any other formats work with libsndfile?

Comment 2 Stephen Fairchild 2010-09-02 22:02:34 UTC
It was last known to be working over a week ago so I can't really put my finger on any particular update. The emerge --info as requested.

stephen@tmb ~ $ emerge --info
Portage 2.1.8.3 (default/linux/x86/10.0/desktop/gnome, gcc-4.3.4, glibc-2.11.2-r0, 2.6.34-gentoo-r1 i686)
=================================================================
System uname: Linux-2.6.34-gentoo-r1-i686-Intel-R-_Core-TM-2_Extreme_CPU_Q6850_@_3.00GHz-with-gentoo-1.12.13
Timestamp of tree: Wed, 01 Sep 2010 23:00:01 +0000
app-shells/bash:     4.0_p37
dev-java/java-config: 1.3.7-r1, 2.1.11
dev-lang/python:     2.4.6, 2.5.4-r4, 2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.1.2, 4.3.4, 4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo ; http://gentoo.virginmedia.com ; http://mirror.bytemark.co.uk/gentoo"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi additions alsa aotuv arts berkdb bluetooth branding bzip2 cairo cdaudio cdda cddb cdio cdr cdrkit cli consolekit cracklib crypt cups cxx dbus divx dri dts dv dvd dvdr dvdread eds embedded emboss encode evo exif extras fam ffmpeg firefox flac fortran fts3 gdbm gdu gif gnome gnome-keyring gnutls gpm gstreamer gtk hal iconv imagemagick ipv6 jack jack-tmpfs java javascript jpeg lcms ldap libnotify libsamplerate libssh2 lm_sensors logitech-mouse mad maps matroska mdnsresponder-compat mikmod mmap mmx mmxext mng modules mp3 mp4 mpeg mplayer mudflap musicbrainz mysql nautilus ncurses nls nptl nvidia odbc ogg opengl openmp pam pango pcre pdf perl png policykit ppds pppd python qt3support qt4 quicktime readline reflection rss rtsp samba sdk sdl sdlaudio secure-delete session sndfile speex spell spl sql sqlite srt sse sse2 ssl ssse3 startup-notification svg sysfs taglib tcl tcpd theora tiff tk truetype unicode usb vnc vorbis webkit wide-unicode wifi win32codecs wma wmp wxwindows x264 x86 xine xml xorg xrandr xspf xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Stephen Fairchild 2010-09-02 22:05:19 UTC
Other tested formats also failed but since those are obscure the combination of format and sub-format might have been incorrect and warranted a return code of 0. This is not the case for the wav and flac options I tried.
Comment 4 Bent Bisballe Nyeng 2010-09-03 17:26:07 UTC
Making a diff between the vanilla header file (sndfile.h) and the one installed in /usr/include by the current ebuild renders the following result:

diff /usr/include/sndfile.h ~/src/libsndfile-1.0.21/src/sndfile.h
315c315
< typedef off_t sf_count_t ;
---
> typedef loff_t        sf_count_t ;

They should be the same!

I have tried including the vanilla header file in my app, and everything works like a charm.

I have a feeling that the change results in the SF_INFO struct being filled out wrong in open-for-read and interpreted wrong in open-for-write.

Broken patch somewhere?
Comment 5 Guy Martin (RETIRED) gentoo-dev 2010-09-05 09:18:20 UTC
I've had a similar issue. The problem lies in the fact that the ebuild provides the large file flags to the configure script. This breaks the configure script logic and sf_count_t ends up always being declared as off_t instead of loff_t on 32 bit systems.

Simple fix, remove "append-lfs-flags" :
--- libsndfile-1.0.21.ebuild.orig       2010-09-05 11:15:09.000000000 +0200
+++ libsndfile-1.0.21.ebuild    2010-09-05 11:15:15.000000000 +0200
@@ -44,7 +44,6 @@
 }
 
 src_compile() {
-       append-lfs-flags
 
        econf $(use_enable sqlite) \
                $(use_enable alsa) \



I've contacted upstream about this before finding this bug. He confirms that sf_count_t is being declared as either off_t on 64bit system or loff_t on 32 bit system. However, those flags mess up the logic in the configure script.

Comment 6 Samuli Suominen gentoo-dev 2010-09-05 09:27:09 UTC
done, this means libsndfile for multilib emul- packages is borqued again.

+*libsndfile-1.0.21-r1 (05 Sep 2010)
+
+  05 Sep 2010; Samuli Suominen <ssuominen@gentoo.org>
+  +libsndfile-1.0.21-r1.ebuild:
+  Remove append-lfs-flags (#313259) again wrt #335728.