http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56202



             Bug #: 56202

           Summary: SIGFPE (division by zero) in

                    std::binomial_distribution

    Classification: Unclassified

           Product: gcc

           Version: 4.7.2

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: libstdc++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: adam.ciga...@gmail.com





Created attachment 29348

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29348

minimal program to expose the bug in std::binomial_distribution



Hello,



When I explicitly enable floating point exceptions in my code, the program

crashes on SIGFPE inside the std::binomial_distribution. The program works fine

when fp exceptions are not enabled, however, I want them enabled during

development, to help me track errors in my code.



I'm attaching minimal program to reproduce the crash. Compile and run it with:



    g++ -std=c++11 -Wall -Wextra -g -o scratch scratch.cpp && ./scratch



This is the output of gcc -v:



Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.7/lto-wrapper

Target: i686-linux-gnu

Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro

4.7.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs

--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr

--program-suffix=-4.7 --enable-shared --enable-linker-build-id

--with-system-zlib --libexecdir=/usr/lib --without-included-gettext

--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7

--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu

--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object

--enable-plugin --enable-objc-gc --enable-targets=all --disable-werror

--with-arch-32=i686 --with-tune=generic --enable-checking=release

--build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu

Thread model: posix

gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)

Reply via email to