Error about Ghostscript

Kurt Pfeifle k1pfeifle at gmx.net
Thu Oct 18 17:08:05 PDT 2007


chris wrote:
>> chris wrote:
>>
>>>>> Thanks , I follow your example and I can get the file should be fed to
>>>>> the gs command line.
>>>> No, you got it wrong.
>>>>
>>>> The file you get from
>>>>
>>>>   PPD=/etc/cups/ppd/isc2428ps.ppd /usr/lib/cups/filter/texttops [....]
>>>>
>>>> is "output-from-pstops.prn". And it is meant to be fed to "foomatic-rip",
>>>> not gs. If you feed it to foomatic-rip like the next command above shows:
>>>>
>>>>   PPD=/etc/cups/ppd/isc2428ps.ppd /usr/lib/cups/filter/foomatic-rip 1 2 3 4 5 output-from-pstops.prn
>>>>
>>>> then foomatic-rip will run gs on behalf of you. However, it is important
>>>> that you run these commands as the same user the backends do run as when
>>>> started by CUPS. So you may need to do a "su - lp" (from being root, and
>>>> make sure that the su command will really let you change user...)
>>>>
>>>> Only then you can assume to have tested the chain manually within an en-
>>>> vironment that resembles the real CUPS processes. The *.err messages may
>>>> give you more hints about what is wrong.
>>>>
>>>> BTW, here is another thought:
>>>>
>>>>   CUPS usually uses a "temp" dir in /var/spool/cups/temp to temporarily
>>>>   store temp files
>>>>
>>>> Grep for "TMPDIR" in your debug level log file to see where your CUPS does
>>>> look for it.
>>>>
>>>> You should make sure it exists and your user "lp" has write and read access
>>>> to it. You may want to cd to that dir to run the manual commands.
>>>>
>>>> You also may want to set additional env vars (as can be seen in error_log
>>>> when grepping for "envp["
>>>>
>>>>> If I manully run gs and lp the printer works
>>>>> fine.   If they run in cups automately, I has this error.
>>>> Don't run gs manually, run foomatic-rip manually. And do it as user
>>>> lp. And make it output its files to $TMPDIR.
>>>>
>>>>
>>>> --
>>>> Kurt Pfeifle
>>>> System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
>>>> Infotec Deutschland GmbH  .....................  Hedelfinger Strasse 58
>>>> A RICOH Company  ...........................  D-70327 Stuttgart/Germany
>>>
>>>
>>>
>>> I first run
>>>   PPD=/etc/cups/ppd/isc2428ps.ppd /usr/lib/cups/filter/texttops [....]
>>> and got the  "output-from-pstops.prn".
>>>
>>> next I run
>>>   PPD=/etc/cups/ppd/isc2428ps.ppd /usr/lib/cups/filter/foomatic-rip 1 2 3 4 5 output-from-pstops.prn
>>>
>>> Then the error :
>>>  <job data>
>>> D [16/Oct/2007:20:36:21 +0000] [Job 1]
>>
>> I don't believe that these two things are related:
>>
>>   (a) shell your command above (which misses to take into account a few hints
>>       given by me anyway)
>>
>>   (b) the output you quote (this output is written to error_log)
>>
>> If you ran a command like the above, you'll not get output in the error_log,
>> but on the shell's stdout/stderr instead. And you don't get the prefixes with
>> loglevel code, date+time and job number either....
>>
>> You should run
>>
>> PPD=/etc/cups/ppd/isc2428ps.ppd \
>>      TMPDIR=/var/spool/cups/temp \
>>      /usr/lib/cups/filter/foomatic-rip 1 2 3 4 5 output-from-pstops.prn
>>
>>
>>> D [16/Oct/2007:20:36:21 +0000] [Job 1] renderer PID kid4=1850
>>> D [16/Oct/2007:20:36:21 +0000] [Job 1] renderer command: gs -q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=ijs -sIjsServer=hpijs -sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="deskjet 3600" -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792 -r300 -sIjsParams=Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=1 -dIjsUseOutputFD -sOutputFile=- -
>>> D [16/Oct/2007:20:36:23 +0000] [Job 1] foomatic-gswrapper: gs '-sstdout=%stderr' '-dBATCH' '-dPARANOIDSAFER' '-dQUIET' '-dNOPAUSE' '-sDEVICE=ijs' '-sIjsServer=hpijs' '-sDeviceManufacturer=HEWLETT-PACKARD' '-sDeviceModel=deskjet 3600' '-dDEVICEWIDTHPOINTS=612' '-dDEVICEHEIGHTPOINTS=792' '-r300' '-sIjsParams=Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=1' '-dIjsUseOutputFD' '-sOutputFile=%stdout' '-'
>>> D [16/Oct/2007:20:36:24 +0000] [Job 1]
>>> D [16/Oct/2007:20:36:24 +0000] [Job 1] Closing renderer
>>> D [16/Oct/2007:20:36:24 +0000] [Job 1] unable to create Job object err=3
>>> D [16/Oct/2007:20:36:24 +0000] [Job 1] Segmentation fault
>>> D [16/Oct/2007:20:36:26 +0000] [Job 1] Error: /ioerror in --.outputpage--
>>> D [16/Oct/2007:20:36:26 +0000] [Job 1] Operand stack:
>>>
>>>
>>> and I find the "unable to create Job object err=3" is printed by hpijs...  and the return value indicate when alloc mem failed..
>>> But I have very enough mem , and if run gs derectly instead of foomatic-rip , there will be no error...
>>> I'm so confused...
>> Did you build the hpijs yourself?
>>
>>> BTW: my system doesn't has usr lp.
>> When building CUPS from sources, the './configure' command may pick up
>> another suitable user and use that.
>>
>> --
>> Kurt Pfeifle
>> System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
>> Infotec Deutschland GmbH  .....................  Hedelfinger Strasse 58
>> A RICOH Company  ...........................  D-70327 Stuttgart/Germany
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Sorry ,
> PPD=/etc/cups/ppd/isc2428ps.ppd \
>       TMPDIR=/var/spool/cups/temp \
>       /usr/lib/cups/filter/foomatic-rip 1 2 3 4 5 output-from-pstops.prn
> 
> I run this also the error. because the error message is the same, so I paste the error_log from cups.

OK, so we now know more surely where to locate the error. If it's not
foomatic-rip (unlikely), its a command called by foomatic-rip (gs; and
gs calls hpijs).

But why is it that if you call *gs* on the commandline with same para-
meters as in log... all works well ??

> I build hpijs by my self
> I think when run hpijs , some error happen..
> 
> and I  debug the code
> and in halftoner.cpp about line 200
> If I run gs the PlaneSize is 600. But if I run foomatic-rip and
> foomatic-rip call gs, then here the PlaneSize is 0 ... So
> originalKData == NULL and return mem error...
> But from the log the args fed to fs is the same,   why has this deference...
> 
> 
> 
>    PlaneSize= (OutputWidth[0] + 7) / 8;
>    originalKData = (BYTE*) pSS->AllocMem(PlaneSize);
>    if (originalKData == NULL)
>    {
>         fprintf(stderr,"##5 alloc mem error size %d\n",PlaneSize);
>        goto MemoryError;
>    }
>    memset(originalKData, 0, PlaneSize);
>    return;
> 

I think this is now something you'll have to take up with the hpijs
folks (at http://hplip.sf.net/)


-- 
Kurt Pfeifle
System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
Infotec Deutschland GmbH  .....................  Hedelfinger Strasse 58
A RICOH Company  ...........................  D-70327 Stuttgart/Germany




More information about the cups mailing list