[ILUG] vi going mad

Niall O Broin niall at linux.ie
Fri Dec 22 11:18:20 GMT 2006


The real answer here, before I even ask the question, is "use emacs"  
but that's not my choice, so on with the question.

A couple of times today a developer's vi session has hung when he  
tried to paste some text into it from the X clipboard (this is on  
dapper). On examination, the vi process is taking 99% of the CPU and  
stracing it, I see that it is repeatedly doing nothing but loads of

select(1, [0], NULL, [0], {0, 0})       = 1 (in [0], left {0, 0})

followed by

brk(0xb4ee000)                          = 0xb4ee000

another armful of

select(1, [0], NULL, [0], {0, 0})       = 1 (in [0], left {0, 0})

followed by another

brk(0xb50f000)                          = 0xb50f000

and so on.

The amount of text pasted was of the order of 5 lines, so why vi  
keeps wanting more memory is a puzzle.

Doing an strace on a working vi, doing the same thing, I see that the  
select returns 1 and there's then a read to get the pasted data, all  
perfectly kosher. So, why in the crashing state does the select keep  
returning 1 but this is not being followed by a read? Any ideas?



More information about the ILUG mailing list