bugGNU roff - Bugs: bug #64701, [doc] clang-16 dumps core when...

 
 

bug #64701: [doc] clang-16 dumps core when creating "doc/groff-man-pages.pdf"

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Thu 21 Sep 2023 12:27:07 AM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Build/Installation Status:  Unreproducible
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 30 Sep 2023 06:47:01 PM UTC, comment #3: 

Clang 16 is not (conveniently) available to me, and without a backtrace, I don't have enough information to pursue this issue.

It may indeed be a compiler bug, but if so I expect the LLVM team will want a backtrace, too (and possibly a disassembly of the relevant basic block).

Tagging unreproducible until someone can produce these.

G. Branden Robinson <gbranden>
Group administrator
Sat 23 Sep 2023 01:05:32 PM UTC, comment #2: 

  The file that caused the core dump is "tmac/groff_mdoc.7".

  Compiling without my extra flags does not cause a core dump.

  So this is a defect in the clang-16 compiler(?).

  From config.clang.out*

GNU roff version 1.23.0.rc4.9430-4cf0
----------------------------------------------------------------------
 installation directory prefix    : /usr/local
 C++ compiler and options         : /usr/bin/clang++ -Wabi -Walloca -Wall -Wextra -Wformat=2 -Wattribute-warning -Wdate-time -Wformat-security -Wfree-nonheap-object -Wimplicit-fallthrough -Wmissing-noreturn -Wredundant-decls -Wshadow-all -Wshift-overflow -Wuninitialized -Wunused -Wunused-parameter -Wvla -fsanitize=bool -fsanitize=enum -fsanitize=signed-integer-overflow -fsanitize=integer-divide-by-zero,shift,null -fsanitize-undefined-trap-on-error -fno-sanitize=pointer-overflow -fsanitize=return -fsanitize=alignment,object-size,pointer-overflow -O2 -fstack-protector-strong -fno-common -fstack-clash-protection -ftrapv -funsigned-char -ggdb3 -fsanitize=null -fsanitize=nonnull-attribute -fno-builtin -fsanitize=undefined  -fcheck-new -Wmismatched-new-delete -Wredundant-decls -Wdelete-incomplete -std=c++2a  -D_FORTIFY_SOURCE=2 -DGNULIB_NO_VLA
 use libgroff's memory allocator  : no
 C compiler and options           : /usr/bin/clang -Wabi -Walloca -Wall -Wextra -Wformat=2 -Wattribute-warning -Wdate-time -Wformat-security -Wfree-nonheap-object -Wimplicit-fallthrough -Wmissing-noreturn -Wredundant-decls -Wshadow-all -Wshift-overflow -Wuninitialized -Wunused -Wunused-parameter -Wvla -fsanitize=bool -fsanitize=enum -fsanitize=signed-integer-overflow -fsanitize=integer-divide-by-zero,shift,null -fsanitize-undefined-trap-on-error -fno-sanitize=pointer-overflow -fsanitize=return -fsanitize=alignment,object-size,pointer-overflow -O2 -fstack-protector-strong -fno-common -fstack-clash-protection -ftrapv -funsigned-char -ggdb3 -fsanitize=null -fsanitize=nonnull-attribute -fno-builtin -fsanitize=undefined  -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes  -Wout-of-line-declaration  -std=c17  -D_FORTIFY_SOURCE=2 -DGNULIB_NO_VLA
 Perl interpreter version         : 5.36.0
 X11 support                      : enabled
 X11 app defaults directory       : /usr/local/lib/X11/app-defaults
 default paper format             : A4
 'groff -l' uses print spooler    : no
 use URW fonts for PDF output     : yes
 URW fonts directory              : /usr/share/fonts/type1/urw-base35/
 preconv can use uchardet library : yes
 can build groff.dvi, groff.pdf   : yes
----------------------------------------------------------------------


Bjarni Ingi Gislason <bjarniig>
Fri 22 Sep 2023 08:18:23 AM UTC, comment #1: 

Hi Bjarni,

Please provide:

1.  The configuration report from this build.  That would be this part.


GNU roff version 1.23.0.447-30733
----------------------------------------------------------------------
 installation directory prefix    : /usr/local
 C++ compiler and options         : g++ -Wall -Wextra -Wformat=2  -Walloc-zero -Wstringop-overflow=4 -Wshadow=global -Wredundant-decls -Wunused -Wunused-parameter -fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error -fstack-protector-strong -fno-common -fstack-clash-protection -ftrapv -funsigned-char -fvar-tracking-assignments  -flto=auto -O0 -Og -ggdb -fcheck-new -Wredundant-decls -std=c++98 -pedantic -pedantic-errors -Wformat=2 -D_FORTIFY_SOURCE=2
 use libgroff's memory allocator  : no
 C compiler and options           : gcc -Wall -Wextra -Wformat=2  -Walloc-zero -Wstringop-overflow=4 -Wshadow=global -Wredundant-decls -Wunused -Wunused-parameter -fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error -fstack-protector-strong -fno-common -fstack-clash-protection -ftrapv -funsigned-char -fvar-tracking-assignments  -flto=auto -O0 -Og -ggdb -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes  -Wold-style-declaration  -Wformat=2 -D_FORTIFY_SOURCE=2
 Perl interpreter version         : 5.32.1
 X11 support                      : enabled
 X11 app defaults directory       : /usr/local/lib/X11/app-defaults
 default paper format             : letter
 'groff -l' uses print spooler    : lpr
 use URW fonts for PDF output     : yes
 URW fonts directory              : /usr/share/fonts/type1/gsfonts/
 preconv can use uchardet library : yes
 can build groff.dvi, groff.pdf   : yes
