Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70284 - less search doesn't work correct, when searching big files with very long lines 26k chars
Summary: less search doesn't work correct, when searching big files with very long lin...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-06 11:19 UTC by Hans-Christian Armingeon
Modified: 2005-06-17 19:56 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
packs file (packs,25.84 KB, text/plain)
2004-11-06 11:27 UTC, Hans-Christian Armingeon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Christian Armingeon 2004-11-06 11:19:41 UTC
Hi,

I am having a problem with less.

Steps to reproduce:

1. Download packs
2. less packs
3. search for a string in the end of the file, for example nagios.
4. scroll down until you see nagios is inverted on the screen
5. search again for nagios, now less finds the strin nagios

Any comments?
Can anybody reproduce this?

I know, it is insane to have a file with 26000 characters in a line, but less should handle this properly, I think.

sys-apps/less-382-r2

I hope, not wasting QA time,

Johnny

Reproducible: Always
Steps to Reproduce:




Portage 2.0.51-r2 (default-x86-2004.2, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.6.
8-gentoo-r4 i686)
=================================================================
System uname: 2.6.8-gentoo-r4 i686 AMD Opteron(tm) Processor 242
Gentoo Base System version 1.4.16
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [disabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
Headers:  sys-kernel/linux26-headers-2.6.8.1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-m32 -O3 -march=athlon-4 -mcpu=athlon-4 -fomit-frame-pointer -funroll-
loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /lib/modules /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config 
/usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.
3/shutdown /usr/kde/3/share/config /usr/lib/fax /usr/lib/mozilla/defaults/pref /
usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ 
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/
share/texmf/xdvi/ /var/bind /var/qmail/control /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-m32 -O3 -march=athlon-4 -mcpu=athlon-4 -fomit-frame-pointer -funroll-
loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg distlocks sandbox sfperms"
GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp.
uni-muenster.de/pub/linux/distributions/gentoo http://ftp-stud.fht-esslingen.de/
pub/Mirrors/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowex 3dnowext X X509 Xaw3d aac aalib accessibility accounting acl 
acpi activefilter adns afs aim alsa apache2 apm arts asterisk async atm 
audiofile authdaemond avi bcmath berkdb bidi bitmap-fonts blender-game bluetooth 
bmp bonobo bootsplash bzlib c++ calendar camaelon caps cddb cdparanoia cdr cgi 
chasen chroot clearpasswd codecs cpdflib crypt cscope ctype cups curl 
curlwrappers cyrus dbase dbm dbx dedicated devfs26 devmap dga dhcp dio directfb 
divx4linux djbfft drac dts dvd dvdr dvdread edl eds emacs encode esd ethereal 
evo exif f77 faad fam fastcgi fax fbcon fbdev fftw filepro flac flash flatfile 
flexresp flood fltk fluidsynth foomaticdb frascend freetds freetype frlargefiles 
frxp ftp gb gcj gd gd-external gdbm ggi gif gimpprint gmp gnokii gnome gnutls 
gphoto2 gpm gps graphviz gsm gsnd gstreamer gtk gtk2 gtkhtml guile hal howl 
iconv icq icu idea imagemagic imagemagick imap imlib imlib2 immqt immqt-bc inetd 
inifile innodb insecure-drivers intl ipalias ipv6 irda jabber jack jack-tmpfs 
java javascript jbig jce jikes jit jks jms joystick jpeg jpeg2k junit jython kde 
kerberos koffice-plugin krb4 ladcca latex lcd lcms ldap leim lesstif libcaca 
libg++ libgda libsamplerate libwww live lynxkeymap lzo lzw-tiff mad maildir 
maildrop mailwrapper matroska mbox mbrola mcal mcve md5sum mecab memlimit mhash 
mikmod mime ming mmap mmx mmx2 motif mozcalendar mozilla mozsvg mpeg mpeg4 mpi 
mppe-mppc msn multilib multitarget mysql mysql41 mythtv nagios-dns nagios-ntp 
nagios-ping nagios-ssh nas ncurses netcdf nethack network neural nis nls nntp 
nptl nptlonly oav objc odbc offensive oggvorbis opengl oscar oss pam pcap pcmcia 
pcntl pcre pcsc-lite pda pdflib perl pg-hier pg-intdatetime pg-vacuumdelay php 
pic plotutils png pnp portaudio posix postgres povray ppds prelude procmail pvm 
python qt quicktime radius readline real rhino rrdtool rtc ruby samba sasl 
scanner sdl serial session sftplogging shaper shared sharedmem silc simplexml 
skey slang slp smartcard smime sndfile snmp snortsam soap sockets socks5 
softquota soundtouch sox spamassassin speex spell spl sqlite sse ssl stats 
stencil-buffer subject-rewrite svg svga sysvipc szip tcltk tcpd tetex tga theora 
threads tidy tiff timidity tokenizer transcode transparent-proxy truetype 
unicode usb userlocales v4l v4l2 vda vhosts vim-with-x virus-scan vpopmail wddx 
wifi wmf wxwindows x86 xanim xfs xim xine xinerama xml xml2 xmlrpc xmms xosd xpm 
xprint xscreensaver xsl xv xvid xvmc yahoo yaz zlib"
Comment 1 Hans-Christian Armingeon 2004-11-06 11:27:44 UTC
Created attachment 43423 [details]
packs file
Comment 2 SpanKY gentoo-dev 2004-11-07 22:12:53 UTC
are you sure it's just not because less hasnt finished loading the file into memory ?

less only searches what has been loaded thus far into the memory buffer ...

try running less on the file, then wait until you're sure the whole thing is loaded (hold 'end' until the end of the file shows up), then hit 'home' and try searching
Comment 3 Hans-Christian Armingeon 2004-11-08 11:25:37 UTC
I scrolled down the whole document. Scrolles up, searched for windowmaker. Result: Pattern not found. Scrolled down, windowmaker has been inverted.

As I said, there is no newline in this document, only at the very end.

Johnny
Comment 4 Charles Levert 2005-06-17 19:41:00 UTC
This is known as "enhancement request 253" on the upstream

   <http://www.greenwoodsoftware.com/less/bugs.html>

web page.  The search works; it's only that it displays the first screen-row of
the folded file-line which contain the match(es).  To convince yourself of this,
insert 100 short file-lines containing just "asdf" before the single long
file-line in file "packs", insert the same after this long file-line, and repeat
your search, either forward or backward.  It will find the matching file-line.

We may want to fix this by having less move in turn (each time 'n' is pressed)
to each match that _begins_ on a new screen-row.  I have worked on some of the
less source code and may take a look at this, but no promises.  Fixing this may
be more involved than it appears, depending on how things are done internally.
Comment 5 SpanKY gentoo-dev 2005-06-17 19:56:05 UTC
ah, thanks for the info :)