Bug 1067349

Summary: [PATCH, WTF] gcalctool does not convert between number bases
Product: Red Hat Enterprise Linux 7 Reporter: Lubomir Rintel <lkundrak>
Component: gnome-calculatorAssignee: Alexander Larsson <alexl>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 7.0CC: lersek, lmiksik, mclasen, msimon, vbenes
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 07:23:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lubomir Rintel 2014-02-20 10:07:52 UTC
Description of problem:

$subj


Version-Release number of selected component (if applicable):

gnome-calculator-3.8.2-1.el7.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Switch to Binary
2. Type 10000
3. Press Enter
4. Switch to Decimal

Actual results:

(gnome-calculator:29882): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators

(gnome-calculator:29882): Gtk-CRITICAL **: gtk_text_buffer_insert_with_tags: assertion `gtk_text_iter_get_buffer (iter) == buffer' failed


Expected results:

16

Additional info:

I've bisected the git history to find a fix. I've verified it to work: https://git.gnome.org/browse/gnome-calculator/commit/?id=11cf691

I'm glad upstream rewritten the calculator in Vala, but I've encountered some really scary bugs (and bitterly funny) in the Git log. I strongly suggest you take a look at it too and pick the most serious ones into RHEL. See for yourself: https://git.gnome.org/browse/gnome-calculator/commit/?id=917fafcb0

By the new calculator is ridiculously difficult to use. A drop down to select a numeric base? Seriously? Could it be a radio button box again? :/

Comment 2 Lubomir Rintel 2014-02-20 10:17:44 UTC
In all seriousness:

~♥ echo '1 + 2 - 3 * 4 / 5' |bc
1
~♥ echo '1 + 2 - 3 * 4 / 5' |gcalccmd
> 0.6

** (process:31108): CRITICAL **: string_strip: assertion `self != NULL' failed
> ~♥

Comment 3 Lubomir Rintel 2014-02-20 10:23:33 UTC
Oh, ignore me. It's just bc not using floats.

Comment 4 RHEL Program Management 2014-03-22 05:59:22 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 5 Laszlo Ersek 2014-03-31 09:03:33 UTC
Extremely annoying bug, please fix.

See also
<https://bugs.launchpad.net/ubuntu/+source/gnome-calculator/+bug/1166654>.

Comment 7 Vladimir Benes 2015-05-06 14:21:37 UTC
It's fixed in 3.14.

Comment 9 Martin Simon 2015-09-02 09:53:58 UTC
I've re-tested this bug in gnome-calculator-3.14.1-2.el7.x86_64. According to comment 7 and my results, I assume the bug is fixed. The conversions among number bases are working just fine.

The reproducer has been incorporated into our gnome-calculator test plan.

Comment 10 errata-xmlrpc 2015-11-19 07:23:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2215.html