| Summary: | crash on large result, "exp" operation | ||
|---|---|---|---|
| Product: | [Applications] kcalc | Reporter: | Ernst Bachmann <ebachmann> |
| Component: | general | Assignee: | Klaus Niederkrüger <kniederk> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Suggested fix | ||
|
Description
Ernst Bachmann
2006-09-14 16:20:05 UTC
Confirmed. Different backtrace though:
#12 0x29460b6c in sigaction () from /usr/lib/libpthread.so.2
#13 0x2952db23 in abort () from /lib/libc.so.6
#14 0x2984dc2f in __gmp_invalid_operation () from /usr/local/lib/libgmp.so.7
#15 0x2984f513 in __gmpf_set_d () from /usr/local/lib/libgmp.so.7
#16 0x2983b28a in _knumfloat (this=0x8245fb8, num=inf) at knumber_priv.h:270
#17 0x298382ea in KNumber (this=0xbfbfdb80, num=inf)
at /home/phil/kdesrc/kdeutils/kcalc/knumber/knumber.cpp:72
#18 0x29824630 in CalcEngine::Exp (this=0x8168c88, input=
{static Zero = {static Zero = <same as static member of an already seen type>, static One = {static Zero = <same as static member of an already seen type>, static One = <same as static member of an already seen type>, static MinusOne = {static Zero = <same as static member of an already seen type>, static One = <same as static member of an already seen type>, static MinusOne = <same as static member of an already seen type>, static Pi = {static Zero = <same as static member of an already seen type>, static One = <same as static member of an already seen type>, static MinusOne = <same as static member of an already seen type>, static Pi = <same as static member of an already seen type>, static Euler = {static Zero = <same as static member of an already seen type>, static One = <same as static member of an already seen type>, static MinusOne = <same as static member of an already seen type>, static Pi = <same as static member of an already seen type>, static Euler = <same as static member of an already seen type>, _num = 0x80e3a38, static _float_output = true, static _fraction_input = true, static _splitoffinteger_output = false}, _num = 0x80d0938, static _float_output = true, static _fraction_input = true, static _splitoffinteger_output = false}, static Euler = <same as static member of an already seen type>, _num = 0x80d4fe0, static _float_output = true, static _fraction_input = true, static _splitoffinteger_output = false}, static Pi = <same as static member of an already seen type>, static Euler = <same as static member of an already seen type>, _num = 0x80d0e18, static _float_output = true, static _fraction_input = true, static _splitoffinteger_output = false}, static MinusOne = <same as static member of an already seen type>, static Pi = <same as static member of an already seen type>, static Euler = <same as static member of an already seen type>, _num = 0x80d0b68, static _float_output = true, static _fraction_input = true, static _splitoffinteger_output = false}, static One = <same as static member of an already seen type>, static MinusOne = <same as static member of an already seen type>, static Pi = <same as static member of an already seen type>, static Euler = <same as static member of an already seen type>, _num = 0x82385b0, static _float_output = true, static _fraction_input = true, static _splitoffinteger_output = false}) at /home/phil/kdesrc/kdeutils/kcalc/kcalc_core.cpp:574
#19 0x298168b3 in KCalculator::slotLnclicked (this=0x8168a18)
at /home/phil/kdesrc/kdeutils/kcalc/kcalc.cpp:1517
#20 0x2981a6a9 in KCalculator::qt_invoke (this=0x8168a18, _id=99,
_o=0xbfbfdcc0) at kcalc.moc:333
#21 0x28e141e0 in QObject::activate_signal ()
from /usr/X11R6/lib/libqt-mt.so.3
Well, besides the differences caused by 64bit/32bit arch, different library versions, and my version coming from a strip'ed binary, they look quite similar to me. Basically it looks like libgmp is trying to calculate the result, gets an overflow, and raises a SIGFPE signal, which isn't handled. Ah yes, good point. Should've looked more carefully Created attachment 17816 [details]
Suggested fix
Change the KNumber initialization to check for NaN and Inf, since passing these
to libgmp causes a crash. Does this also need to be done for other types?
Good idea (the patch). I try to apply this as soon as I have time. Klaus Applied your patch. Thanks a lot Klaus |