----------------------------------------------------------------------


2.  Please attach the core file from the troff command that crashed.  It will probably be in your build directory.

3.  Also, since the core file might be too large to attach to Savannah, please collect a backtrace.

Here is a procedure.


$ gdb ./build/troff ./core
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
[...]
Reading symbols from ./build/troff...
[New LWP 9770]
Core was generated by `troff -Tps'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0x00007fab162f03ce in __GI___libc_read (fd=0, buf=0x5566be08f920, nbytes=1024)
    at ../sysdeps/unix/sysv/linux/read.c:26
26      ../sysdeps/unix/sysv/linux/read.c: No such file or directory.
##(gdb) bt
[...]
#2  0x00007fab16283742 in __GI__IO_default_uflow (fp=0x7fab163d3980 <_IO_2_1_stdin_>) at libioP.h:948
#3  0x00005566bc775372 in file_iterator::fill (this=0x5566be084d60) at ../src/roff/troff/input.cpp:450
#4  0x00005566bc7784a7 in input_stack::finish_get (np=np@entry=0x7ffeb11602f0) at ../src/roff/troff/input.cpp:605
#5  0x00005566bc77a275 in input_stack::get (np=0x7ffeb11602f0) at ../src/roff/troff/input.cpp:594
#6  token::next (this=0x5566bc7e2e40 <tok>) at ../src/roff/troff/input.cpp:1865
#7  0x00005566bc786749 in process_input_file (name=<optimized out>) at ../src/roff/troff/input.cpp:8063
#8  0x00005566bc78ff7e in main (argc=2, argv=0x7ffeb1160538) at ../src/roff/troff/input.cpp:8400
##(gdb) quit


I simulated your issue by manually killing troff with SIGILL; I expect your backtrace to look quite different.




G. Branden Robinson <gbranden>
Group administrator
Thu 21 Sep 2023 12:27:07 AM UTC, original submission:  

Subject: [doc] clang-16 dumps core when creating
 "doc/groff-man-pages.pdf"

Debian clang version 16.0.6 (15)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Makefile is in the attachment.

[...]
  GROFF    doc/groff-man-pages.pdf
/home/bg/git/groff/build/groff: error: troff: Illegal instruction (core
dumped)
make[2]: *** [Makefile:17190: doc/groff-man-pages.pdf] Error 2
make[2]: *** deleting file 'doc/groff-man-pages.pdf'
make[2]: Leaving directory '/home/bg/git/groff/build'
make[1]: *** [Makefile:12529: all-recursive] Error 1
make[1]: Leaving directory '/home/bg/git/groff/build'
make: *** [Makefile:6992: all] Error 2
[...]


[
  5664        DOC_GROFF = \
  5665          GROFF_COMMAND_PREFIX= \
  5666          GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
  5667          $(GROFFBIN) -M $(doc_srcdir) $(MFLAG) $(FFLAG) -ww -b

  [ s-tmac: stripped tmac files ]
  5203        MFLAG = -M$(abs_top_builddir)/s-tmac -M$(abs_top_builddir)/tmac -M$(abs_top_srcdir)/tmac

  5201        FFLAG = -F$(abs_top_builddir)/font -F$(abs_top_srcdir)/font
]

 17188        doc/groff-man-pages.pdf: $(GROFF_MAN_PAGES_ALL) eqn pic tbl \
 17189          $(TMAC_PACKAGE_MAN) $(TMAC_PACKAGE_MDOC) font/devps/freeeuro.pfa
 17190                $(GROFF_V)$(DOC_GROFF) -pet -mandoc -dHF=HB -rC1 \
 17191                  -rCHECKSTYLE=3 -Tpdf -P-e \
 17192                  $(GROFF_MAN_PAGES1) \
 17193                  $(top_builddir)/s-tmac/sv.tmac $(GROFF_MAN_PAGES2) \
 17194                  $(top_builddir)/s-tmac/en.tmac $(GROFF_MAN_PAGES3) > $@



 12528        $(am__recursive_targets):
 12529                @fail=; \
 12530                if $(am__make_keepgoing); then \
 12531                  failcom='fail=yes'; \

  6991        all: $(BUILT_SOURCES)
  6992                $(MAKE) $(AM_MAKEFLAGS) all-recursive
  6993


Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #55155:  Makefile added by bjarniig (998KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-09-30 gbranden StatusNeed Info Unreproducible
    2023-09-22 gbranden StatusNone Need Info
    2023-09-21 bjarniig Attached File- Added Makefile, #55155

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code