URL: <https://savannah.gnu.org/bugs/?68026>
Summary: [troff] spurious "spurious end trap token detected!"
error possible since commit 8b165f90ef, 29 December
Group: GNU roff
Submitter: gbranden
Submitted: Fri 06 Feb 2026 07:44:18 PM UTC
Category: Core
Severity: 4 - Important
Item Group: Incorrect behaviour
Status: In Progress
Privacy: Public
Assigned to: gbranden
Open/Closed: Open
Discussion Lock: Unlocked
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Fri 06 Feb 2026 07:44:18 PM UTC By: G. Branden Robinson <gbranden>
When attempting to build the NetHack Guidebook (from its Git NetHack-3.7
branch), I get a spurious error message.
$ (cd doc && rm -f Guidebook && PATH=$HOME/groff-HEAD/bin:/usr/bin:/bin make
Guidebook)
cat Guidebook.dated.mn | ../util/makedefs --grep --input - --output - | tbl
tmac.n - | nroff -c -Tascii -wall -Wrange -Wscale -Wtab -Wsyntax | col -bx >
Guidebook
troff:<standard input>:2221: error: spurious end trap token detected!
(The command is cribbed from the output of NetHack's "make".)
I bisected the problem down to commit 8b165f90ef, 29 December.
I've reverted it "manually", since a variable has been renamed that confounds
a straightforward reversion. That fixes the problem observed, and all tests
still pass (or XFAIL unremarkably).
Here's the diff.
commit 20f9d67848a2aba47d8d22ecb10bd9b7f9f0cc80 (HEAD -> master)
Author: G. Branden Robinson <[email protected]>
Date: Fri Feb 6 13:36:03 2026 -0600
XXX fix spurious spurious trap error
diff --git a/ChangeLog b/ChangeLog
index da0df963e..fe7fee072 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -851,21 +851,6 @@
* src/roff/troff/div.cpp: Include local "input.h" header file to
get at the symbol's relocated declaration.
-2025-12-29 G. Branden Robinson <[email protected]>
-
- * src/roff/troff/env.cpp: Refactor. Further separate input
- processing logic from engine logic.
- (environment::do_break): Rename argument from `want_adjustment`
- to `want_forced_adjustment` for clarity.
- (break_output_line): Stop checking value of `want_break` global
- here, as that's determined by the input control character used
- to invoke the request, a front-end rather than an engine concern
- {albeit brearing an engine-oriented name}. However, removing
- that conditional leaves this function as a one-liner with two
- call sites differing only by a Boolean literal argument, so drop
- the function altogether, instead open-coding it...
- (break_without_adjustment, break_without_adjustment): ...here.
-
2025-12-29 G. Branden Robinson <[email protected]>
[groff]: Unit-test `br` and `brp` requests.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index b49471f2a..90880c3fe 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -2645,18 +2645,23 @@ bool environment::is_empty()
&& pending_lines == 0 /* nullptr */;
}
-static void break_without_forced_adjustment_request()
+void do_break_request(bool want_adjustment)
{
+ while (!tok.is_newline() && !tok.is_eof())
+ tok.next();
if (was_invoked_with_regular_control_character)
- curenv->do_break(false /* want forced adjustment */);
- skip_line();
+ curenv->do_break(want_adjustment);
+ tok.next();
+}
+
+static void break_without_forced_adjustment_request()
+{
+ do_break_request(false);
}
static void break_with_forced_adjustment_request()
{
- if (was_invoked_with_regular_control_character)
- curenv->do_break(true /* want forced adjustment */);
- skip_line();
+ do_break_request(true);
}
void title()
This is another (narrowly targeted) C/C++ freeze bust.
Still to be understood: why these _request_ handlers need to use
`token::next()` instead of `skip_line()` as most request handlers do.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68026>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
