Ok, i've this nasty bug. I have a program with JEDI-SDL and OpenGL, running on windows and linux.
The bug happends only when i compile the program on windows with FPC (any 1.9.x version). With Delphi or on linux (both kylix and fpc) the bug disappears.
The problem is that when i try to render anything with GL_LIGHTING turned on, i have a EDivByZero exception. The exception starts inside OpenGl code, so i can't track it.
If i render with GL_LIGHTING disabled than it runs fine.
This happends almost in any program, for example it happends on lesson7 of JEDI-SDL version NeHe.

I've come to the conclusion that (maybe) it could be a bug in FPC for which it passes some malformed data to OpenGl (wich pass silently) but when rendering it gets DivByZero.

Anyone experienced this too ? If it's needed i'll post executables this evening.

Here's the output:
An unhandled exception occurred at 0x08AD2593 :
EDivByZero : Division by zero
$08AD2593
$0896A4A4
$00080100
$18FF3635
An unhandled exception occurred at 0x004156DA :
EAccessViolation : Access violation
$004156DA
$00416B84
$0006FF44
$0896A4A4
$00080100
$24FF1C1B
An unhandled exception occurred at 0x004156DA :
EAccessViolation : Access violation
$004156DA
$00416B84
$0006FCD4
$00416B84
$0006FF44
$0896A4A4
$00080100
$24FF1C1B
An unhandled exception occurred at 0x004156DA :
EAccessViolation : Access violation
$004156DA
$00416B84
$0006FA64
$00416B84
$0006FCD4
$00416B84
$0006FF44
$0896A4A4
$00080100
$24FF1C1B