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

Dirk Hohndel dirk at hohndel.org
Wed Feb 20 20:23:12 PST 2013


Linus Torvalds <torvalds at linux-foundation.org> writes:

> 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?

I like it. Much better.

Any reason it doesn't have an SOB?

/D


More information about the subsurface mailing list