Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 3184 invoked from network); 11 Jun 2010 12:21:37 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Jun 2010 12:21:37 -0000 Received: (qmail 70830 invoked by uid 500); 11 Jun 2010 12:21:37 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 70652 invoked by uid 500); 11 Jun 2010 12:21:35 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 70644 invoked by uid 99); 11 Jun 2010 12:21:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jun 2010 12:21:34 +0000 X-ASF-Spam-Status: No, hits=-1513.8 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jun 2010 12:21:34 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o5BCLDqC012577 for ; Fri, 11 Jun 2010 12:21:13 GMT Message-ID: <3760168.43701276258873539.JavaMail.jira@thor> Date: Fri, 11 Jun 2010 08:21:13 -0400 (EDT) From: "Sam Crawford (JIRA)" To: dev@hc.apache.org Subject: [jira] Created: (HTTPCORE-228) NullPointerException in AsyncNHttpServiceHandler on empty entity-enclosing request MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 NullPointerException in AsyncNHttpServiceHandler on empty entity-enclosing request ---------------------------------------------------------------------------------- Key: HTTPCORE-228 URL: https://issues.apache.org/jira/browse/HTTPCORE-228 Project: HttpComponents HttpCore Issue Type: Bug Components: HttpCore NIO Affects Versions: 4.0.1 Environment: [root@dev3 DCS]# uname -a Linux dev3 2.6.18-164.9.1.el5 #1 SMP Tue Dec 15 20:57:57 EST 2009 x86_64 x86_64 x86_64 GNU/Linux [root@dev3 DCS]# java -version java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b04) Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode) Reporter: Sam Crawford When a client sends an entity-enclosing request, but does not include an entity, an IOReactorException is thrown which in turns terminates the server. The cause appears to be a missing null-check around line 317 in the following code: 313 ConsumingNHttpEntity consumingEntity = connState.getConsumingEntity(); 314 315 try { 316 317 consumingEntity.consumeContent(decoder, conn); 318 if (decoder.isCompleted()) { 319 conn.suspendInput(); 320 processRequest(conn, request); 321 } The issue can be reproduced using the following: [sam@dev3 ~]$ curl -v -d "" https://proj.acmecorp.com/ * About to connect() to proj.acmecorp.com port 443 * Trying 192.168.254.22... connected * Connected to proj.acmecorp.com (192.168.254.22) port 443 * SSL certificate verify ok. > POST / HTTP/1.1 > User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 > Host: proj.acmecorp.com > Accept: */* > Content-Length: 0 > Content-Type: application/x-www-form-urlencoded > (No response is ever received) Complete stacktrace: INFO com.acmecorp.proj.http.HttpSSLServer: Connection open: [proj.acmecorp.com/192.168.254.22:47992] ERROR com.acmecorp.proj.http.HttpSSLServer: I/O error org.apache.http.nio.reactor.IOReactorException: I/O dispatch worker terminated abnormally at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:326) at com.acmecorp.proj.http.HttpSSLServer$1.run(HttpSSLServer.java:162) Caused by: java.lang.NullPointerException at org.apache.http.nio.protocol.AsyncNHttpServiceHandler.inputReady(AsyncNHttpServiceHandler.java:317) at org.apache.http.impl.nio.DefaultNHttpServerConnection.consumeInput(DefaultNHttpServerConnection.java:179) at org.apache.http.impl.nio.SSLServerIOEventDispatch.inputReady(SSLServerIOEventDispatch.java:225) at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:153) at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:314) at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:294) at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:256) at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:96) at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:556) at java.lang.Thread.run(Thread.java:619) INFO com.acmecorp.proj.http.HttpSSLServer: Shutdown HTTP server -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org