[Bug 1745188] Re: gnome-calculator crashed with SIGABRT in mpfr_assert_fail → mpfr_init2 → mpc_init3 → mpc_pow_usi_naive → mpc_pow_usi
Raghavan Santhanam
1745188 at bugs.launchpad.net
Tue Feb 20 10:45:17 UTC 2018
<< reposting my previous comment in the aligned format as there seems to
be no option to edit it >>
Hello,
I encountered this abort/crash with gnome-calculator and finally got rid
of it as under.
I manually built and installed the latest mpfr/mpfc/gmp source code and
binaries for building gcc-7.3 which turned out to be extremely
frustrating and energy-draining. So, after installing those hand-built
mpfr/mpfc/gmp binaries, I happened to launch the calculator(gnome-
calculator) from the quick launch side-bar(yes, I still have Unity on
17.10!) and its icon was animating as usual for few seconds and nothing
was happening after that. So, I tried to launch it from terminal - it
showed the abort/crash error that this bug reports :
"../../src/init2.c:52: MPFR assertion failed: p >= 2 && p <= ((mpfr_prec_t)((mpfr_uprec_t)(~(mpfr_uprec_t)0)>>1))".
After searching for the above error, I stumbled upon this bug report, and
I tried to downgrade back to the default Ubuntu-repo version via "apt
install" - that didn't solve the issue. I tried to build and install
mpfr-4.0.0 version - didn't change the crash behavior.
Tried building and installing mpfr-3.1.6/5 - didn't work. Manually
removed the installed libraries(libmpfr*) from /usr/lib/* and /usr/local
/lib/* and redid the installation - both "apt install" and build-install
method from source for the reported mpfr-3.1.6 - didn't help. I had also
tried to modify mpfr-4.0.1's source code to use precision 2 instead of 1
and also bunch of the other assert-macros logic for disabling the
assertion(abort) - didn't help.
Downgraded mpc* as well as gmp* to older versions by building from their
sources and installing them - didn't help.
So, basically, I tried to put my system back to the previous state before
I started meddling with the mpfr/gmp/mpc all for building gcc-7.3 from
its source - huge cost paid!
Tried the extreme cases out though not relevant as I could already figure
out but did them anyway to get back the "calculator" : reinstalled the
kernel(I know kernel has nothing to do with mpfr!), rebooted the PC, and
so on - didn't help.
Finally, I paid close attention to the error stating that this assertion
was from "init2.c:52", so I located this 52nd source code line inside
mpfr-3.1.6/src/init2.c and *disabled* the assertion by commenting it out
as my last attempt to get back the system to successfully launch gnome
-calculator, rebuilt and installed it - boom! I got the gnome-calculator
back.
Below is what I commented out. I thought this was not necessary as
MPFR_PREC_MIN was already 2 and not 1 as mentioned here in this proposed
bug report/fix. Anyway.
<snip>
/* p=1 is not allowed since the rounding to nearest even rule requires at
least two bits of mantissa: the neighbours of 3/2 are 1*2^0 and 1*2^1,
which both have an odd mantissa */
//MPFR_ASSERTN(p >= MPFR_PREC_MIN && p <= MPFR_PREC_MAX);
</snip>
I confirmed that MPFR_PREC_MIN was 2 as told in here in this bug report
and not 1 as in 4.0.1. But, even then the above assertion was failing
causing abort/crash for gnome-calculator. Below is what I have in
mpfr-3.1.6/src/mpfr.h(unchanged).
<snip>
/* Definition of precision limits without needing <limits.h> */
/* Note: the casts allows the expression to yield the wanted behavior
for _MPFR_PREC_FORMAT == 1 (due to integer promotion rules). */
#define MPFR_PREC_MIN 2
#define MPFR_PREC_MAX ((mpfr_prec_t)((mpfr_uprec_t)(~(mpfr_uprec_t)0)>>1))
</snip>
Hope my above change help those banging their head to fix this super
-annoying crash, until it's fixed in the mpfr* codebase/release as needed.
Cheers,
Raghavan
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to mpclib3 in Ubuntu.
https://bugs.launchpad.net/bugs/1745188
Title:
gnome-calculator crashed with SIGABRT in mpfr_assert_fail → mpfr_init2
→ mpc_init3 → mpc_pow_usi_naive → mpc_pow_usi
Status in gnome-calculator package in Ubuntu:
Triaged
Status in mpclib3 package in Ubuntu:
Triaged
Bug description:
I cannot launch gnome-calculator because of the following:
```
../../src/init2.c:52: MPFR assertion failed: p >= 2 && p <= ((mpfr_prec_t)((mpfr_uprec_t)(~(mpfr_uprec_t)0)>>1))
Aborted (core dumped)
```
errors.u.c:
https://errors.ubuntu.com/problem/40a6712b7f663d518c85d34a30891ff7629f9041
ProblemType: Crash
DistroRelease: Ubuntu 18.04
Package: gnome-calculator 1:3.26.0-0ubuntu1
ProcVersionSignature: Ubuntu 4.14.0-13.15-generic 4.14.7
Uname: Linux 4.14.0-13-generic x86_64
ApportVersion: 2.20.8-0ubuntu6
Architecture: amd64
CurrentDesktop: GNOME
Date: Wed Jan 24 19:13:49 2018
ExecutablePath: /usr/bin/gnome-calculator
InstallationDate: Installed on 2017-08-21 (156 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170820)
ProcCmdline: gnome-calculator
Signal: 6
SourcePackage: gnome-calculator
StacktraceTop:
mpfr_assert_fail () at /usr/lib/x86_64-linux-gnu/libmpfr.so.4
mpfr_init2 () at /usr/lib/x86_64-linux-gnu/libmpfr.so.4
() at /usr/lib/x86_64-linux-gnu/libmpc.so.3
mpc_pow_usi () at /usr/lib/x86_64-linux-gnu/libmpc.so.3
number_xpowy_integer () at /usr/lib/x86_64-linux-gnu/gnome-calculator/libcalculator.so
Title: gnome-calculator crashed with SIGABRT in mpfr_assert_fail()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-calculator/+bug/1745188/+subscriptions
More information about the foundations-bugs
mailing list