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

                 Summary: [PATCH] [grops] assertion failure when processing
invalid `ps: import` device extension command
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Fri 24 Jul 2026 10:18:36 PM UTC
                Category: Driver grops
                Severity: 4 - Important
              Item Group: Crash/Unresponsive
                  Status: In Progress
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Unlocked
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fri 24 Jul 2026 10:18:36 PM UTC By: G. Branden Robinson <gbranden>
Exhibit:


$ cat ps-import-blues.groff 
x T ps
x res 72000 1 1
x init
p 1
D F d
V 84000
H 72000
x font 5 TR
f 5
s 10000
m d
V 384000
H 72000
x X ps: import build/doc/gnu.eps 203 311 408 481 144000 119415
x X ps: import build/doc/gnu.eps a 203b 311c 408d 481e 144000f 119415g
x X ps: import build/doc/gnu.eps 203a
x trailer
V 792000
x stop
$ ./build/grops -F ./build/font -F ./font ps-import-blues.groff
./build/grops:ps-import-blues.groff:16: error: scaling unit 'grops:
../src/libs/libgroff/errarg.cpp:121: void errprint(const char*, const errarg&,
const errarg&, const errarg&): Assertion `!arg1.empty()' failed.
Aborted                    (core dumped) ./build/grops -F ./build/font -F
./font ps-import-blues.groff


Problem introduced by me in commit 9f050b7ed7, 7 May.

Simple fix.


diff --git a/src/devices/grops/ps.cpp b/src/devices/grops/ps.cpp
index 7940d7d2d..d937d3615 100644
--- a/src/devices/grops/ps.cpp
+++ b/src/devices/grops/ps.cpp
@@ -1870,7 +1870,7 @@ void ps_printer::do_import(char *arg, const environment
*env)
       || (p[1] == ' ')
       || (p[1] == '\n')) {
     error("scaling unit '%1' not allowed in argument to"
-         "device extension command 'import'");
+         "device extension command 'import'", p[1]);
     return;
   }
   while ((' ' == *p) || ('\n' == *p))


The repaired diagnostic isn't all that _helpful_, but that's a separate
problem with a separate fix, forthcoming.


$ ./build/grops -F ./build/font -F ./font ps-import-blues.groff >/dev/null
./build/grops:ps-import-blues.groff:16: error: scaling unit ' ' not allowed in
argument todevice extension command 'import'
./build/grops:ps-import-blues.groff:17: error: scaling unit '' not allowed in
argument todevice extension command 'import'









    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to