[BUG] statistics.c broken with 32bit mingw-gcc-3.4.5

Linus Torvalds torvalds at linux-foundation.org
Wed Feb 20 18:57:50 PST 2013


On Wed, Feb 20, 2013 at 5:40 PM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> (or a possible BUG of sorts, rather).
>
> i'm using 32bit mingw-gcc-3.4.5, which is actually fast and is good to
> check compatibility.
>
> but there is a crash every time i do a:
> - subsurface ./dives/*.xml
> - log -> show early statistics
> (without a debugger)

Hmm. Do this:

    #include <fenv.h>

in main.c and then add

    feenableexcept(FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID);

to the startup. On x86, most floating point exceptions are disabled by
default, so you can divide by zero (only floating point) etc without
getting any warnings, just odd results.

Testing it, we have a divide-by-zero at least in profile.c (line
1053), where we do the SAC calculations with a zero time difference.

But I can't re-create your problem. I wonder if it's some 32-bit thing.

Btw, here's the patch for the divide-by-zero.. Dirk?

             Linus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 1485 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130220/5b634815/attachment.obj>


More information about the subsurface mailing list