[bug #68559] [PATCH] [grops] assertion failure when processing invalid `ps: import` device extension command

"G. Branden Robinson" <[email protected]> Fri, 24 Jul 2026 18:18:39 -0400 (EDT)
Newsgroups gmane.comp.printing.groff.bugs
Message-ID <[email protected]>
--8323329-1714636915-1784931519=:4062661
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline

URL:=0A  <https://savannah.gnu.org/bugs/?68559>=0A=0A                 Summa=
ry: [PATCH] [grops] assertion failure when processing=0Ainvalid `ps: import=
` device extension command=0A                   Group: GNU roff=0A         =
      Submitter: gbranden=0A               Submitted: Fri 24 Jul 2026 10:18=
:36 PM UTC=0A                Category: Driver grops=0A                Sever=
ity: 4 - Important=0A              Item Group: Crash/Unresponsive=0A       =
           Status: In Progress=0A                 Privacy: Public=0A       =
      Assigned to: gbranden=0A             Open/Closed: Open=0A         Dis=
cussion Lock: Unlocked=0A         Planned Release: None=0A=0A=0A    _______=
________________________________________________=0A=0AFollow-up Comments:=
=0A=0A=0A-------------------------------------------------------=0ADate: Fr=
i 24 Jul 2026 10:18:36 PM UTC By: G. Branden Robinson <gbranden>=0AExhibit:=
=0A=0A=0A$ cat ps-import-blues.groff =0Ax T ps=0Ax res 72000 1 1=0Ax init=
=0Ap 1=0AD F d=0AV 84000=0AH 72000=0Ax font 5 TR=0Af 5=0As 10000=0Am d=0AV =
384000=0AH 72000=0Ax X ps: import build/doc/gnu.eps 203 311 408 481 144000 =
119415=0Ax X ps: import build/doc/gnu.eps a 203b 311c 408d 481e 144000f 119=
415g=0Ax X ps: import build/doc/gnu.eps 203a=0Ax trailer=0AV 792000=0Ax sto=
p=0A$ ./build/grops -F ./build/font -F ./font ps-import-blues.groff=0A./bui=
ld/grops:ps-import-blues.groff:16: error: scaling unit 'grops:=0A../src/lib=
s/libgroff/errarg.cpp:121: void errprint(const char*, const errarg&,=0Acons=
t errarg&, const errarg&): Assertion `!arg1.empty()' failed.=0AAborted     =
               (core dumped) ./build/grops -F ./build/font -F=0A./font ps-i=
mport-blues.groff=0A=0A=0AProblem introduced by me in commit 9f050b7ed7, 7 =
May.=0A=0ASimple fix.=0A=0A=0Adiff --git a/src/devices/grops/ps.cpp b/src/d=
evices/grops/ps.cpp=0Aindex 7940d7d2d..d937d3615 100644=0A--- a/src/devices=
/grops/ps.cpp=0A+++ b/src/devices/grops/ps.cpp=0A@@ -1870,7 +1870,7 @@ void=
 ps_printer::do_import(char *arg, const environment=0A*env)=0A       || (p[=
1] =3D=3D ' ')=0A       || (p[1] =3D=3D '\n')) {=0A     error("scaling unit=
 '%1' not allowed in argument to"=0A-         "device extension command 'im=
port'");=0A+         "device extension command 'import'", p[1]);=0A     ret=
urn;=0A   }=0A   while ((' ' =3D=3D *p) || ('\n' =3D=3D *p))=0A=0A=0AThe re=
paired diagnostic isn't all that _helpful_, but that's a separate=0Aproblem=
 with a separate fix, forthcoming.=0A=0A=0A$ ./build/grops -F ./build/font =
-F ./font ps-import-blues.groff >/dev/null=0A./build/grops:ps-import-blues.=
groff:16: error: scaling unit ' ' not allowed in=0Aargument todevice extens=
ion command 'import'=0A./build/grops:ps-import-blues.groff:17: error: scali=
ng unit '' not allowed in=0Aargument todevice extension command 'import'=0A=
=0A=0A=0A=0A=0A=0A=0A=0A=0A    ____________________________________________=
___________=0A=0AReply to this item at:=0A=0A  <https://savannah.gnu.org/bu=
gs/?68559>=0A=0A_______________________________________________=0AMessage s=
ent via Savannah=0Ahttps://savannah.gnu.org/=0A
--8323329-1714636915-1784931519=:4062661
Content-Type: APPLICATION/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCamPkvwAKCRCqLAuaBUf3
Tl2XAQDvAqUVxoaLP5e38XnNnCnt7xGnTkkygImGWF0CxoQmVAD/Wejdz2SR7XYp
lzPMpEekwVTYMqwPDeXFlOi5jHw/JwE=
=u2oU
-----END PGP SIGNATURE-----

--8323329-1714636915-1784931519=:4062661--