nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] Segfault on justify+cut+cut


From: Derek McKay
Subject: [Nano-devel] Segfault on justify+cut+cut
Date: Mon, 4 Feb 2002 17:49:17 +0000 (GMT)

Hi all,


I think I may have found a bug in version 1.0.8 (compiled on SuSE Linux
7.3). To replicate the fault, create a file with the following lines:

------ cut here ------
aaa aaa aaa aaa aaa aaa
aaa aaa aaa aaa aaa aaa
aaa aaa aaa aaa aaa aaa
aaa aaa aaa aaa aaa aaa
aaa aaa aaa aaa aaa aaa

bbb

------ cut here ------

Then cut and copy this block (including the last blank line) several times
(I did it about 15 times) to create lots of "aaa" paragraphs and single
"bbb" words, separated by blank lines. Then go to the top of the file and
type "^J^K^K" over and over. I.e., you justify the "aaa"s and then delete
the intervening "bbb" and then repeat to create lots of paragraphs of
justified "aaa"s. Provided you do not press any other keys during this
repeated sequence, nano will evenutally crash. The only point I've noted
is that if the "aaa"s don't justify to more than one line, then it doesn't
seem to fail.

Trying to trace through the source code, the problem comes from
do_cut_text(), which calls edit_refresh() which calls update_line() which
calls nmalloc() which calls malloc()... which is the routine that actually
fails. However, I would not expect that sort of behaviour from a malloc()
on a Linux system. I tried inserting some debug lines into the nmalloc()
call, and the variable "howmuch" was "48" at the time of the crash. I've
also tried unwrapping the malloc() call out of the "if" statement.

I have tried this on two independent machines, but they were both running
SuSE Linux (one was v7.2 and the other 7.3).

I'm happy to help out with any testing/debugging etc, but before I
proceed, I'd be curious to know whether the problem occurs on any other
systems, or whether it is just me.


regards, Derek. (address@hidden)


_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: address@hidden
_______________________________________________
Nano-devel mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/nano-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]