Bug 995 - exception in client during GRAM callback
: exception in client during GRAM callback
Status: RESOLVED FIXED
: CoG jglobus
gram
: 1.1a
: All All
: P2 normal
: ---
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2003-06-11 18:36 by
Modified: 2005-12-05 17:30 (History)


Attachments


Note

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


Description From 2003-06-11 18:36:27
For just one of our SGI systems running globus 2.0, I'm getting an exception
when the server is sending status data during a callback (don't ask me why it's
just this one system - I have no idea). The exception is:

General error: 
java.lang.ArrayIndexOutOfBoundsException: 0
        at org.globus.gsi.gssapi.net.GssInputStream.read(GssInputStream.java:62)
        at org.globus.util.http.HttpResponse.readLine(HttpResponse.java:41)
        at org.globus.util.http.HttpResponse.parse(HttpResponse.java:92)
        at org.globus.util.http.HttpResponse.<init>(HttpResponse.java:29)
        at org.globus.gram.internal.GatekeeperReply.<init>(GatekeeperReply.java:23)
        at
org.globus.gram.internal.CallbackResponse.<init>(CallbackResponse.java:12)
        at org.globus.gram.GramCallbackHandler.run(CallbackHandler.java:149)
        at java.lang.Thread.run(Thread.java:536)

The following change fixes this problem:

In org.globus.gsi.gssapi.net.GssInputStream, modify the hasData function to be:

    protected boolean hasData() throws IOException { 
        if (this.buff == null) { 
            return false; 
        } 
        if (this.buff.length == this.index) { 
            readMsg(); 
        } 
        // return (this.buff != null); // how can this.buff == null?
        return (this.buff.length != this.index); 
    } 

All I did was change the final return test, which I didn't quite understand
because I didn't dive into the subclasses of GssInputStream to see what they do
in readMsg(). This change does seem to solve my problem, though.
------- Comment #1 From 2003-06-12 16:01:21 -------
It turns out that this.buff is sometimes null after readMsg(). I now have
hasData() as:

    protected boolean hasData() throws IOException { 
        if (this.buff == null) { 
            return false; 
        } 
        if (this.buff.length == this.index) { 
            readMsg(); 
        }
        if (this.buff == null) { 
            return false; 
        } 
        return (this.buff.length != this.index);
    }
------- Comment #2 From 2003-06-16 17:22:09 -------
This is now fixed in cvs.