RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 618258 - Printing from java fails when job-state-reasons contains printer-stopped
Summary: Printing from java fails when job-state-reasons contains printer-stopped
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: gcc
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-26 14:06 UTC by Tim Waugh
Modified: 2011-05-19 13:57 UTC (History)
4 users (show)

Fixed In Version: gcc-4.4.5-5.el6
Doc Type: Bug Fix
Doc Text:
Previously, if a Java application built with gcj attempted to submit a print job to a print queue that was disabled, the process would enter a busy loop. This update fixes this issue by first checking if the print queue is null before attempting to send it a print job.
Clone Of:
Environment:
Last Closed: 2011-05-19 13:57:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
print.java (2.05 KB, text/plain)
2010-07-26 14:07 UTC, Tim Waugh
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0663 0 normal SHIPPED_LIVE gcc bug fix update 2011-05-19 09:37:21 UTC

Description Tim Waugh 2010-07-26 14:06:39 UTC
Description of problem:
The attached source file, built using gcj, goes into a busy loop after submitting the print job to a print queue that is not enabled.

Version-Release number of selected component (if applicable):
gcc-java-4.4.4-12.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create a print queue and disable it (or: plug in a USB printer, switch it on, then after the queue is created switch it off again)
2. gcj -o print --main=print print.java
3. ./print
  
Actual results:
After displaying the name of the printer, the job is submitted but then the process goes into a busy loop.

Expected results:
No busy loop, process exits.

Additional info:
Found while investigating bug #595852.

Comment 1 Tim Waugh 2010-07-26 14:07:09 UTC
Created attachment 434427 [details]
print.java

Comment 2 Tim Waugh 2010-07-26 14:07:43 UTC
When examining it under gdb it seems to be due to the 'printer-stopped' string in the job-state-reasons attribute.

Comment 4 Andrew Haley 2010-07-30 10:44:48 UTC
Fixed by:

2010-07-30  Andrew Haley  <aph>

        * javax/print/attribute/standard/JobStateReasons.java (add): Fix
        infinite recursion with call to super.

Index: classpath/javax/print/attribute/standard/JobStateReasons.java
===================================================================
--- classpath/javax/print/attribute/standard/JobStateReasons.java       (revision 159065)
+++ classpath/javax/print/attribute/standard/JobStateReasons.java       (working copy)
@@ -129,7 +129,7 @@
     if (o == null)
       throw new NullPointerException("reason is null");  
     
-    return add(o);
+    return super.add(o);
   }
   
   /**

Comment 5 Jakub Jelinek 2010-07-30 10:48:00 UTC
Thanks, reassigning to self to actually backport this for RHEL 6.1.

Comment 7 Jakub Jelinek 2010-08-11 13:17:44 UTC
Seems Andrew has backported this to branches/gcc-4_{4,5}-branch/ already (and other libjava fixes too), so it will make it into the 4.[45]-RH branches whenever the new releases are prepared for them (as that includes merging from corresponding upstream branch).

Comment 10 Ryan Lerch 2011-04-20 04:29:57 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
libgcj printing has been fixed.

Comment 13 Ryan Lerch 2011-05-05 03:39:00 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-libgcj printing has been fixed.+Previously, if a Java application built with gcj attempted to submit a print job to a print queue that was disabled, the process would enter a busy loop.  This update fixes this issue by first checking if the print queue is null before attempting to send it a print job.

Comment 14 errata-xmlrpc 2011-05-19 13:57:44 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0663.html


Note You need to log in before you can comment on or make changes to this bug.