Follow-up Comment #8, bug #68908 (group groff): At 2026-11-15T07:54:34-0500, Dave wrote: > Follow-up Comment #6, bug #68908 (group groff): > [comment #4 comment #4:] >> In a dirty build environment, _anything_ might go wrong. >> One can inject errors into the source code in countless ways. > > You're right; I needed to clarify that none of my changes touched any > C++ code. In fact, had I modified even a single character of C++ > code, I wouldn't have opened this bug report until backing that change > out. I've made two changes in the entire tree: > > * I've changed some comments in one .tmac file (part of mucking about > with bug #62814) that only nroff uses. > * I've modified "configure" to always set groff_use_tex=no, which > affects which documentation gets built. > > If either of these two changes can alter the formatter's behavior, > that's a more serious bug than I suspected.
They likely can't. But Git is the thing that "describes" the state of
the working copy, which we've used to compute a version number for
several years. I think Bertrand innovated that in 2017-2018 or so.
And "git describe" doesn't know what sorts of changes can impact
formatter behavior and which can't. And I question the value of trying
to teach it how to decide that.
See lines 509-534 of _Makefile.am_.
> This tells us there's no regression test for \n[.Y] being numeric.
There _is_ an autoconf test, `GROFF_CHECK_VERSION_FORMAT`.
See lines 21-55 of _m4/groff.m4.
But since you're not re-bootstrapping and re-configuring, you're never
exercising the test.
There are two supported build scenarios:
1. A distribution archive, followed by "./configure" and "make". See
_INSTALL.extra_.
2. A build from the Git working copy, which requires "bootstrap.sh",
followed by "./configure" and "make". See _INSTALL.REPO.
What you're doing is neither one nor the other.
> [comment #5 comment #5:]
>> If I meant for `.Y` to become "string-valued",
>> I would have (assuming I kept my wits about me)
>> committed a documentation change saying so.
>
> I assumed so, thus assumed the change was accidental, thus
> characterized it as a regression. My initial report would have been
> different had it been a documented change I disagreed with.
As you note below, it's not clear which change you're referring to, or
when it was made to _groff_.
>> In contrast, if you come up with a defect that permits
>> non-numeric content into the `.Y` register in a "clean"
>> working copy, I'm intensely interested to know about it--
>
> Is a working copy that alters no C++ code clean enough?
No, because as noted above, Git doesn't know the difference.
At 2026-11-15T14:21:19-0500, Dave wrote:
> Follow-up Comment #7, bug #68908 (group groff):
>
> Hmm. The .Y bug itself might not be new; it might have only become
> recently exposed by the way version strings are generated. Trawling
> some old builds I had lying around, I found versions of the form:
>
> GNU groff version 1.23.0.rc4.19-96b92-dirty
> GNU groff version 1.24.0.8-7152a-modified
> GNU groff version 1.24.1.1050-96092-modified
> GNU groff version 1.25.0.rc1.54-741f-modified
Yes. There's a `VERSION` and a `SHORT_VERSION`. The latter is used to
populate the `.x`, `.y`, and `.Y` registers. See file references above.
> Notably, all of these put a dot after the third element, before
> tacking on all the build-specific stuff. "version 1.25.0-modified"
> breaks that tradition, perhaps exposing a lurking bug wherein the code
> populating the .Y register stopped reading at a dot or end of string,
> but read everything it encountered otherwise.
These are the conventions Git uses.
The description starts with the most recent tag that is a direct
ancestor of HEAD on the branch (or something like that--this stuff is
complicated). Next, count the number of commits since that tag. If
that count is nonzero, you furthermore get a sequence number (the count)
and an abbreviated hash of the commit at HEAD. If the working copy is
altered (`git status` reports added/modified/deleted files), then older
versions of Git apply `-dirty` and more recent ones `-modified`.
> This suggests that the underlying structural issue is that "number"
> registers are not stored in numeric data types.
Truly numerically valued registers are. But that doesn't matter because
_all_ register interpolations take place in the context of an input
stream, which is a character sequence. Thus, in a sense, all "number"
registers become string-valued upon interpolation. This isn't really a
groffism; consider that numeric register values are stored in binary and
then encoded as decimal digits in ISO 646/ASCII. Or maybe something
else depending on the register format.
One of the reasons I enhanced `pnr` for 1.24.0 was that I found it
useful to get more probing, direct access to what a register actually
stored than could be discerned by interpolating it. Which properties a
register has depends on whether it's string-valued or not, for example.
Of course I still have to performan a binary to ASCII conversion of
numeric values, but facilities for doing that in C/C++ are satisfactory.
> This is perhaps understandable given the Frankenstein existence of the
> "string-valued register," but this compromise seems to trade some
> coding convenience for less type safety. (A condition that has never
> otherwise arisen in the history of C/C++ code!)
True, but type coherence in memory--sometimes aided by a language
runtime--is one matter, and type coherence (and representation) when
dumped to an I/O device is another. Historically, when the I/O device
is persisent storage rather than a terminal, a popular approach has been
to dump raw memory to the device and trust consumers of that data to
handle it intelligently and robustly when reading it back in.
From that berth, a billion black-winged security vulnerability caravels
were launched.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68908>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
