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 494776 - text file with html causes lockeup
text file with html causes lockeup
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.12.x
Other All
: High critical
: ---
Assigned To: Yevgen Muntyan
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2007-11-07 21:57 UTC by Steven Wagner
Modified: 2007-11-14 17:56 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
this is the file that causes the crash (3.11 KB, text/html)
2007-11-07 21:57 UTC, Steven Wagner
  Details
patch (3.64 KB, patch)
2007-11-11 18:05 UTC, Yevgen Muntyan
accepted-commit_now Details | Review

Description Steven Wagner 2007-11-07 21:57:09 UTC
Steps to reproduce:
right click on .html file and select "Open with Text Editor". Ubuntu Gutsy.

Stack trace:


Other information:
No clear instructions in place for how to do a stack this on Ubuntu Gutsy. http://live.gnome.org/GettingTraces
Comment 1 Steven Wagner 2007-11-07 21:57:38 UTC
Created attachment 98741 [details]
this is the file that causes the crash
Comment 2 Steven Wagner 2007-11-10 22:16:59 UTC
When creating a text file from the attached file, the file must be named with a .html extension. Also, its a lockup, not a crash. I assume this is caused by the html syntax highlighting. Possibly due to how the code is all on one line with no carriage returns. Modifying of the text while the window is open causes the syntax highlighting to be recalculated, and again an apparent lockup. Window responds again after about 10 seconds, and my machine is fast. Also, this file is fairly short.
Comment 3 Yevgen Muntyan 2007-11-11 18:05:23 UTC
Created attachment 98923 [details] [review]
patch

The problem here is that GtkSourceView calls bunch of gtk_text_buffer_apply_tag() in a row, and each call in turn leads to gtk_text_view_update_im_spot_location() call, which is very expensive since it recaculates the line cache.
Attached patch moves gtk_text_view_update_im_spot_location() into an idle, as suggested by Owen.
Comment 4 Owen Taylor 2007-11-11 18:06:34 UTC
Comment on attachment 98923 [details] [review]
patch

Please commit
Comment 5 Yevgen Muntyan 2007-11-11 19:11:14 UTC
2007-11-11  Yevgen Muntyan  <muntyan@tamu.edu>

	* gtk/gtktextview.c: Moved gtk_text_view_update_im_spot_location()
	calls into an idle, fixes #494776.
	GtkTextViewPrivate:im_spot_idle, do_update_im_spot_location(),
	queue_update_im_spot_location(), flush_update_im_spot_location(): new
	field and functions to queue the call;
	(changed_handler): call queue_update_im_spot_location() instead of
	gtk_text_view_update_im_spot_location();
	(gtk_text_view_key_press_event): flush the idle here.
Comment 6 Steven Wagner 2007-11-14 17:51:10 UTC
It seems this bug effects any html file that has long lines which lack carriage returns. Does this effect other syntax highlights besides html?
Comment 7 Yevgen Muntyan 2007-11-14 17:56:35 UTC
Yes, any syntax highlighting. If a line is long and has lot of highlighted things (like html - lots of tags and attributes and whatnot), then you get the problem.