Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 232798

Summary: media-libs/alsa-lib-1.0.16: crash if compiled with CFLAGS="-malign-double"
Product: Gentoo Linux Reporter: Dustin Frisch <dustin.frisch>
Component: New packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: major CC: gentoo-bugs
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Dustin Frisch 2008-07-23 22:31:51 UTC
alsamixer and /etc/init.d/alsasound will crash if alsa-lib is emerged with "-malign-double".

alsa-lib and will emerge without any problems using the following CFLAGS:
CFLAGS=""
CFLAGS="${CFLAGS} -O3"
CFLAGS="${CFLAGS} -march=athlon-xp"
CFLAGS="${CFLAGS} -ffast-math"
CFLAGS="${CFLAGS} -pipe"
CFLAGS="${CFLAGS} -fomit-frame-pointer"
CFLAGS="${CFLAGS} -funroll-loops"
CFLAGS="${CFLAGS} -msse"
CFLAGS="${CFLAGS} -malign-double"
CFLAGS="${CFLAGS} -mfpmath=sse,387"

but if I want to run /etc/init.d/alsasound it will still fail with the following error message:
"alsactl: get_control:259: Cannot read control '2,0,0,Wave Playback Volume,0': Inappropriate ioctl for device"

and alsamixer tells me:
"alsamixer: function snd_mixer_load failed: Inappropriate ioctl for device"

If I recompile the alsa-lib ebuild without the "-malign-double" CFLAG it will run without any problem (I have not to reemerge alsa-utils to get it working).

(This is the same problem reported as in #46901 but I'm not allowed to reopen the bug)

Reproducible: Always

Steps to Reproduce:
1. Emerge alsa-lib with CFLAGS="-malign-double"
2. Run alsamixer

Actual Results:  
alsamixer crashes with
"alsamixer: function snd_mixer_load failed: Inappropriate ioctl for device"

and /etc/init.d/alsasound crashes with
"alsactl: get_control:259: Cannot read control '2,0,0,Wave Playback Volume,0': Inappropriate ioctl for device"


Portage 2.1.4.4 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r6 i686)
=================================================================
System uname: 2.6.25-gentoo-r6 i686 AMD Athlon(tm) XP 1800+
Timestamp of tree: Mon, 21 Jul 2008 18:15:01 +0000
app-shells/bash:     3.2_p33
dev-lang/python:     2.4.4-r13, 2.5.2-r5
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.61-r2
sys-devel/automake:  1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS=" -O3 -march=athlon-xp -ffast-math -pipe -fomit-frame-pointer -funroll-loops -msse -mfpmath=sse,387"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/udev/rules.d"
CXXFLAGS=" -O3 -march=athlon-xp -ffast-math -pipe -fomit-frame-pointer -funroll-loops -msse -mfpmath=sse,387"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS=" http://ftp.first-world.info/ http://213.186.33.37/gentoo-distfiles/ http://ftp.heanet.ie/pub/gentoo/ http://gentoo.mneisen.org/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
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"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="acl bash-completion berkdb bzip2 cli cracklib crypt cups dri fortran gdbm gpm iconv isdnlog midi mudflap ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session spl ssl tcpd unicode x86 xorg 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 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 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="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nv"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Carsten Lohrke (RETIRED) gentoo-dev 2008-07-23 22:45:19 UTC
"holy shit, my box is glowin'" compiler flag combinations are not supported.
Comment 2 Dustin Frisch 2008-07-24 19:00:02 UTC
(In reply to comment #1)
> "holy shit, my box is glowin'" compiler flag combinations are not supported.
> 

Which combination of CFLAGS do you mean?
Comment 3 Sophie Hamilton 2008-09-29 12:18:08 UTC
I'm not a Gentoo dev, but I can explain what's meant by that...

Some CFLAGS are known to be a cause of brokenness in many cases. -ffast-math is a particularly common suspect, but -funroll-loops and -mfpmath=sse,387 are also bad flags to use. -O3 is also a risky flag.

Since these flags can inexplicably cause weird bugs to result, Gentoo devs don't support these combinations, and will probably ask you to recompile with sane CFLAGS (normally along the lines of -O2 -pipe -march=athlon-xp or similar). You can find a listing of CFLAGS and why they're considered risky at http://gentoo-wiki.com/CFLAGS_matrix ; a listing of safe CFLAGS to use system-wide can be found at http://gentoo-wiki.com/Safe_Cflags .

The speedup gained by using the extra flags is minimal, and cause more problems than they're worth. :)