[COFF] Latest delivery problem worked around

G. Branden Robinson via COFF coff at tuhs.org
Fri Apr 10 12:50:45 AEST 2026


At 2026-04-10T12:04:01+1000, Alexis via COFF wrote:
> Greg 'groggy' Lehey via COFF <coff at tuhs.org> writes:
> > And the log messages describing the rejection are also too polite to
> > mention the attachment type to which it objects.
> 
> Ah, the old "don't give users any information that might let them
> solve the problem" trick.

Yup.  One of the many themes of my work on groff is that I've found
myself writing change log entries that use the verb "disclose" to record
occasions where the program knew damn well the specifics of what was
wrong with the input, but had been churlishly refusing to share that
information with the (likely frustrated) user.

Some examples:

    * src/roff/troff/reg.cpp (number_value_to_ascii): When diagnosing a
      value beyond representatable Roman numeral range, disclose the
      specific format demanded.  ...

    * When an artifact is present but the page count is wrong, disclose the
      expected value.

    * src/utils/xtotroff/xtotroff.c (MapFont): Make fatal error diagnostic
      on memory allocation failure disclose how many bytes we attempted to
      grab from the heap.  This way the user can better distinguish system
      starvation scenarios from attempted denial-of-service attacks (or
      worse).  (Admittedly, few people ever run xtotroff at all, let alone
      in scenarios where a busy system is so pinned that `malloc(PATH_MAX)`
      is likely to fail.  But I feel that since we have this information, we
      should disclose it.)

    * src/devices/grohtml/post-html.cpp (html_printer::set_style): Disclose
      name of font description file lacking `internalname` directive in
      fatal diagnostic when this is the case.

    * src/roff/troff/node.cpp (mount_font_no_translate): Clarify error
      diagnostic when the `fp` request is given a too-huge mounting
      position; disclose both the rejected argument and value of the next
      available font position.

Regards,
Branden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://www.tuhs.org/pipermail/coff/attachments/20260409/add74401/attachment.sig>


More information about the COFF mailing list