[bug #68340] groff_mdoc.7: runtime error in "input.cpp" compiled with clang-21

Bjarni Ingi Gislason <[email protected]>
Newsgroups gmane.comp.printing.groff.bugs
Message-ID <[email protected]>
URL:
  <https://savannah.gnu.org/bugs/?68340>

                 Summary: groff_mdoc.7: runtime error in "input.cpp" compiled
with clang-21
                   Group: GNU roff
               Submitter: bjarniig
               Submitted: Mon 11 May 2026 08:08:55 PM UTC
                Category: Core
                Severity: 3 - Normal
              Item Group: Warning/Suspicious behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Unlocked
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 11 May 2026 08:08:55 PM UTC By: Bjarni Ingi Gislason <bjarniig>
Subject: groff_mdoc.7: runtime error in "input.cpp" compiled with clang-21

cd git/groff/build

./test-groff -mandoc -t -ww -z tmac/groff_mdoc.7

../src/roff/troff/input.cpp:4006:22: runtime error: index 167 out of bounds
for type 'unsigned char[128]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
../src/roff/troff/input.cpp:4006:22

-.-

  No runtime error with "nroff".

-.-

configure:

GNU roff version 1.24.1.718-1a59f-modified configuration summary
----------------------------------------------------------------------
 installation directory prefix    : /usr/local
 C++ compiler and options         : /usr/bin/clang++-21 -Wabi -Walloca -Wall
-Wextra -Wformat=2 -Wattribute-warning -Wcomma -Wdate-time
-Wdeprecated-declarations -Wformat-nonliteral -Wformat-security
-Wfree-nonheap-object -Wimplicit-fallthrough -Winconsistent-dllimport
-Wno-format -Wno-format-nonliteral -Wredundant-decls -Wshadow-all
-Wshift-overflow -Wsign-compare -Wsign-conversion -Wstring-plus-int
-Wthread-safety -Wuninitialized -Wunused -Wunused-macros -Wundef
-Wunused-function -Wunused-parameter -Wvla -fno-omit-frame-pointer
-fsanitize=undefined -fstack-protector-strong -fno-common
-fstack-clash-protection -ftrapv -funsigned-char -fno-builtin
-Wmismatched-new-delete -Wredundant-decls -Wdelete-incomplete -O2 -g
-std=gnu++23  -D_FORTIFY_SOURCE=2 -DGNULIB_NO_VLA 
 C compiler and options           : /usr/bin/clang-21 -Wabi -Walloca -Wall
-Wextra -Wformat=2 -Wattribute-warning -Wcomma -Wdate-time
-Wdeprecated-declarations -Wformat-nonliteral -Wformat-security
-Wfree-nonheap-object -Wimplicit-fallthrough -Winconsistent-dllimport
-Wno-format -Wno-format-nonliteral -Wredundant-decls -Wshadow-all
-Wshift-overflow -Wsign-compare -Wsign-conversion -Wstring-plus-int
-Wthread-safety -Wuninitialized -Wunused -Wunused-macros -Wundef
-Wunused-function -Wunused-parameter -Wvla -fno-omit-frame-pointer
-fstack-protector-strong -fno-common -fstack-clash-protection -ftrapv
-funsigned-char -fno-builtin  -Wold-style-definition
-Wout-of-line-declaration  -O2 -g -std=gnu23  -D_FORTIFY_SOURCE=2
-DGNULIB_NO_VLA 
 Perl interpreter version         : 5.40.1
 Ghostscript command              : gs
 URW fonts directory              : /usr/share/fonts/type1/urw-base35/
 gropdf service level             : full
 X11 support                      : enabled
 X11 app defaults directory       : /usr/local/lib/X11/app-defaults
 default paper format             : A4
 'groff -l' uses print spooler    : no
 preconv can use uchardet library : yes
 can build groff.{info,html,txt}  : yes
 can build groff.{dvi,pdf}        : yes
----------------------------------------------------------------------
configure: Default X11 application defaults directory assumed.









    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68340>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCagI3WwAKCRCqLAuaBUf3
TiygAQCH5fHKm16xBtRg4zrt8dI35BL36BnY0rADYPwDyTm/uwD+NYp0+bfNVOjg
xL5mjReYm++o4p0ARuLLvJ7YK9Hs+Q4=
=evio
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.