bugGNU roff - Bugs: bug #64101, improve diagnostic for bad string...

 
 

bug #64101: improve diagnostic for bad string argument

Submitter:  Dave <barx>
Submitted:  Mon 24 Apr 2023 05:23:53 AM UTC
   
 
Category:  Core Severity:  2 - Minor
Item Group:  Warning/Suspicious behaviour Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 18 Jul 2023 01:17:44 AM UTC, comment #2: 

comment #1:

> I'll file a separate bug for the incorrect diagnosis


If this was ever done, I couldn't find it, so I just opened bug #64439 for this.

Dave <barx>
Group Member
Mon 24 Apr 2023 08:03:13 AM UTC, comment #1: 

I just ran into the same diagnostic!  We may be poking our fingers into similar things.

But in my case, I got it on legitimate input.

I'll file a separate bug for the incorrect diagnosis (rather than the wording) but wanted to record it here as well.


$ cat ATTIC/defchar.groff
.char \[BS] BELL LABS
.ds mystr ABC\[BS]
.nf
\[rs][BS] -> \[BS]
mystr -> \*[mystr]
.chop mystr
mystr -> \*[mystr]
.pl \n[nl]u
$ ./build/test-groff -Tascii ATTIC/defchar.groff
troff:ATTIC/defchar.groff:7: error: a newline character is not allowed in an escape sequence parameter
\[BS] -> BELL LABS
mystr -> ABCBELL LABS
mystr -> ABC


This problem is not new to groff 1.23.0; it's in 1.22.4, with old language.


$ nroff ATTIC/defchar.groff
troff: ATTIC/defchar.groff:7: a newline character is not allowed in an escape name
\[BS] ‐> BELL LABS
mystr ‐> ABCBELL LABS
mystr ‐> ABC


G. Branden Robinson <gbranden>
Group administrator
Mon 24 Apr 2023 05:23:53 AM UTC, original submission:  

A bracket-delimited escape used in an argument to a string must be quoted.  Commit 17ee46a8, part of which was motivated by http://lists.gnu.org/r/groff/2022-11/msg00185.html, documented this clearly.  But a user who forgets this requirement is met with a cryptic diagnostic.

$ cat string_test
.ds str hello \\$1
\*[str \[aq]]
$ groff string_test > /dev/null
troff:string_test:2: error: a newline character is not allowed in an escape sequence parameter

In the email thread (which continues briefly at http://lists.gnu.org/r/groff/2022-12/msg00001.html, which is not linked to the rest of the thread due to the archival software's limitations), Branden explains how the parser processes this input, and surmises that at the point it realizes it's in trouble, it may not be a in a good position to explain why.  But he admits the matter requires further investigation, hence this low-priority ticket to put the issue on the radar after more pressing matters have been resolved.

Dave <barx>
Group Member

 

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

Attach Files:
   
   
Comment:
   

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 (Posted a comment)
  • -email is unavailable- added by barx (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.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code