SRU: sin(0)/sin(0) crash the the calculator

Bug #1622379 reported by Cledersonbc on 2016-09-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNOME Calculator
Fix Released
gnome-calculator (Ubuntu)
Martin Wimpress

Bug Description


It is possible to cause gnome-calcualtor segfault when elements of division to zero have null assigned tokens. For example, the following calculation will trigger a segfault:


[Test Case]

Open a terminal with CTRL+ALT+t and launch 'gnome-calculator'. Type the following into the equation entry area 'sin(0)/sin(0)' and press enter, gnome-calculator will segfault.

When the patched 'gnome-calculator' package is installed performing the same calculation described above will not cause 'gnome-calculator' to crash and instead the following will be displayed: Division by zero is undefined

A debdiff for Xenial is attached in comment #2:


[Regression Potential]

None expected. The applied patch is taken directly from the following upstream commit:


gnome-calculator packages have been built in a PPA and tested.

[Other Info]

dw3@linux:~$ gnome-calculator

(gnome-calculator:29011): GLib-CRITICAL **: g_str_has_prefix: assertion 'str != NULL' failed

(gnome-calculator:29011): GLib-CRITICAL **: g_str_has_prefix: assertion 'str != NULL' failed
Segmentation fault (core dumped)

sin(0)/sin(0) = NaN, but it crash the calculator

Sebastien Bacher (seb128) wrote :

Thanks, it looks like which was fixed upstream with that commit

it's probably worth a SRU to xenial as well if somebody wants to do that

Changed in gnome-calculator (Ubuntu):
importance: Undecided → High
status: New → Fix Committed
tags: added: rls-x-incoming
Changed in gnome-calculator:
importance: Unknown → Medium
status: Unknown → Fix Released
Changed in gnome-calculator (Ubuntu Xenial):
assignee: nobody → Martin Wimpress (flexiondotorg)
status: New → In Progress
Martin Wimpress (flexiondotorg) wrote :

Attached is a debdiff for gnome-calculator (Xenial) that prevents a segfault when elements of division to zero have null assigned tokens.

Martin Wimpress (flexiondotorg) wrote :

This issue was fixed in Yakkety with the upload of gnome-calculator (1:3.22.0-1ubuntu1).

gnome-calculator (1:3.22.0-1ubuntu1) yakkety; urgency=medium

  * Merge with Debian. Remaining changes:
    - Add epoch
    - debian/patches/git_no_headerbars_in_unity.patch:
      + Don't use HeaderBars in Unity

gnome-calculator (3.22.0-1) unstable; urgency=medium

description: updated
Changed in gnome-calculator (Ubuntu):
status: Fix Committed → Fix Released
summary: - sin(0)/sin(0) crash the the calculator
+ SRU: sin(0)/sin(0) crash the the calculator
Changed in gnome-calculator (Ubuntu Xenial):
importance: Undecided → High
description: updated
Iain Lane (laney) wrote :

I uploaded - thanks!

Hello Cledersonbc, or anyone else affected,

Accepted gnome-calculator into xenial-proposed. The package will build now and be available at in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at . Thank you in advance!

Changed in gnome-calculator (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Robert Ancell (robert-ancell) wrote :

Confirmed fixed in xenial.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-calculator - 1:3.18.3-0ubuntu1.16.04.1

gnome-calculator (1:3.18.3-0ubuntu1.16.04.1) xenial; urgency=medium

  * debian/patches/lp1622379-prevent-segfault.patch. (LP: #1622379)
    - Prevents segfault when elements of division to zero have null
      assigned tokens.

 -- Martin Wimpress <email address hidden> Fri, 30 Sep 2016 15:10:10 +0100

Changed in gnome-calculator (Ubuntu Xenial):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for gnome-calculator has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.