Bug 696767

Summary: GhostScript Does not Report Message to CUPS as Error When It Runs out of Memory
Product: Ghostscript Reporter: chwongie-gs
Component: CUPS driverAssignee: Till Kamppeter <till.kamppeter>
Status: RESOLVED INVALID    
Severity: normal CC: htl10, mike, twaugh
Priority: P4    
Version: 9.05   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---

Description chwongie-gs 2016-05-10 08:46:25 UTC
Environment:
    Debian Wheezy
    CUPS 1.5.3
    Gutenprint v5.2.9

Steps to reproduce:
    1. (Optional)Disable swap
    2. Somehow fill the RAM of the machine until it has almost no free RAM.
    3. Print anything(e.g. test page), causing the system to run out of memory

Result:

It printed nothing, nor the printer received any print command.

In /var/log/cups/access_log:

localhost - - [10/May/2016:14:37:12 +0800] "POST /printers/Canon_MG2400_series HTTP/1.1" 200 422 Print-Job successful-ok

In /var/log/cups/error_log:

D [10/May/2016:14:37:20 +0800] [Job 136] Last OS error: Cannot allocate memory
D [10/May/2016:14:37:20 +0800] [Job 136] GPL Ghostscript 9.05: Unrecoverable error, exit code 1

Notice that the log level of the message is "debug" instead of "error", making debugging this issue much more difficult.

The error messages above should have "ERROR:" prefix so that the level of the message above would become "error".

See also:
https://github.com/apple/cups/issues/4824
Comment 1 Till Kamppeter 2016-05-11 19:20:03 UTC
There seems to be nothing wrong with Ghostscript. Ghostscript errors out due to lack of memory. Problem here is most probably that gstoraster, part of cups-filters, does not exit with an error code. For this you have already reported the bug here:

https://bugs.linuxfoundation.org/show_bug.cgi?id=1354