[Lazarus] Gtk2 division by 0 in themes fix
almindor at gmail.com
Tue Jul 15 23:31:14 CEST 2008
Mattias Gaertner wrote / napísal(a):
> No. Damn.
> About 'before calling gtk':
> The bug is triggered in a gtk event. There is no pascal code *before*.
Indeed you do gtk_main() and the crash happens inside. There's no real
way of switching these only for the gtk lib apart from rewriting gtk
bindings AND all callbacks which is pretty much impossible to
synchronize the on/off of it.
>> 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.
Indeed, that's how it seemed. My example project which uses pure gtk2
got that, however the line in the themeengine.so which gdb showed me did
not have a /0 argument in it, so I think there's a some sort of "effect
Since I managed to bypass GtkAdjustment there's no risk of wrong record
padding etc. so this is defenetly not some sort of wrong sized arguments
or somesuch. I think it's basically a bug in gtk/humantheme engine.
More information about the Lazarus