From: R. L. <la...@us...> - 2002-01-17 10:58:13
|
Mikael Borg wrote: > > I have been able to track down the the problem: it is when calling > gtk_viewport_get_hadjustment, in sg_plot.c:1253: Line 1235, that is :). > adj=gtk_viewport_get_hadjustment (GTK_VIEWPORT(plot->sw)); > > A few lines later: > start=adj->value/adj->upper*fac; > > But adj->upper == 0, so the program dies with a floating point exception. Confirmed. It's a bug, which is not only in 0.8, but also in CVS. For example: start SG, do Help->SG Examples->3d The following values are in sg_plot.c:update_ruler_expose_x() p_size = 583.40919599999995 s_width = 1 fac = 8.5 adj = {data = {object = {klass = 0x84ad380, flags = 12, ref_count = 2, object_data = 0x845f778}}, lower = 0, upper = 0, value = 0, step_increment = 0, page_increment = 0, page_size = 0} And thus adj->upper as zero is used in the denominator at line 1248/1249, letting the value of the variables "start" and "end" explode! gtk_ruler_set_range() then gets these "NaN" values as parameters! Same problem occurs in sg_plot.c:update_ruler_expose_y(). In fact I wonder if this miscalculation in sg_plot.c:update_ruler_expose_x/y() always happens ? The problem is that not all systems segfault on devision by zero; in my case it happily continues with a value of "NaN" (I wonder whether I can change that behaviour). Anyone has an idea how to tackle this bug? Regards, Rob. |