Bug#800840: ecasound FTBFS on Alpha: use of infinities despite compilation with -ffast-math

Michael Cree mcree at orcon.net.nz
Sun Oct 4 09:14:51 UTC 2015

Source: ecasound
Version: 2.9.1-7
Severity: important
Justification: fails to build from source but built in the past
User: debian-alpha at lists.debian.org
Usertags: ftbfs

Ecasound FTBFS on Alpha due to a test-suite failure [1]:

make  check-TESTS
make[5]: Entering directory '/«PKGBUILDDIR»/libecasound'
make[6]: Entering directory '/«PKGBUILDDIR»/libecasound'
../test-driver: line 107: 22820 Floating point exception"$@" > $log_file 2>&1
FAIL: libecasound_tester

Running the test suite under gdb reveals the place of the floating
point exception to be:

#0  0x0000000120114d30 in GENERIC_OSCILLATOR::set_parameter (this=0x12022ec10, 
    param=<optimized out>, value=0) at osc-gen.cpp:208

which is on the line of code:

loop_length_rep = 1.0f / frequency();

i.e., a division by frequency() after setting frequency to zero, thus
a division by zero.  But ecasound is compiled with -ffast-math, which
according to the gcc manual in turn sets -ffinite-math-only which is
a guarantee to the compiler that all floating point calculations are
finite.  On Alpha abusing that guarantee results in a floating point
exception and program termination.

Assuming it is intended that frequencies can be zero I attach a patch
that protects against the division by zero.  With that ecasound builds
to completion on Alpha.

(In the patch I also assume that frequencies are non-negative thus
there is no possibility of -0.0 as a frequency.)


[1] https://buildd.debian.org/status/fetch.php?pkg=ecasound&arch=alpha&ver=2.9.1-7&stamp=1440432975
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-divide-by-zero-when-compiling-with-ffast-math.patch
Type: text/x-diff
Size: 617 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20151004/c108aaf9/attachment.patch>

More information about the pkg-multimedia-maintainers mailing list