#360535 gedit performs very slowly, hogs a ton of memory, and crashes on large datasets without newlines

Package:
gedit
Source:
gedit
Description:
popular text editor for the GNOME desktop environment
Submitter:
Michael Gilbert
Date:
2013-11-08 15:27:05 UTC
Severity:
normal
#360535#5
Date:
2006-04-03 01:33:39 UTC
From:
To:
if the contents of a file are a long datalist that does not consist of
newlines, gedit will perform very slowly, hog a bunch of ram, then crash.

the following code (which computes the largest known prime and outputs
that number to stdout; http://fabrice.bellard.free.fr/mersenne.html)
is a demonstror of this bug.  the output causes gedit to
practically grind to a halt.  the problem arises because the output
contains no newlines.  the computation itself only takes about 3 minutes
on my 1.6 GHz processor:

#!/bin/bash

echo '''#include <stdio.h>
int m=754974721,N,t[1<<24],a,*p,i,e=30611555,j,s,c,U;f(d){for(s=1<<24;s/=2;d=d*
1LL*d%m)if(s<N)for(p=t;p<t+N;p+=s)for(i=s,c=1;i;i--)a=*p+p[s],p[s]=(m+*p-p[s])*1LL
*c%m,*p++=a%m,c=c*1LL*d%m;for(j=0;i<N-1;){for(s=N/2;!((j^=s)&s);s/=2);if(++i<j)
a=t[i],t[i]=t[j],t[j]=a;}}main(){*t=2;U=N=1;while(e/=2){N*=2;U=U*1LL*(m+1)/2%m;f
(362);for(p=t;p<t+N;p++)*p=*p*1LL**p%m*U%m;f(415027540);for(a=0,p=t;p<t+N;)a+=*p
<<(e&1),*p++=a%10,a/=10;}while(!*--p);t[0]--;while(p>=t)printf("%d",*p--);}''' > largest-known-prime.c

gcc -o largest-known-prime largest-known-prime.c
../largest-known-prime > out
gedit out

#360535#10
Date:
2006-05-26 17:51:21 UTC
From:
To:
forwarded 360535 http://bugzilla.gnome.org/show_bug.cgi?id=134682
tags 360535 + confirmed upstream
stop

        Hi,

 Thanks for your report, this particular bug has already been reported
 upstream.

   Bye,

#360535#23
Date:
2013-11-08 15:23:10 UTC
From:
To:
I confirm this bug, despite
https://bugzilla.gnome.org/show_bug.cgi?id=134682 is closed already.

although gedit will never support handling very long lines.

Regards
Debian Release: jessie/sid
  500 unstable        ftp.nl.debian.org
  500 stable          dl.google.com
    1 experimental    ftp.nl.debian.org
--- Package information. ---
Depends                           (Version) | Installed
===========================================-+-==============
python3:any                   (>= 3.3.2-2~) |
libatk1.0-0                     (>= 1.12.4) | 2.10.0-2
libc6                             (>= 2.14) |
libcairo-gobject2               (>= 1.10.0) |
libcairo2                        (>= 1.2.4) |
libenchant1c2a                   (>= 1.6.0) |
libgdk-pixbuf2.0-0              (>= 2.22.0) |
libgirepository-1.0-1            (>= 0.9.3) |
libglib2.0-0                    (>= 2.37.5) |
libgtk-3-0                      (>= 3.9.10) |
libgtksourceview-3.0-1          (>= 3.10.1) |
libpango-1.0-0                  (>= 1.14.0) |
libpangocairo-1.0-0             (>= 1.14.0) |
libpeas-1.0-0                    (>= 1.1.0) |
libx11-6                                    |
libxml2                          (>= 2.7.4) |
gedit-common                      (>= 3.10) |
gedit-common                      (<< 3.11) |
gnome-icon-theme-symbolic                   |
gsettings-desktop-schemas                   |
python3-gi                         (>= 3.0) |
python-gi-cairo                    (>= 3.0) |
gir1.2-peas-1.0                             |
iso-codes                                   |


Recommends      (Version) | Installed
=========================-+-===========
zenity                    | 3.8.0-1
yelp                      | 3.10.1-1


Suggests           (Version) | Installed
============================-+-===========
gedit-plugins                |
--- Output from package bug script --- /usr/bin/xterm: cannot load font '-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1' Active plugins: - 'docinfo' - 'spell' - 'modelines' - 'filebrowser' - 'time' No plugin installed in $HOME. Module versions: - glib 2.38.1 - gtk+ - gtksourceview - pygobject - enchant - iso-codes 3.48