[Toybox] Editors and such.

David Seikel onefang at gmail.com
Wed Sep 5 23:40:03 PDT 2012


On Thu, 6 Sep 2012 14:11:09 +1000 David Seikel <onefang at gmail.com>
wrote:

> On Thu, 6 Sep 2012 11:56:17 +0800 Roy Tam <roytam at gmail.com> wrote:
> 
> > 2012/9/6 David Seikel <onefang at gmail.com>:
> > >> Program received signal SIGSEGV, Segmentation fault.
> > >> formatLine (view=0x8069168, input=0x0, output=0x806919c)
> > >>     at toys/other/boxes.c:843
> > >> 843        int len = strlen(input), i = 0, o = 0;
> > >> (gdb) bt
> > >> #0  formatLine (view=0x8069168, input=0x0, output=0x806919c)
> > >>     at toys/other/boxes.c:843
> > >> #1  0x0804f1dd in moveCursorAbsolute (view=0x8069168, cX=0,
> > >> cY=10, sX=0, sY=0) at toys/other/boxes.c:951
> > >> #2  0x0804f367 in moveCursorRelative (view=0x8069168, cX=0,
> > >> cY=10, sX=0, sY=0) at toys/other/boxes.c:1011
> > >> #3  0x0804f479 in upLine (view=0x8069168, event=0x0) at
> > >> toys/other/boxes.c:1442 #4  0x0804fb63 in handleKey
> > >> (view=0x8069168, i=2, keyName=<optimized out>, buffer=0xbffffad8
> > >> "\033[A") at toys/other/boxes.c:1593 #5  0x0805008d in editLine
> > >> (view=0x8069168, X=-1, Y=-1, W=-1, H=-1) at
> > >> toys/other/boxes.c:1785 #6  0x08050288 in boxes_main () at
> > >> toys/other/boxes.c:2482 #7  0x0804b262 in toy_exec
> > >> (argv=0xbffffd58) at main.c:104 #8  0x0804b29d in toybox_main ()
> > >> at main.c:118 #9  0x0804b262 in toy_exec (argv=0xbffffd54) at
> > >> main.c:104 #10 0x0804b29d in toybox_main () at main.c:118
> > >> #11 0x0804affa in main (argc=5, argv=0xbffffd54) at main.c:159
> > >
> > > No segfault here when I try that, nor with different files.  As I
> > > said, it has bugs.  I have seen other cases before when NULL lines
> > > are passed around near that code.  Guess I've not got them all.
> > > Might help to mention what terminal proggy you are using, it's
> > > size in characters, toybox version, OS, etc.  Something is
> > > different between you and me.
> > 
> > Terminal Program: PuTTY
> > Windows size: 80 * 25 chars
> > Toybox version: hg head
> > OS: Linux 3.2 (Debian wheezy)
> > File: Toybox LICENSE file
> 
> I'll install PuTTY, try toybox hg head, and play with them later, see
> if I can reproduce that segfault.  I use the last released tarball of
> toybox, an old Ubuntu, and a bunch of other terminal proggies.  I did
> not know that PuTTY had been ported to Unix.
> 
> But as I mentioned, not interested in a bug hunt right now.  That will
> be more appropriate when it's less of a "sandbox for testing the
> ideas" and more of a "good enough to bother using".  Always good to
> have other terminals for testing though.

Seems to be sensitive to the number of lines.  On my usual huge
roxterm, using either toybox 0.4 or hg head, doing this -

./toybox boxes -m less LICENSE -h 25

and just hitting down arrow until you get to the bottom of the page
segfaults as well.  -h means "pretend the terminal is that many lines
high", there's a similar -w as well.  80x25 in any other terminal did
the same.  For that particular file (17 lines long), any value of -h
between 19 and 34 will segfault after some moving around.  -h 35 makes
it segfault straight away.  Less than 19 or over 35 is fine.  Longer
files don't have that problem, though I suspect it will happen on
shortish files where the number of lines is about the length of the
screen.

I guess that somewhere I'm doing maths wrong and getting an out of
bounds line number when the file length is close to the screen length.
I'll make note of that, and fix it when I next get time to beat on
boxes.

Thanks for reporting it Roy.

-- 
A big old stinking pile of genius that no one wants
coz there are too many silver coated monkeys in the world.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20120906/b5502736/attachment-0002.sig>


More information about the Toybox mailing list