Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350642

Summary: SslSelectChannelEndPoint.unwrap causes java.lang.IllegalArgumentException: getIndex>putIndex: 23>0
Product: [RT] Jetty Reporter: Joakim Erdfelt <joakim.erdfelt>
Component: clientAssignee: Greg Wilkins <gregw>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: jetty-inbox, mgorovoy
Version: 7.4.2   
Target Milestone: 7.2.x   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Console Build Output for jetty-client (mvn clean install)
none
New build output /jetty-client/
none
Build log after changes none

Description Joakim Erdfelt CLA 2011-06-28 19:45:11 EDT
Created attachment 198780 [details]
Console Build Output for jetty-client (mvn clean install)

Various tests cases in jetty-client trigger many of the following exception during testing on OSX.

java.lang.IllegalArgumentException: getIndex>putIndex: 23>0
	at org.eclipse.jetty.io.AbstractBuffer.setPutIndex(AbstractBuffer.java:534)
	at org.eclipse.jetty.io.nio.ChannelEndPoint.fill(ChannelEndPoint.java:197)
	at org.eclipse.jetty.io.nio.SslSelectChannelEndPoint.unwrap(SslSelectChannelEndPoint.java:695)
	at org.eclipse.jetty.io.nio.SslSelectChannelEndPoint.fill(SslSelectChannelEndPoint.java:346)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:289)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
	at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:535)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
	at java.lang.Thread.run(Thread.java:680)

Build Info:

$ mvn --version
Apache Maven 3.0.3 (r1075438; 2011-02-28 10:31:09-0700)
Maven home: /Users/joakim/Java/maven/apache-maven-3.0.3
Java version: 1.6.0_24, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.6.8", arch: "x86_64", family: "mac"
Comment 1 Greg Wilkins CLA 2011-06-28 22:52:38 EDT
I've found an issue where close was being called from within a try{}finally{} that was manipulating the buffer pointers.  

Can you try trunk and see if you still get this exception.
Comment 2 Joakim Erdfelt CLA 2011-06-28 23:48:19 EDT
Created attachment 198783 [details]
New build output /jetty-client/

Adding new build-2.log console output of /jetty-client/ build (mvn clean install) of current trunk.

Still have the IllegalArgumentException's (and a new IllegalStateException)
Comment 3 Michael Gorovoy CLA 2011-06-29 20:03:50 EDT
Created attachment 198870 [details]
Build log after changes
Comment 4 Michael Gorovoy CLA 2011-08-30 15:03:19 EDT
I have just ran the build on Mac OS X again and there are no more exceptions like this in the build log. Resolving this ticket now.