Bug#941864: cups: pxlmono fails to print on Samsung ML-2250 with 9.28rc

2019-11-26 Thread Johannes Stezenbach
I now reported it upstream:
https://bugs.ghostscript.com/show_bug.cgi?id=701949

Johannes



Bug#941864: cups: pxlmono fails to print on Samsung ML-2250 with 9.28rc

2019-11-04 Thread Johannes Stezenbach
Now confirmed (by printing the CUPS test page) that the bug
is still present in 9.50~dfsg-2, and that the workaround
patch still applies and still works.

Johannes



Bug#941864: cups: pxlmono fails to print on Samsung ML-2250 with 9.28rc

2019-10-17 Thread Johannes Stezenbach
ghostscript_9.50~dfsg-2 packages have been uploaded, with this bug
probably still unfixed and unknown to upstream.  I was not able to actually
test my printer with 9.50 yet, but changes in upstream git don't seem to
address this bug, and it's not in upstream butracker.

Question to the package maintainer: Are you going to forward
this bug to upstream or is more action needed from my side?


Thanks,
Johannes



Bug#941580: Bug#941864: cups: pxlmono fails to print on Samsung ML-2250 with 9.28rc

2019-10-08 Thread Agustin Martin
Control: reassign 941580 ghostscript
Control: forcemerge 941864 941580

On Sun, Oct 06, 2019 at 09:27:36PM +0200, Johannes Stezenbach wrote:
> 
> my Samsung ML-2250 printer stopped to work, it outputs a page with
> this error message:
> 
>   PCL6 ERROR - sb_count != -128
> POSITION : 0xbc8 (3016)
> SYSTEM   : XLPGP/xl_pattern
> LINE : 890
> VERSION  : PCL6 3.34 05-01-2004
...
> Ghostscript adds the (apparently useless, at least for PCL6)
> EOD marker as the last byte of RLE compressed data.  According to
> spec, 0x80 bytes have no meaning and should be ignored
> ("A control byte of -128 is ignored and is not included in the
> decompressed data. The byte following a control byte of 128 is
> treated as the next control byte.").  But the error message from
> my printer reads like a failed assertion for this case, i.e. the
> printer firmware is buggy.

Hi,

Similar problem seems to happen with foomatic/pxlcolor for C2550 (Canon
imageRunner iRC2380i), reported as cups-filters#941580.

Error message printed is now

PCL XL Error
Subsystem: IMAGE
Error: ExtraData
Operator:  ReadImage
Position:  876

> To test my theory I made the following change:

Tried the same change and it makes printer work again. Thanks a lot for the
info.

I am resssigning #941580 to ghostscript and merging it into #941864.

Regards

-- 
Agustin



Bug#941864: cups: pxlmono fails to print on Samsung ML-2250 with 9.28rc

2019-10-06 Thread Johannes Stezenbach
Package: ghostscript
Version: 9.28~~rc4~dfsg-1
Severity: important
Tags: upstream

Dear Maintainer,

my Samsung ML-2250 printer stopped to work, it outputs a page with
this error message:

  PCL6 ERROR - sb_count != -128
POSITION : 0xbc8 (3016)
SYSTEM   : XLPGP/xl_pattern
LINE : 890
VERSION  : PCL6 3.34 05-01-2004

It took me a while to figure out what part of the printing system
caused the failure, but after downgrading ghostscript to
9.27~dfsg-3.1 printing worked again.

For fun I decided to dig into it:

- I used "gs -sDEVICE=pxlmono -sOutputFile=t.raw -r300x300 foo.pdf"
  to generate output for 9.27 and 9.28

- I used ghostpdl/pcl/tools/pxldis.py tool from ghostscript
  source to convert it to something readable and compared it

  -> the only difference is the use of RLE compression with 9.28

- I checked the RLE encoding and it is correct
  (pcl_xl_2_0_technical_reference_rev2_2.pdf appendix Q)

Then it dawned on me that ghostscript's 0x80 "EOD" marker
is rejected by the Samsung printer firmware.

Ghostscript adds the (apparently useless, at least for PCL6)
EOD marker as the last byte of RLE compressed data.  According to
spec, 0x80 bytes have no meaning and should be ignored
("A control byte of -128 is ignored and is not included in the
decompressed data. The byte following a control byte of 128 is
treated as the next control byte.").  But the error message from
my printer reads like a failed assertion for this case, i.e. the
printer firmware is buggy.

To test my theory I made the following change:

--- ghostscript-9.28~~rc4~dfsg.orig/base/srle.c
+++ ghostscript-9.28~~rc4~dfsg/base/srle.c
@@ -329,11 +329,13 @@ run_len_0_n0_read:
 *++q = n0;
 }
 case state_eod_unmarked:
+#if 0
 if (wlimit - q < 1) {
 ss->state = state_eod_unmarked;
 goto no_output_room;
 }
 *++q = 128; /* EOD */
+#endif
 case state_eod:
 ss->run_len = 0;
 ss->state = state_0;

Success!  It make my printer work again.


Best Regards,
Johannes


-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.2.15 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=de_DE.utf-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages ghostscript depends on:
ii  libc6   2.29-2
ii  libgs9  9.28~~rc4~dfsg-1

ghostscript recommends no packages.

Versions of packages ghostscript suggests:
ii  ghostscript-x  9.28~~rc4~dfsg-1

-- no debconf information