URL:
  <https://savannah.gnu.org/bugs/?68202>

                 Summary: [troff] assertion failure in
`add_hyphenation_exception_words_request()`
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Wed 01 Apr 2026 09:10:06 AM UTC
                Category: Core
                Severity: 4 - Important
              Item Group: Crash/Unresponsive
                  Status: In Progress
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Unlocked
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Wed 01 Apr 2026 09:10:06 AM UTC By: G. Branden Robinson <gbranden>
This bug is new to _groff_ 1.24.0.

It happens when you put a non-character in a hyphenation exception word.


$ printf '.hw baz\\%%qux\n' | ~/groff-1.24.0/bin/groff
troff:<standard input>:1: error: expected ordinary, special, or indexed
character, got an escaped '%'
troff: ../src/roff/troff/env.cpp:3861: void
add_hyphenation_exception_words_request(): Assertion `0 == "attempted to use
token without charinfo in" " hyphenation exception word"' failed.
/home/branden/groff-1.24.0/bin/groff: error: troff: Aborted (core dumped)


If _groff_ were compiled with the `NDEBUG` preprocessor symbol defined, the
formatter would not abort, but it would also abort processing the entire
request, instead of skipping only the invalid word.

**That** problem goes back quite a ways, possibly forever.


$ printf '.hw MODOK\\%%MODOK baz-qux\n.ll 5n\nbazqux\n' |
~/groff-1.22.3/bin/groff -Wbreak -a
<standard input>:1: normal or special character expected (got `\%')
<beginning of page>
bazqux


Change this request handler to:

1.  Stop throwing an assertion, since there's no failure of internal logic
here--merely invalid user input.

2.  Issue a warning in category "char" about the invalid hyphenation exception
word.

3.  Skip the remainder of the invalid word and process remaining request
arguments normally.

An experimental patch in my working copy reveals that these are tractable.


$ printf '.hw MODOK\\%%MODOK baz-qux\n.ll 5n\nbazqux\n' | ./build/test-groff
-Wbreak -a
troff:<standard input>:1: error: expected ordinary, special, or indexed
character, got an escaped '%'
troff:<standard input>:1: warning: skipping hyphenation exception word
containing an escaped '%' [-w char]
<beginning of page>
baz<hy>
qux


Getting rid of the error diagnostic might be nice.







    _______________________________________________________

Reply to this item at:

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

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to