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 134682 - gedit needs to implement a workaround to deal with GtkTextView/Buffer inability to handle long lines
gedit needs to implement a workaround to deal with GtkTextView/Buffer inabili...
Status: RESOLVED OBSOLETE
Product: gedit
Classification: Applications
Component: general
2.4.x
Other All
: High major
: ---
Assigned To: Gedit maintainers
Gedit maintainers
: 143180 157049 318060 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-02-17 23:21 UTC by Keenan Pepper
Modified: 2012-12-28 17:17 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
gedit crashes on this image file generated with scanimage (160.24 KB, application/x-compressed-tar)
2012-12-28 17:17 UTC, ckoller
Details

Description Keenan Pepper 2004-02-17 23:21:47 UTC
Distribution: Fedora Core release 1 (Yarrow)
Package: gedit
Severity: critical
Version: GNOME2.4.0 2.4.x
Gnome-Distributor: GNOME.Org
Synopsis: gedit crashes trying to load file with huge lines
Bugzilla-Product: gedit
Bugzilla-Component: general
Bugzilla-Version: 2.4.x
BugBuddy-GnomeVersion: 2.0 (2.4.0.1)
Description:
Description of the crash:
I tried to open a file with a single line of about one hundred million
characters, and gedit hung for a few seconds and then crashed.

Steps to reproduce the crash:
1. Create a text file with a single huge line.
2. Try to open it in gedit.
3. 

Expected Results:
Either to open the file, or at least give some kind of error message
("This file contains lines that are too large.").

How often does this happen?
Every time

Additional Information:



Debugging Information:

Backtrace was generated from '/usr/bin/gedit'

(no debugging symbols found)...Using host libthread_db library
"/lib/libthread_db.so.1".
(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...[Thread debugging using libthread_db
enabled]
[New Thread 16384 (LWP 3682)]
(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...0x43c63008 in waitpid ()
   from /lib/i686/libpthread.so.0
  • #0 waitpid
    from /lib/i686/libpthread.so.0
  • #1 ??
    from /usr/lib/libgnomeui-2.so.0
  • #2 libgnomeui_module_info_get
    from /usr/lib/libgnomeui-2.so.0
  • #3 __pthread_sighandler
    from /lib/i686/libpthread.so.0
  • #4 <signal handler called>
  • #5 kill
    from /lib/i686/libc.so.6
  • #6 pthread_kill
    from /lib/i686/libpthread.so.0
  • #7 ??
  • #8 __JCR_LIST__
    from /lib/i686/libpthread.so.0
  • #9 ??
  • #10 ??
  • #11 ??
  • #12 raise
    from /lib/i686/libpthread.so.0




------- Bug moved to this database by unknown@bugzilla.gnome.org 2004-02-17 18:21 -------

Reassigning to the default owner of the component, paolo.maggi@polito.it.

Comment 1 Elijah Newren 2004-02-18 01:05:45 UTC
Thanks for the bug report. Unfortunately, that stack trace is not very
useful in determining the cause of the crash.  Please make sure that
the package was compiled with debugging symbols and see
http://bugzilla.gnome.org/getting-traces.cgi for more information
about useful stack traces.  Note that you can download debuginfo rpm
packages to install from
http://download.fedora.redhat.com/pub/fedora/linux/core/1/i386/debug/
Comment 2 Keenan Pepper 2004-02-18 05:05:28 UTC
I tried getting a better backtrace two different ways, and neither of
them seemed to produce much more useful results. First I downloaded
and installed the debuginfo rpm and recreated the crash. Here's the
output from bug-buddy:

Backtrace was generated from '/usr/bin/gedit'

Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 10627)]
0x43c63008 in waitpid () from /lib/i686/libpthread.so.0

Thread 16384 (LWP 10679)

  • #0 kill
    from /lib/i686/libc.so.6
The program is running.  Exit anyway? (y or n) y

It seems unusual that it tried to allocate 400000004 bytes of memory
because the file only contained 100000000 characters. This would
definitely be a problem because I only have 256M of RAM. Also seems
weird that first it said "No such process." but then "The program is
running.".

Any ideas on how I could get a better backtrace?
Comment 3 Paolo Maggi 2004-02-18 10:28:04 UTC
The problem is:

GLib-ERROR **: gmem.c:140: failed to allocate 400000004 bytes
aborting...

i.e. OUT OF MEMORY.

There is nothing we can do it.

BTW, as I already wrote in another bug report (don't ask me the number
:), gedit/GtkSourceView/GtkTextBuffer has grear problems when dealing
with files containing huge lines.
As the reported (and Owen a few time ago) suggested gedit should
probably refuse to open files with too large lines.

There are two kinds of problem here:

