Here's another backtrace:

Incorporating new mail into inbox...


Program received signal SIGSEGV, Segmentation fault.
__memcpy_avx_unaligned_erms () at 
../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:461
warning: 461    ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No 
such file or directory
(gdb) bt
#0  __memcpy_avx_unaligned_erms () at 
../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:461
#1  0x000055555556b2dc in memcpy (__len=8192, __src=<optimized out>, 
__dest=0x7fffffff9da0) at 
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29
#2  netsec_read (nsc=0x5555555e2d00, 
    buffer=buffer@entry=0x7fffffff9da0 "uvwxyz.. Abcdefghijklmnopqrstuvwxyz.. 
Abcdefghijklmnopqrstuvwxyz.. Abcdefghijklmnopqrstuvwxyz.. 
Abcdefghijklmnopqrstuvwxyz.. Abcdefghijklmnopqrstuvwxyz.. 
Abcdefghijklmnopqrstuvwxyz.. Abcdefghijklmnopq"..., size=size@entry=8192, 
errstr=errstr@entry=0x7fffffff9d80) at sbr/netsec.c:406
#3  0x000055555556060e in traverse (action=action@entry=0x55555555cd71 
<pop_action>, closure=closure@entry=0x7fffffffbf40, 
fmt=fmt@entry=0x55555557b4c1 "RETR %d")
    at uip/popsbr.c:592
#4  0x0000555555560e2d in pop_retr (msgno=msgno@entry=1, 
action=action@entry=0x55555555cd71 <pop_action>, 
closure=closure@entry=0x7fffffffbf40) at uip/popsbr.c:560
#5  0x000055555555db7d in main (argc=<optimized out>, argv=<optimized out>) at 
uip/inc.c:576


Here, in netsec_read, (int)nsc->ns_inbuflen is -6553.

I have worked on debugging this.  At some point, the entire nsc
structure becomes garbage.  I have not yet pinpointed where memory
gets corrupted.

On the way to total understanding, I found one problem unrelated to
this memory problem.  In traverse(), "len" needs to be signed, or the
"if (len < 0)" test cannot detect an error return from netsec_read.

Meanwhile, has anyone tried my patch?  Does it work for anyone other
than me, its author?

 < Stephen

Reply via email to