Hello,

I get a segfault with a big macro used. It manifests differently when in
insertcopying and in normal text, but I guess that it is in fact the
same issue. Also the reproducibility is not complete, there is a
segfault, or a glibc error (on fedora devel).

I don't know if the content of the @macro is relevant or not, but the
length is important. The macro is in coverage_macro.texi. If I remove some 'a'
in the line of 'A' and 'a' I don't get a crash anymore. And if in
@insertcopying, and someting is added, then I get a glibc realloc error
instead of a segfault. The exact number of caracters is not always 
exactly the same even for 2 consecutive runs, you may have to play a
bit. This may be because of some stack randomization in fedora, or not.

I attach the macro include file coverage_macro.texi, formatting.texi with
the macro called in @copying, and formatting-no_insertcopying.texi with 
the macro called in text.

If the macro is expanded (by 
perl -w -x ~/src/texi2html/texi2html.pl -U texi2html 
formatting-no_insertcopying.texi -E t_f.texi)
there is no crash anymore, I attach t_f.texi. Even if I add manually
more lines there is no crash.

I also attach some backtraces and a glibc message.

--
Pat

Attachment: coverage_macro.texi
Description: TeXInfo document

Attachment: formatting.texi
Description: TeXInfo document

Attachment: formatting-no_insertcopying.texi
Description: TeXInfo document

Attachment: t_f.texi
Description: TeXInfo document

Program received signal SIGABRT, Aborted.
0x00110422 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install gcc.i386 glibc.i686
(gdb) bt
#0  0x00110422 in __kernel_vsyscall ()
#1  0x007675e0 in raise () from /lib/libc.so.6
#2  0x00768fa8 in abort () from /lib/libc.so.6
#3  0x007a4ebd in ?? () from /lib/libc.so.6
#4  0x007ab0e4 in ?? () from /lib/libc.so.6
#5  0x007ae096 in ?? () from /lib/libc.so.6
#6  0x007af4a5 in malloc () from /lib/libc.so.6
#7  0x0806bee2 in xmalloc (n=8) at xmalloc.c:49
#8  0x0806bf22 in xmemdup (p=0x80854a8, s=8) at xmalloc.c:113
#9  0x0806bf61 in xstrdup (string=0x80854a8 "acronym") at xmalloc.c:121
#10 0x0805c041 in remember_brace_1 () at makeinfo.c:2377
#11 remember_brace (proc=0x804c9d0 <cm_acronym>) at makeinfo.c:2391
#12 0x0805d37e in read_command () at makeinfo.c:2116
#13 reader_loop () at makeinfo.c:2321
#14 0x0805d5e9 in execute_string (format=0x807347f "%s") at makeinfo.c:4155
#15 0x08059d8d in execute_macro (def=0x8089698) at macro.c:443
#16 0x0805cb77 in read_command () at makeinfo.c:2076
#17 reader_loop () at makeinfo.c:2321
#18 0x0805f0e9 in convert_from_loaded_file (name=0xbffff730 "formatting.texi")
    at makeinfo.c:1719
#19 0x0806008c in convert_from_file () at makeinfo.c:1420
#20 main (argc=2, argv=0xbffff5a4) at makeinfo.c:887



Backtrace with @insertcopying with a precise length

Program received signal SIGSEGV, Segmentation fault.
0x007acaa8 in ?? () from /lib/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc.i686
(gdb) bt
#0  0x007acaa8 in ?? () from /lib/libc.so.6
#1  0x007ad096 in free () from /lib/libc.so.6
#2  0x08059d95 in execute_macro (def=0x8089800) at macro.c:445
#3  0x0805cb77 in read_command () at makeinfo.c:2076
#4  reader_loop () at makeinfo.c:2321
#5  0x0805d5e9 in execute_string (format=0x807347f "%s") at makeinfo.c:4155
#6  0x08054169 in cm_insert_copying () at insertion.c:1484
#7  0x0805d0f3 in read_command () at makeinfo.c:2149
#8  reader_loop () at makeinfo.c:2321
#9  0x0805f0e9 in convert_from_loaded_file (name=0xbffff730 "formatting.texi")
    at makeinfo.c:1719
#10 0x0806008c in convert_from_file () at makeinfo.c:1420
#11 main (argc=2, argv=0xbffff5a4) at makeinfo.c:887


Backtrace with an insertcopying, more length