1. GtkTextBuffer/View should not crash when handling texts with huge
lines (
Comment 4 Theodore Randall 2004-02-19 19:49:16 UTC
I can reproduce by:
perl -e 'print "testing" x 99999' > test.txt
Open test.txt in gedit
Hasn't crashed yet but hangs 

Gedit should be able to handle large lines more gracefully than by
crashing/locking up.  Either with a message, or actually getting it to
display.
Changing status to new.  Adding GNOMEVER2.4, GNOMEVER2.5, bugsquad 
Comment 5 Theodore Randall 2004-02-19 20:10:10 UTC
actually did the above, ooops
Comment 6 Leonard den Ottolander 2004-02-29 17:07:52 UTC
I am seeing a similar thing with a 100K line (FYI the RH bugzilla
component list, ie a "real" file). No crash, but a hang in gedit when
trying to edit that file(/line). I am able to force quit gedit however.

I can edit the same file with kedit with no problem.
Comment 7 Bart Martens 2004-02-29 19:14:58 UTC
I see that Paolo's comment was cut off. Line too long? :-)

Theodore, I could open and close your test.txt file. However, contents
are printed garbled on one line. And when I try to move the text
cursor, gedit consumes about 98% of the cpu.

I also tried the file submitted at
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=117151 and
attached a gdb session. When I used pageup/pagedown over the long
line, and interrupted gdb a few times to print a backtrace with "bt",
then I saw that gedit is busy-busy-busy in these functions:

  • #0 _gtk_text_btree_get_tags
    from /usr/lib/libgtk-x11-2.0.so.0
  • #1 gtk_text_layout_validate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #2 gtk_text_layout_get_line_display
    from /usr/lib/libgtk-x11-2.0.so.0
  • #0 _gtk_text_line_byte_locate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #1 gtk_text_layout_draw
    from /usr/lib/libgtk-x11-2.0.so.0

At first sight this seems to match with the remark of Paolo on
GtkTextBuffer.

In another test, I tried the using the gedit menu, while alt-tabbing
to other windows. This made my X session hang. I didn't have the
patient to wait longer than a minute, so I ctrl-alt-F1'd to kill -9
gedit and gdb.

A short term solution could be to have gedit refuse files with long
lines, like Paolo already suggested.
Comment 8 Matthew Gatto 2004-05-16 20:44:15 UTC
Apparently the bug paolo was referring to is bug 127731.
Comment 9 Matthew Gatto 2004-05-16 20:54:59 UTC
Is this a dup of bug 127731?
Comment 10 Matthew Gatto 2004-05-16 20:55:46 UTC
oops, I meant, is this a dup of bug 114337?
Comment 11 Matthew Gatto 2004-05-16 20:59:47 UTC
I guess it's not a dup since what everybody seems to be saying is that gedit
needs to be temporarily patched to deal with Gtk-TextWidget's current inability
to handle long lines.
Comment 12 Paolo Maggi 2004-06-07 17:20:17 UTC
Sorry for the spam.
Changing the summary again.
Comment 13 Paolo Borelli 2004-07-16 21:51:08 UTC
*** Bug 143180 has been marked as a duplicate of this bug. ***
Comment 14 Federico Mena Quintero 2004-08-23 22:07:20 UTC
For reference, also see bug #73119.  This is the bug where Pango needs to
somehow deal with layouts wider than 32767 pixels.
Comment 15 Matthew Gatto 2004-11-02 01:49:33 UTC
*** Bug 157049 has been marked as a duplicate of this bug. ***
Comment 16 Alexander “weej” Jones 2005-11-21 20:18:21 UTC
Editing documents with long lines in gedit is an absolute nightmare. It doesn't
crash for me, but it's just really /really/ slow when you try to select the long
line and type anything.

This is a 20,000 column line. Turn on line wrapping and it works much better,
although programming is a bit odd like that.

Basically this comes from me viewing the source of an XHTML document that has no
white-space formatting.

Should I be harking on at GtkTextView/Buffer people, instead?
Comment 17 Paolo Borelli 2005-11-21 20:24:34 UTC
yes and no... yes in the sense that TextView is to 'blame', no in the sense that
it is a known and expected limitation of TextView design. see bug 114337 for details
Comment 18 Paolo Maggi 2006-01-07 11:24:29 UTC
*** Bug 318060 has been marked as a duplicate of this bug. ***
Comment 19 Loïc Minier 2006-05-26 17:49:58 UTC
This is Debian bug http://bugs.debian.org/360535.
Comment 20 Daniel Holbach 2006-08-02 10:14:51 UTC
Ubuntu bug about that: https://launchpad.net/distros/ubuntu/+source/gedit/+bug/37511
Comment 21 Mario Gonzalez 2010-08-07 03:42:44 UTC
I can confirm that this does not happens with gedit 2.30.3 IMO this bug should be closed. Can anyone change the status to OBSOLETE please?
Comment 22 Pratik Mandrekar 2011-05-15 19:45:46 UTC
It happens with me in gedit 2.30.3 on Ubuntu 10.10. Status needs to be revised to REOPENED.
Comment 23 Lars Peter Thomsen 2011-09-08 10:15:08 UTC
Also happens in gedit 2.30.4 on Ubuntu 11.04. Bug should be reopened.
Comment 24 erkki.rajakoski 2011-12-25 19:23:15 UTC
In gedit 3.2.3, If I search something in file that contains long lines the computer hangs. I'm using Ubuntu 11.10
Comment 25 ckoller 2012-12-28 17:17:03 UTC
Created attachment 232341 [details]
gedit crashes on this image file generated with scanimage

gedit 3.6.2 hangs also when opening files with long lines.
Example file: test.ppm obtained with scanimage.