After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 386099 - dasher crashes with divide by zero error
dasher crashes with divide by zero error
Status: RESOLVED FIXED
Product: dasher
Classification: Applications
Component: core
unspecified
Other opensolaris
: Normal normal
: ---
Assigned To: Phil Cowans
Phil Cowans
Depends on:
Blocks:
 
 
Reported: 2006-12-15 05:02 UTC by Brian Cameron
Modified: 2006-12-17 12:04 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
patch to fix problem (818 bytes, patch)
2006-12-15 05:02 UTC, Brian Cameron
none Details | Review

Description Brian Cameron 2006-12-15 05:02:07 UTC
On Solaris, dasher core dumps with a divide by zero error.  I'm attaching a patch that fixes this problem so dasher works okay on Solaris.
Comment 1 Brian Cameron 2006-12-15 05:02:39 UTC
Created attachment 78414 [details] [review]
patch to fix problem
Comment 2 Brian Cameron 2006-12-15 05:09:27 UTC
Not sure that defaulting y to 0 if Yscale is 0 is the right solution here, but it
at least makes the code work okay.  If more research is needed (e.g. if Yscale should never be 0), then let me know.
Comment 3 ville 2006-12-15 17:42:54 UTC
Same thing happens on ubuntu feisty.
Comment 4 Brian Cameron 2006-12-15 18:50:07 UTC
Oops, note the patch call GetLongParameter(LP_YSCALE) twice (once when setting lp_yscale and again in th else).  Probably better to just re-use lp_ypscale variable in the else since we already read the value into the static variable.  I won't reattach an updated patch since this is easy enough to fix.  Also, I suspect that the "correct" way to fix this problem might be to default y to something else since dividing by a small number makes a big number, not a number close to 0.  So not sure what the default value should be when LP_YSCALE is 0, but should add some code to protect against divide by zero here, obviously.

So I suspect this patch probably needs a bit of work by someone who understands what the code actually is doing.
Comment 5 Damir Perisa 2006-12-17 01:57:10 UTC
Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread -1226971440 (LWP 5195)]
0x0807c325 in CDasherControl::TimerEvent ()

i can reproduce this under archlinux being dasher pkgmaintainer in arch and trying to upgrade from 4.2.0 -> 4.3.2
Comment 6 Phil Cowans 2006-12-17 12:04:38 UTC
Thanks for the patches - it's fixed now in CVS, and I'll be releasing tomorrow.