Open GoogleCodeExporter opened 8 years ago
'dist' will be zero of the circles are in the exact same place', but there were
already conditional expressions protecting against divide by zero. It's strange
that those didn't catch it. What version of Chipmunk?
Also, are you running this code on a machine without an FPU? Following normal
floating point rules, a non-zero number divided by zero should evaluate to +/-
infinity, but not an error. Chipmunk actually uses infinity this way in a
number of places. If you don't have full FPU support you will have to drop the
--fast-math flag so that GCC inserts checks for handling infinity and NaN.
Original comment by slemb...@gmail.com
on 9 Dec 2010 at 9:37
>> What version of Chipmunk?
5.3.2 and latest from svn
>> Also, are you running this code on a machine without an FPU?
I ran it on my laptop with Turion X2 Ultra ZM85, OS - ArchLinux x86_64, but
application compiled as 32-bit.
Original comment by dr.andru@gmail.com
on 10 Dec 2010 at 5:26
Another interesting moment. All works fine with GCC 4.4.4
Original comment by dr.andru@gmail.com
on 10 Dec 2010 at 9:43
Hrm. I guess I'll leave this open a little bit longer in case something else
pops up.
Original comment by slemb...@gmail.com
on 11 Dec 2010 at 5:53
Compilation with flags "-O2 -march=i686 -ffast-math" instead of "-O3
-ffast-math" solved the problem O_o
Original comment by dr.andru@gmail.com
on 20 Dec 2010 at 1:06
Hrm. I'm thinking that sounds like a compiler bug. There shouldn't be any
divide by zeros or uninitialized variables in there to cause any undefined
behaviour like that. I'm not quite sure how to go about reporting it without
trying to study the assembly it outputs either to see if it really is a bug.
Original comment by slemb...@gmail.com
on 20 Dec 2010 at 3:51
Original issue reported on code.google.com by
dr.andru@gmail.com
on 9 Dec 2010 at 9:23