Closed michaelrsweet closed 17 years ago
CUPS.org User: kssingvo.suse
Before I forget to mention:
CUPS.org User: kssingvo.suse
I noticed that this is 1.2.12 related, and in 1.3.0 fixed. Sorry.
CUPS.org User: kssingvo.suse
Umpf. Sorry. I noticed now, that I accidently overwrote my testfile. :( Issue is still present in 1.3.0. :(
CUPS.org User: mike
I can't reproduce this on my machine with current 1.3.x or 1.4.x.
Does the "testfile" unit test program show any problems (located in the "cups" subdirectory) after you build CUPS?
CUPS.org User: kssingvo.suse
No, "testfile" doesn't report anything special.
But (!) the output of "testfile" is incomplete. It ends in the reported line 1869, and everything past "*FoomaticRIPOptionSet" is missing (= around 10 lines).
CUPS.org User: mike
What version of zlib are you using on that system?
CUPS.org User: pipitas
WORKSFORME.
hjssuse:~ > rpm -qif $(which cupstestppd) Name : cups Relocations: (not relocatable) Version : 1.2.11 Vendor: openSUSE Build Service Release : 7.1 Build Date: Thu 10 May 2007 02:50:39 PM CEST Install Date: Thu 05 Jul 2007 03:08:06 PM CEST Build Host: build09 Group : Hardware/Printing Source RPM: cups-1.2.11-7.1.src.rpm Size : 10798222 License: GNU General Public License (GPL) Signature : DSA/SHA1, Thu 10 May 2007 02:53:45 PM CEST, Key ID 3b3011b76b9d6523
hjssuse:~ > rpm -q zlib zlib-1.2.3-33
Kurt Pfeifle System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS Infotec Deutschland GmbH ..................... Hedelfinger Strasse 58 A RICOH Company ........................... D-70327 Stuttgart/Germany
CUPS.org User: mike
Also, if you run "testfile" without any arguments it will do some read/write tests to eliminate possible data loss/corruption issues.
I'd still like to know what version of zlib you have, along with the arch in case this is specific to a version of zlib or processor...
CUPS.org User: kssingvo.suse
Running zlib-1.2.3 Last changes were done in July 2005.
CUPS.org User: kssingvo.suse
A few additional thoughts:
CUPS.org User: mike
What do you get if you run "testfile" by itself?
I haven't have any reports of problems since early in the 1.2 betas, and it sounds like Kurt is running the same SuSE release and also doesn't have the same problem. I would also expect problems with the help index (/var/cache/cups/help.index) if there is a problem with our interface with zlib.
What version of gzip are you using?
CUPS.org User: kssingvo.suse
./testfile cupsFileOpen(write): FAIL (Permission denied) cupsFileOpen(read): FAIL (No such file or directory)
cupsFileOpen(write compressed): FAIL (Permission denied) cupsFileOpen(read): FAIL (No such file or directory) cupsFileFind: PASS (/bin/cat)
(please specify more details if I got it wrong)
The help index isn't mentioned in /var/log/cups/error_log*
I can run "cupstestppd" in a chroot of SUSE 10.0 with cups-1.1.23.
cupstestppd Infotec-ISC_2432_PS.ppd.gz
I can run "cupstestppd" in a chroot of openSUSE 10.2 with cups-1.2.7
cupstestppd Infotec-ISC_2432_PS.ppd.gz Infotec-ISC_2432_PS.ppd.gz: FAIL FAIL Unable to open PPD file - Missing value string on line 1869.
gzip version is: 1.3.12 in current system gzip version is: 1.3.5 in openSUSE 10.2 gzip version is: 1.3.5 in SUSE 10.0
zlib is in every system: 1.2.3
CUPS.org User: kssingvo.suse
Ah... and Kurt seems to be running a late alpha version of upcoming openSUSE 10.3. I'm running beta2 of openSUSE 10.3
(Note: 1.3.0 came after feature freeze for openSUSE 10.3. So we will ship 1.2.12 in this product. Nevertheless I'm able to test with 1.3.0 :-)
CUPS.org User: mike
Yes, run "testfile" with no arguments. However, you need write access to that directory to make the tests worthwhile/useful.
I'm testing on Mac OS X 10.5 and Fedora 7, both with gzip 1.3.x and zlib 1.2.3 and both on 32-bit Intel processors.
Have you tested this on other machines, just in case there is a problem with yours?
CUPS.org User: mike
Also, can you post your gzip'd copy of the PPD file?
CUPS.org User: mike
Hmm, even that file works for me...
Any chance you are using a new version of GCC, or some heavy optimization flags?
CUPS.org User: kssingvo.suse
After I did several tests, like trying to run cupstestppd within a clean openSUSE 10.2 system (booted my machine accordinly), etc. I didn't find anything.
But now I found the cause of the trouble: it's the file itself. There is no final linebreak (vim says: [noeol]) at the end of the file. If I add this final linebreak, and compress it again, it passes the test as expected.
So, how can we improve cupstestppd here? Or is it a zlib issue? Do you need additional information, like debug output from cups library?
CUPS.org User: mike
This will probably end up being an issue in the cupsFile APIs; I'll add another test to testfile.c to see if I can duplicate the problem with a final line without CR or LF.
CUPS.org User: kssingvo.suse
If this helps: the related code where the fp->eof in cups/file.c is marked as true is this: if (tcrc != fp->crc) { / * Bad CRC, mark end-of-file... / fp->eof = 1;
return (-1);
}
Adding some debug output, I see that tcrc=-1600534055, and crc=0 (32bit machine)
CUPS.org User: mike
Hmm, adding a partial line test in testfile.c doesn't reproduce the problem, but I am finally able to reproduce it with your test file...
CUPS.org User: mike
OK, turns out we were not computing the CRC as we read the data, leading to this error. Fix coming soon...
CUPS.org User: mike
Fixed in Subversion repository.
"str2510.patch":
--- testfile.c (revision 6961) +++ testfile.c (working copy) @@ -16,7 +16,8 @@ *
Contents: *
/ @@ -149,6 +150,8 @@ unsigned char readbuf[8192], /* Read buffer / writebuf[8192]; / Write buffer / int byte; / Byte from file /
/* @@ -253,11 +256,11 @@
fputs("cupsFileWrite(): ", stdout);
if (i >= 10000) puts("PASS"); else { @@ -266,6 +269,20 @@ }
/*
@@ -405,13 +422,13 @@
fputs("cupsFileRead(): ", stdout);
if (i >= 10000) puts("PASS"); else if (byte > 0) { @@ -431,6 +448,26 @@ }
/*
--- file.c (revision 6961) +++ file.c (working copy) @@ -1207,7 +1207,7 @@ if (fp->ptr >= fp->end) if (cups_fill(fp) <= 0) {
DEBUG_printf((" cups_fill() returned -1, total=%d\n", (int)total));
if (total > 0)
return ((ssize_t)total);
@@ -1235,7 +1235,7 @@
DEBUG_printf((" total=%d\n", (int)total));
return ((ssize_t)total); } @@ -1703,6 +1703,7 @@ { ssize_t bytes; /* Number of bytes read */
@@ -1921,7 +1922,13 @@ fp->stream.next_out = (Bytef *)fp->buf; fp->stream.avail_out = sizeof(fp->buf);
if (inflate(&(fp->stream), Z_NO_FLUSH) == Z_STREAM_END)
if (status == Z_STREAM_END)
{ /*
DEBUG_printf(("cups_fill: tcrc=%08x, fp->crc=%08x\n",
(unsigned int)tcrc, (unsigned int)fp->crc));
+ fp->eof = 1;
return (-1);
Version: 1.3.0 CUPS.org User: kssingvo.suse
Download this PPD file: http://www.linuxprinting.org/download/PPD/Infotec/PS/Infotec-ISC_2432_PS.ppd
compress it: gzip -9 Infotec-ISC_2432_PS.ppd
run cupstestppd:
cupstestpppd Infotec-ISC_2432_PS.ppd.gz Infotec-ISC_2432_PS.ppd.gz: FAIL FAIL Unable to open PPD file - Missing value string on line 1869.
REF: Page 20, section 3.4.
Well, the issue is not that the file cannot be opened: a specific line number is given, so program is able to open it.
I got the feeling that this depends on the size before/after compression and that not enough memory gets allocated for such a compressed file. But I'm not sure.