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 737291 - Crash when thousands separators are enabled
Crash when thousands separators are enabled
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
3.14.x
Other Linux
: Normal critical
: ---
Assigned To: gcalctool maintainers
gcalctool maintainers
3.14.1
: 682971 739811 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-09-24 19:59 UTC by Michael Catanzaro
Modified: 2014-12-23 04:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix invalid GtkTextIter after inserting thousands separator (1.47 KB, patch)
2014-10-23 03:49 UTC, Michael Catanzaro
committed Details | Review

Description Michael Catanzaro 2014-09-24 19:59:25 UTC
* Enable thousands separators in preferences
* Type a long number
* See a bunch of warnings repeated a bajillion times
* It will crash after a couple seconds

(gnome-calculator:27188): 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:27188): Gtk-CRITICAL **: gtk_text_buffer_set_mark: assertion 'gtk_text_iter_get_buffer (iter) == buffer' failed

(gnome-calculator:27188): GLib-GObject-CRITICAL **: g_object_ref: assertion 'G_IS_OBJECT (object)' failed

(gnome-calculator:27188): GtkSourceView-WARNING **: Completion context without mark

  • #0 _gtk_text_btree_get_chars_changed_stamp
    at gtktextbtree.c line 543
  • #1 gtk_text_iter_make_surreal
    at gtktextiter.c line 173
  • #2 gtk_text_iter_get_buffer
    at gtktextiter.c line 394
  • #3 function_completion_provider_real_populate
    at math-display.c line 2105
  • #4 update_completion
    at gtksourcecompletion.c line 1380
  • #5 auto_completion_final
    at gtksourcecompletion.c line 1398
  • #6 g_timeout_dispatch
    at gmain.c line 4520
  • #7 g_main_dispatch
    at gmain.c line 3111
  • #8 g_main_context_dispatch
    at gmain.c line 3710
  • #9 g_main_context_iterate
    at gmain.c line 3781
  • #10 g_main_context_iteration
    at gmain.c line 3842
  • #11 g_application_run
    at gapplication.c line 2282
  • #12 calculator_main
    at gnome-calculator.c line 1239
  • #13 __libc_start_main
  • #14 _start

Comment 1 PioneerAxon 2014-09-27 07:32:30 UTC
Hi,

I can reproduce the warnings. However I'm unable to get it to crash.
I'll try to use the trace provided, to figure out what's wrong.

Thank you. :)
Comment 2 PioneerAxon 2014-09-27 13:58:49 UTC
Hi,

I upgraded the entire system to 3.14, and now I have the same issue.
It seems that some change between GTK-3.12 and GTK-3.14 caused this issue.

I don't have a system running 3.12, where I can test this. Can you check if it's true?

Thanks.. :)
Comment 3 Michael Catanzaro 2014-09-27 19:42:43 UTC
It's probably due to a change in either GtkSourceView or GTK+. I bet it won't crash if we fix the invalid iterator problem.
Comment 4 elita astrid angelina lobo 2014-10-04 21:34:00 UTC
I figured out that the following two lines in create_autocompletion function results in the crash. When separators are inserted in the equation, the iterator somehow becomes invalid due to modified equation and hence the crash. 

completion.add_provider (new FunctionCompletionProvider ());
completion.add_provider (new VariableCompletionProvider (equation));

I am currently working on fixing this bug. Probably would find a solution for this soon enough.
Comment 5 Matthias Clasen 2014-10-10 16:16:01 UTC
Any update ? this would be fantastic to have fixed in 3.14.1.
Just typing "1," into the calculator and having it crash is not great :-(
Comment 6 Michael Catanzaro 2014-10-23 03:49:58 UTC
Created attachment 289186 [details] [review]
Fix invalid GtkTextIter after inserting thousands separator

So, I actually can't reproduce the crash anymore, I guess due to a change in GTK+ or maybe GtkSourceView. This patch fixes the warning and criticals. If anyone is still getting the crash, please reopen.
Comment 7 Michael Catanzaro 2014-10-23 03:50:20 UTC
Attachment 289186 [details] pushed as 0d838a7 - Fix invalid GtkTextIter after inserting thousands separator
Comment 8 Michael Catanzaro 2014-11-10 00:49:09 UTC
*** Bug 739811 has been marked as a duplicate of this bug. ***
Comment 9 Michael Catanzaro 2014-12-23 04:18:43 UTC
*** Bug 682971 has been marked as a duplicate of this bug. ***