With XEmacs 21.4.12, compiled on Irix 6.5 with MIPSpro 7.3 compilers
and optimization turned on, I'm hitting this buffer underrun every
time build is trying to update autoloads for lisp/cl-macs.el:
/home/makc/src/FW/xemacs/21.4.12/xemacs-21.4.12/mule-yes/src/xemacs -batch -no-autoloads \
-l autoload -f batch-update-directory lisp
Updating autoloads in directory /home/makc/src/FW/xemacs/21.4.12/xemacs-21.4.12/mule-yes/lisp...
Generating autoloads for lisp/abbrev.el...
Generating autoloads for lisp/about.el...
Generating autoloads for lisp/alist.el...
Generating autoloads for lisp/apropos.el...
No autoloads found in lisp/auto-save.el
No autoloads found in lisp/auto-show.el
Generating autoloads for lisp/autoload.el...
No autoloads found in lisp/backquote.el
No autoloads found in lisp/blessmail.el
Generating autoloads for lisp/buff-menu.el...
No autoloads found in lisp/buffer.el
Generating autoloads for lisp/build-report.el...
No autoloads found in lisp/byte-optimize.el
No autoloads found in lisp/bytecomp-runtime.el
Generating autoloads for lisp/bytecomp.el...
No autoloads found in lisp/callers-of-rpt.el
No autoloads found in lisp/check-features.el
No autoloads found in lisp/cl-compat.el
No autoloads found in lisp/cl-extra.el
Generating autoloads for lisp/cl-macs.el...gmake: *** [lisp/auto-autoloads.el] Segmentation fault (core dumped)
$ dbx src/xemacs core
dbx version 7.3 MR 55458_Apr30_MR Apr 30 1999 13:44:41
Core from signal SIGSEGV: Segmentation violation
(dbx) t 1
> 0 boyer_moore(buf = 0x101e9e10, base_pat = 0x102a6f6c = "", len = 0, pos = 68921320, lim = 536870912, n = 270441680, trt = 272368048, inverse_trt = 0, charset_base = -1) ["/home/makc/src/FW/xemacs/21.4.12/xemacs-21.4.12/src/search.c":1795, 0x101eb418]
(dbx) l
>*1795 if ((cursor == tail_end_ptr
1796 || BUFBYTE_FIRST_BYTE_P (cursor[1]))
1797 && (BUFBYTE_FIRST_BYTE_P (cursor[0])
1798 || (translate_prev_byte == cursor[-1]
1799 && (BUFBYTE_FIRST_BYTE_P (translate_prev_byte)
1800 || translate_anteprev_byte == cursor[-2]))))
1801 ch = simple_translate[*cursor];
1802 else
1803 ch = *cursor;
1804 if (pat[i] != ch)
(dbx) $pc-20/10i
[boyer_moore:1795, 0x101eb404] slti t0,t0,160
[boyer_moore:1795, 0x101eb408] beq t0,zero,0x101eb3dc
[boyer_moore:1801, 0x101eb40c] lbu a7,0(s3)
[boyer_moore:1795, 0x101eb410] lbu a7,0(s3)
[boyer_moore:1795, 0x101eb414] slti t1,a7,160
*[boyer_moore:1795, 0x101eb418] bne t1,zero,0x101eb438
[boyer_moore:1795, 0x101eb41c] lbu t3,-1(s3)
[boyer_moore:1795, 0x101eb420] bne t3,a4,0x101eb3e0
[boyer_moore:1803, 0x101eb424] move a3,a7
[boyer_moore:1795, 0x101eb428] bne a2,zero,0x101eb438
[boyer_moore:1795, 0x101eb42c] ld t9,-352(s8)
(dbx) px $s3
0x42b8000
So, we're trying to get to cursor[-1] and it panics. The fact that it
happens in the branch-delay slot shows clearly that optimization does
come to play here, but I was wondering if it a honest buffer underrun
or it's compiler just being too agressive. If someone, who knows this
code, can tell me what is the lower bound for cursor at this point, it
would help a lot.
max