[Lazarus] Gtk2 division by 0 in themes fix
nc-gaertnma at netcologne.de
Tue Jul 15 21:03:51 CEST 2008
On Tue, 15 Jul 2008 20:25:02 +0200
Vincent Snijders <vsnijders at quicknet.nl> wrote:
> Mattias Gaertner schreef:
> > On Tue, 15 Jul 2008 15:51:42 +0200
> > Ales Katona <almindor at gmail.com> wrote:
> >> I noticed you added a Set8087CW() to fix this problem, but it
> >> doesn't work for me, at least on amd64 with trackbar.
> >> I made a simple pure gtk+ C and pascal 1:1 program to test this
> >> and found out that setting $1332 or $133f doesn't help at all.
> >> Setting via math unit (SetExceptionMask(GetExceptionMask +
> >> exZeroDivide) however does fix it. It's good enough to do this
> >> around gtk_main() too it seems (for the trackbar at least).
> >> I think the best thing to do here is to use the Math unit functions
> >> and Set/Unset the exZeroDivide mask before/after gtk_main.
> >> Again, the Set8087CW change didn't fix it on amd64/gtk2 (and
> >> possibly introduced various issues for math users).
> > Thanks for the hint.
> > Changed in 15785.
> Does ut turn of exception for divide by zero completely or just
> before calling gtk code? IOW, does the following code in a
> TButton.OnClick event handler show the message?
About 'before calling gtk':
The bug is triggered in a gtk event. There is no pascal code *before*.
> If not, it might be
> worth to add this the list of 'incompatibilities'.
> procedure TForm1.Button1Click(Sender: TObject);
> var x, y, z: single;
> x := 3.0; y := 1.0;
> z := (x - y ) / (y - 1.0);
> ShowMessage('Exception occurred');
Apparently there is a real div by zero error.
More information about the Lazarus