Program received signal SIGABRT, Aborted.
0x00110422 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install gcc.i386 glibc.i686
(gdb) bt
#0  0x00110422 in __kernel_vsyscall ()
#1  0x007675e0 in raise () from /lib/libc.so.6
#2  0x00768fa8 in abort () from /lib/libc.so.6
#3  0x007a4ebd in ?? () from /lib/libc.so.6
#4  0x007ab0e4 in ?? () from /lib/libc.so.6
#5  0x007aec91 in ?? () from /lib/libc.so.6
#6  0x007af9c6 in realloc () from /lib/libc.so.6
#7  0x007645e8 in ?? () from /lib/libc.so.6
#8  0x0076477c in ?? () from /lib/libc.so.6
#9  0x00762ddd in ?? () from /lib/libc.so.6
#10 0x007626b1 in ?? () from /lib/libc.so.6
#11 0x00761403 in dcgettext () from /lib/libc.so.6
#12 0x0804ca3a in cm_today (arg=0) at cmds.c:786
#13 0x0805d0f3 in read_command () at makeinfo.c:2149
#14 reader_loop () at makeinfo.c:2321
#15 0x0805d5e9 in execute_string (format=0x807347f "%s") at makeinfo.c:4155
#16 0x08059d8d in execute_macro (def=0x808a408) at macro.c:443
#17 0x0805cb77 in read_command () at makeinfo.c:2076
#18 reader_loop () at makeinfo.c:2321
#19 0x0805d5e9 in execute_string (format=0x807347f "%s") at makeinfo.c:4155
#20 0x08054169 in cm_insert_copying () at insertion.c:1484
#21 0x08055dcd in begin_insertion (type=copying) at insertion.c:546
#22 0x08056752 in cm_copying () at insertion.c:1465
#23 0x0805d0f3 in read_command () at makeinfo.c:2149
#24 reader_loop () at makeinfo.c:2321
#25 0x0805f0e9 in convert_from_loaded_file (name=0xbffff71b 
"../../test/coverage/formatting.texi") at makeinfo.c:1719
#26 0x0806008c in convert_from_file () at makeinfo.c:1420
#27 main (argc=2, argv=0xbffff594) at makeinfo.c:887


*** glibc detected *** /home/dumas/src/texinfo/makeinfo/makeinfo: realloc(): 
invalid next size: 0x08650480 ***
======= Backtrace: =========
/lib/libc.so.6[0x7ab0e4]
/lib/libc.so.6[0x7aec91]
/lib/libc.so.6(realloc+0x106)[0x7af9c6]
/lib/libc.so.6[0x7645e8]
/lib/libc.so.6[0x76477c]
/lib/libc.so.6[0x762ddd]
/lib/libc.so.6[0x7626b1]
/lib/libc.so.6(dcgettext+0x43)[0x761403]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x804ca3a]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x805d0f3]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x805d5e9]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x8059d8d]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x805cb77]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x805d5e9]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x8054169]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x8055dcd]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x8056752]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x805d0f3]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x805f0e9]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x806008c]
/lib/libc.so.6(__libc_start_main+0xe5)[0x7525d5]
/home/dumas/src/texinfo/makeinfo/makeinfo[0x80493f1]
======= Memory map: ========
00110000-00111000 r-xp 00110000 00:00 0          [vdso]
00718000-00738000 r-xp 00000000 08:02 2054323    /lib/ld-2.8.90.so
00738000-00739000 r--p 00020000 08:02 2054323    /lib/ld-2.8.90.so
00739000-0073a000 rw-p 00021000 08:02 2054323    /lib/ld-2.8.90.so
0073c000-008a9000 r-xp 00000000 08:02 2054331    /lib/libc-2.8.90.so
008a9000-008ab000 r--p 0016c000 08:02 2054331    /lib/libc-2.8.90.so
008ab000-008ac000 rw-p 0016e000 08:02 2054331    /lib/libc-2.8.90.so
008ac000-008af000 rw-p 008ac000 00:00 0 
00933000-00940000 r-xp 00000000 08:02 2054368    
/lib/libgcc_s-4.3.1-20080708.so.1
00940000-00941000 rw-p 0000c000 08:02 2054368    
/lib/libgcc_s-4.3.1-20080708.so.1
08048000-08075000 r-xp 00000000 08:06 361595     
/home/dumas/src/texinfo/makeinfo/makeinfo
08075000-0807d000 rw-p 0002c000 08:06 361595     
/home/dumas/src/texinfo/makeinfo/makeinfo
0807d000-0807f000 rw-p 0807d000 00:00 0 
08637000-08658000 rw-p 08637000 00:00 0          [heap]
b7c00000-b7c21000 rw-p b7c00000 00:00 0 
b7c21000-b7d00000 ---p b7c21000 00:00 0 
b7d81000-b7f81000 r--p 00000000 08:02 1826228    /usr/lib/locale/locale-archive
b7f81000-b7f83000 rw-p b7f81000 00:00 0 
b7fa1000-b7fa3000 rw-p b7fa1000 00:00 0 
b7fa3000-b7faa000 r--s 00000000 08:02 815365     
/usr/lib/gconv/gconv-modules.cache
bfd94000-bfda9000 rw-p bffeb000 00:00 0          [stack]
Abandon

Reply via email to