bug-groff
[Top][All Lists]
Advanced

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

[bug #61414] [libgroff] emits misleading diagnostics when DESC file 'res


From: G. Branden Robinson
Subject: [bug #61414] [libgroff] emits misleading diagnostics when DESC file 'res' is invalid
Date: Tue, 2 Nov 2021 03:46:40 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

URL:
  <https://savannah.gnu.org/bugs/?61414>

                 Summary: [libgroff] emits misleading diagnostics when DESC
file 'res' is invalid
                 Project: GNU troff
            Submitted by: gbranden
            Submitted on: Tue 02 Nov 2021 07:46:38 AM UTC
                Category: Core
                Severity: 3 - Normal
              Item Group: Warning/Suspicious behaviour
                  Status: In Progress
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

An explicitly zero device resolution should be rejected as invalid, not
missing.  What's worse, a negative one gets used for computation anyway and
causes an assertion failure.

(The `papersize` fiddling can be ignored; I was exploring another issue
alongside this one.  If you take them out you still get the assertion
failures, via troff:main -> init_environments -> environment::environment ->
points_to_units -> scale).


$ sed -i.bak 's/res 240/res 0/;/res/a\
papersize 10i,7i
' build/font/devutf8/DESC
$ head -n 2 build/font/devutf8/DESC
res 0
papersize 10i,7i
$ ./build/test-groff -Tutf8
/home/branden/src/GIT/groff/build/groff:/home/branden/src/GIT/groff/build/font/devutf8/DESC:
error: device description file missing 'res' directive
/home/branden/src/GIT/groff/build/groff: fatal error: cannot load 'DESC'
description file for device 'utf8'


Let's now make the resolution negative and see what happens.


$ sed -i 's/res 0/res -240/' build/font/devutf8/DESC
$ head -n 2 build/font/devutf8/DESC
res -240
papersize 10i,7i
$ ./build/test-groff -Tutf8
troff: ../src/roff/troff/number.cpp:652: scale(): assertion failed: 'x >= 0 &&
y > 0'
/home/branden/src/GIT/groff/build/groff: error: troff: Aborted (core dumped)


Mondo bad!

groff 1.22.4 behaves similarly.  Here are the negative and zero `res` cases,
respectively.


$ groff -Tutf8 -Fbuild/font/
troff: Failed assertion at line 653, file '../../src/roff/troff/number.cpp'.
groff: troff: Signal 6 (core dumped)
$ groff -Tutf8 -Fbuild/font/
groff:build/font/devutf8/DESC:10: missing 'res' command
groff: fatal error: invalid device 'utf8'





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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