groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: groff: grops and grodvi crash on invalid input


From: G. Branden Robinson
Subject: Re: groff: grops and grodvi crash on invalid input
Date: Wed, 18 Nov 2020 20:07:50 +1100
User-agent: NeoMutt/20180716

Hi Brian,

Following up on an almost 14 year old bug report...

I can't reproduce these SEGVs with groff git HEAD.  I would have thought
they're the same bug since the groff output drivers outsource all of
their parsing to the driver library, src/libs/libdriver/input.cpp.

However, there's some suggestive evidence that's not the case.

I cannot reproduce the grops SEGV with groff 1.22.4 from Debian.

I _can_ reproduce the grodvi SEGV with groff 1.22.4, but neither SEGV
happens with groff git HEAD.  The only change to the source code that
can conceivably explain that in the meantime is this:

commit 5d0990500c2d16ed1025f1f0738cb419800652fe
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu Jun 27 04:42:51 2019 +1000

    libdriver: Fix SEGV (Savannah #56555).

    Check result of set_char_and_width() for error condition before relying
    on it.

...but I'm not too sure.  groff 1.22.4 with grops might be working for
me out of dumb luck.  But your commands _are_ trying to set glyphs,
so...maybe.

Incidentally the libdriver diagnostics are both too verbose and too
vague.  You get doubled diags for failures parsing a 'c' construct but
for most other "ditroff" commands, the most you will get is "missing
argument" and a line number, which is especially dopey because the
format is loose enough to allow multiple commands per line in many
cases.

I have a sketch for a fix for these problems.  It's ugly enough that I
expect some pushback from the groff mailing list over its esthetics.  So
let's get that out of the way--I'll CC them.

In the meantime, John Gardner, who's written his own "ditroff"
interpreter in JavaScript, might be able to offer some useful insights
on the well-formedness of your sample documents.

Regards,
Branden

Attachment: crash-grops.txt
Description: Text document

Attachment: crash-grodvi.txt
Description: Text document

Attachment: libdriver_input_diagnostics.diff
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]