Bug 957781 - Exception in thread "main" java.lang.IllegalArgumentException: lowerBound may not be less than 1
Summary: Exception in thread "main" java.lang.IllegalArgumentException: lowerBound may...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gcc
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-29 14:06 UTC by Dagmar Prokopová
Modified: 2014-07-01 22:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-28 11:47:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dagmar Prokopová 2013-04-29 14:06:32 UTC
Description of problem:
I have the following test program:

import javax.print.attribute.standard.PrinterIsAcceptingJobs;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;


class listprinters {


        public static void main(String[] argv) {
                PrintService ss[] = PrintServiceLookup.lookupPrintServices(null,null);
                System.out.println("found " + ss.length + " services");
                for(int i = 0; i < ss.length; i++) {
                        javax.print.attribute.Attribute att[] = ss[i].getAttributes().toArray();
                        System.out.println("found " + att.length + " attributes for " + ss[i].getName());
                        for(int j = 0; j < att.length; j++)
                                System.out.println(ss[i].getName() + "/" + att[j].getName() +
                                        (att[j].equals(PrinterIsAcceptingJobs.ACCEPTING_JOBS) ?
                                        "" : "not") + " accepting jobs"
                                );
                }
        }
}


When I build a binary and run it, I get the following error:

Exception in thread "main" java.lang.IllegalArgumentException: lowerBound may not be less than 1
   at javax.print.attribute.standard.JobKOctetsSupported.<init>(libgcj.so.13)
   at gnu.javax.print.ipp.IppResponse$ResponseReader.parseAttributes(libgcj.so.13)
   at gnu.javax.print.ipp.IppResponse$ResponseReader.parseResponse(libgcj.so.13)
   at gnu.javax.print.ipp.IppResponse.setResponseData(libgcj.so.13)
   at gnu.javax.print.ipp.IppRequest.send(libgcj.so.13)
   at gnu.javax.print.ipp.IppPrintService.getPrinterAttributes(libgcj.so.13)
   at gnu.javax.print.ipp.IppPrintService.<init>(libgcj.so.13)
   at gnu.javax.print.ipp.IppMultiDocPrintService.<init>(libgcj.so.13)
   at gnu.javax.print.CupsPrintService.<init>(libgcj.so.13)
   at gnu.javax.print.CupsServer.getAllPrinters(libgcj.so.13)
   at gnu.javax.print.CupsPrintServiceLookup.getPrintServices(libgcj.so.13)
   at gnu.javax.print.CupsPrintServiceLookup.getPrintServices(libgcj.so.13)
   at javax.print.PrintServiceLookup.lookupPrintServices(libgcj.so.13)
   at listprintersOne.main(listprintersOne)


This happens only on rhel7, it did not occure on rhel6 neither rhel5. Is this intended or is it a bug?


Version-Release number of selected component (if applicable):
gcc-java-4.7.2-8.el7.x86_64
cups-1.5.4-22.el7.x86_64
cups-libs-1.5.4-22.el7.x86_64
libgcj-devel-4.7.2-8.el7.x86_64
libgcj-4.7.2-8.el7.x86_64



How reproducible:
Always

Steps to Reproduce:
1. service cups start
2. create a listprinters.java file with the simple test code
3. build a binary  gcj -o listprinters --main=listprinters ./listprinters.java
4. run the binary
  
Actual results:
should not throw an exception

Expected results:
an exception is thrown

Additional info:

Comment 3 Dagmar Prokopová 2013-04-29 15:56:24 UTC
I could not find gcc-java-4.8 (at least not in brew). Can you give me a hint what package do I need instead to build java file. Or am I just looking for it at a wrong place?

Comment 4 Jakub Jelinek 2013-04-29 16:18:58 UTC
Ah right, forgot that, %if 0%{?rhel} >= 7 then we don't build gcj at all.
Thus nothing to test for RHEL7 then...
Though if it doesn't work with gcc 4.8.0, perhaps something to investigate for F19+ which still enables gcj.

Comment 5 Jakub Jelinek 2013-08-28 11:47:50 UTC
Not a bug in RHEL7 then.


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