bugGNU roff - Bugs: bug #59202, troff: segfault when standard...


bug #59202: troff: segfault when standard output closed

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Tue 29 Sep 2020 08:10:25 AM UTC
Category:  Core Severity:  3 - Normal
Item Group:  Crash/Unresponsive Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup

Tue 01 Mar 2022 02:09:33 PM UTC, comment #2: 

commit c788cf8c6bbe939fa11f7ec032e525a7e33f41b6
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Sep 29 07:02:25 2020 +1000

    Fix SEGV arising from recursing destructor.

    * src/roff/troff/node.h (output_file): Add class member `is_dying` to
      track whether destructor has already been entered; initialize false.

    * src/roff/troff/node.cpp (real_output_file::~real_output_file): Set
      `is_dying` true when destructor entered.

    * src/roff/troff/div.cpp (cleanup_and_exit): Only delete
      `the_output` object if it is not already being destroyed.

    Thanks to "hackerb9" for reporting the problem.  Problem appears to date
    back to groff 1.02 (June 1991) or earlier.

    Fixes <https://savannah.gnu.org/bugs/index.php?59202>.

G. Branden Robinson <gbranden>
Group administrator
Tue 29 Sep 2020 08:40:48 AM UTC, comment #1: 

Fixed in c788cf8c6bbe939fa11f7ec032e525a7e33f41b6.

G. Branden Robinson <gbranden>
Group administrator
Tue 29 Sep 2020 08:10:25 AM UTC, original submission:  

"hackerb9" reported a problem to the groff mailing list.


At first it was difficult to reproduce but things became clear when the -P argument was removed and standard output closed instead.

To reproduce:

echo foo | groff >&-

I have a fix in preparation.

G. Branden Robinson <gbranden>
Group administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by gbranden (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-09-29 gbranden StatusIn Progress Fixed
        Assigned toNone gbranden
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-a854.
    Corresponding source code