bug-groff
[Top][All Lists]
Advanced

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

[bug #65427] troff segfaults when output file flush fails


From: G. Branden Robinson
Subject: [bug #65427] troff segfaults when output file flush fails
Date: Thu, 7 Mar 2024 18:41:24 -0500 (EST)

Update of bug #65427 (group groff):

                  Status:             In Progress => Fixed                  
             Open/Closed:                    Open => Closed                 
         Planned Release:                    None => 1.24.0                 

    _______________________________________________________

Follow-up Comment #2:

Submitter, please confirm this fix on your system.

You can cherry-pick the commit if you like.


commit 5c923303a9ef44bb4bc4f44d09799f93193fc079
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu Mar 7 10:20:17 2024 -0600

    [troff]: Fix Savannah #65427 (check fp==nullptr).
    
    * src/roff/troff/node.cpp (ascii_output_file::outc)
      (ascii_output_file::outs, put_string, troff_output_file::put)
      (ascii_output_file::really_transparent_char)
      (ascii_output_file::really_print_line): Guard uses of standard C
      library `putc()` and `fputc()` functions with a null pointer check.
      They could fail if the output stream has been invalidated.  Problem
      present from groff's birth and apparently exposed by man-db man's use
      of AppArmor.  See
      <https://bugs.launchpad.net/ubuntu/+source/lintian/+bug/2055402> and
      follow-up discussion there.
    
    Fixes <https://savannah.gnu.org/bugs/?65427>.  Thanks to an anonymous
    submitter for the report.
    
    No apparent performance degradation, even _without_ optimization, on
    20 rebuilds of automake.pdf, contrib/mom/examples/*.pdf, and
    groff-man-pages.pdf.
    
    CFLAGS="-O0 -Og -ggdb"
    
    Before:
    + awk /Elapsed/ {time = $NF; sub("0:", "", time); print time}
    + datamash range 1 mean 1 sstdev 1
    3.35    11.0475 1.0103510333178
    
    After:
    + awk /Elapsed/ {time = $NF; sub("0:", "", time); print time}
    + datamash range 1 mean 1 sstdev 1
    2.49    10.81380952381  0.62027797148114




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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