hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Pujos (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCLIENT-1133) Super rare NPE in AbstractPooledConnAdapter
Date Tue, 04 Oct 2011 10:22:33 GMT
Super rare NPE in AbstractPooledConnAdapter
-------------------------------------------

                 Key: HTTPCLIENT-1133
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1133
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 4.1.1
         Environment: Android. Using repackaged httpcore 4.1.1 in an app obfuscated with Proguard.

            Reporter: Michael Pujos
            Priority: Minor


I've got 1 report of exception below:

java.lang.NullPointerException
at com.bubblesoft.org.apache.http.impl.conn.AbstractPooledConnAdapter.getRoute(SourceFile:114)
at com.bubblesoft.org.apache.http.client.protocol.RequestClientConnControl.process(SourceFile:84)
at com.bubblesoft.org.apache.http.protocol.ImmutableHttpProcessor.process(SourceFile:108)
at com.bubblesoft.org.apache.http.protocol.HttpRequestExecutor.preProcess(SourceFile:174)
at com.bubblesoft.org.apache.http.impl.client.DefaultRequestDirector.execute(SourceFile:457)

Here's the line:

  public HttpRoute getRoute() {
        AbstractPoolEntry entry = getPoolEntry();
        assertValid(entry);
        return (entry.tracker == null) ? null : entry.tracker.toRoute();    // <= NPE here
    }


Looking briefly at the code and if the stack trace is legit (it seems to be), the only possible
cause of a NPE on this line 
is if entry.tracker becomes null after the test entry.tracker == null happens.  It seems this
could happen in the case  the request is aborted and AbstractPoolEntry.shutdownEntry() is
called in between, in another thread:

  protected void shutdownEntry() {
        tracker = null;
        state = null;
    }


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message