You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Michael Pujos (JIRA)" <ji...@apache.org> on 2011/09/02 16:48:09 UTC
[jira] [Created] (HTTPCLIENT-1122) NPE in
RequestProxyAuthentication on Android
NPE in RequestProxyAuthentication on Android
--------------------------------------------
Key: HTTPCLIENT-1122
URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1122
Project: HttpComponents HttpClient
Issue Type: Bug
Components: HttpClient
Affects Versions: 4.1.1
Environment: Android 2.3.4. Using repackaged httpcore 4.1.1 in an app obfuscated with Proguard.
must be very rare as I only saw it once for > 10K users.
Reporter: Michael Pujos
Priority: Minor
Got a NPE backtrace in RequestProxyAuthentication.process().
HttpRoute route = conn.getRoute();
if (route.isTunnelled()) { <= line 88, NPE here
return;
}
There's no null check on the returned route although getRoute() can return null.
I guess it's not supposed to happen.
In the httpclient code, there's a few more calls to getRoute() without a null check on the returned route.
java.lang.NullPointerException
at com.bubblesoft.org.apache.http.client.protocol.RequestProxyAuthentication.process(SourceFile:88)
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)
at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:821)
execute
at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:755)
execute
at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:733)
execute
--
This message is automatically generated by JIRA.
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
[jira] [Resolved] (HTTPCLIENT-1122) NPE in
RequestProxyAuthentication on Android
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oleg Kalnichevski resolved HTTPCLIENT-1122.
-------------------------------------------
Resolution: Fixed
With new ManagedClientConnection implementation the route for managed connections should never be null.
Oleg
> NPE in RequestProxyAuthentication on Android
> --------------------------------------------
>
> Key: HTTPCLIENT-1122
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1122
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.1.1
> Environment: Android 2.3.4. Using repackaged httpcore 4.1.1 in an app obfuscated with Proguard.
> must be very rare as I only saw it once for > 10K users.
> Reporter: Michael Pujos
> Priority: Minor
> Fix For: 4.2 Alpha1
>
>
> Got a NPE backtrace in RequestProxyAuthentication.process().
> HttpRoute route = conn.getRoute();
> if (route.isTunnelled()) { <= line 88, NPE here
> return;
> }
> There's no null check on the returned route although getRoute() can return null.
> I guess it's not supposed to happen.
> In the httpclient code, there's a few more calls to getRoute() without a null check on the returned route.
> java.lang.NullPointerException
> at com.bubblesoft.org.apache.http.client.protocol.RequestProxyAuthentication.process(SourceFile:88)
> 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)
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:821)
> execute
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:755)
> execute
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:733)
> execute
--
This message is automatically generated by JIRA.
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
[jira] [Commented] (HTTPCLIENT-1122) NPE in
RequestProxyAuthentication on Android
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13096054#comment-13096054 ]
Oleg Kalnichevski commented on HTTPCLIENT-1122:
-----------------------------------------------
Michael,
It is the same situation as with HTTPCORE-263. I really have no idea how to reproduce the issue and suspect the problem might be a side effect of obfuscation with Proguard. I will not be able to fix the problem without a reproducer.
Oleg
> NPE in RequestProxyAuthentication on Android
> --------------------------------------------
>
> Key: HTTPCLIENT-1122
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1122
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.1.1
> Environment: Android 2.3.4. Using repackaged httpcore 4.1.1 in an app obfuscated with Proguard.
> must be very rare as I only saw it once for > 10K users.
> Reporter: Michael Pujos
> Priority: Minor
>
> Got a NPE backtrace in RequestProxyAuthentication.process().
> HttpRoute route = conn.getRoute();
> if (route.isTunnelled()) { <= line 88, NPE here
> return;
> }
> There's no null check on the returned route although getRoute() can return null.
> I guess it's not supposed to happen.
> In the httpclient code, there's a few more calls to getRoute() without a null check on the returned route.
> java.lang.NullPointerException
> at com.bubblesoft.org.apache.http.client.protocol.RequestProxyAuthentication.process(SourceFile:88)
> 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)
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:821)
> execute
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:755)
> execute
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:733)
> execute
--
This message is automatically generated by JIRA.
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
[jira] [Commented] (HTTPCLIENT-1122) NPE in
RequestProxyAuthentication on Android
Posted by "Michael Pujos (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114994#comment-13114994 ]
Michael Pujos commented on HTTPCLIENT-1122:
-------------------------------------------
Thanks for the fix.
Here's another stack trace that looks legit on an unchecked null route, that might confirm there was indeed a problem:
java.lang.NullPointerException
at com.bubblesoft.org.apache.http.client.protocol.RequestClientConnControl.process(SourceFile:86)
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)
at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:821)
execute$1650775d
at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:733)
execute
at com.bubblesoft.android.utils.AndroidHttpClient.execute(SourceFile:279)
at com.bubblesoft.android.utils.BitmapDownload.download(SourceFile:56)
at com.bubblesoft.android.utils.BitmapDownloadTask.doInBackground(SourceFile:33)
at com.bubblesoft.android.utils.BitmapDownloadTask.doInBackground(SourceFile:1)
at android.os.AsyncTask$2.call(AsyncTask.java:185)
> NPE in RequestProxyAuthentication on Android
> --------------------------------------------
>
> Key: HTTPCLIENT-1122
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1122
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.1.1
> Environment: Android 2.3.4. Using repackaged httpcore 4.1.1 in an app obfuscated with Proguard.
> must be very rare as I only saw it once for > 10K users.
> Reporter: Michael Pujos
> Priority: Minor
> Fix For: 4.2 Alpha1
>
>
> Got a NPE backtrace in RequestProxyAuthentication.process().
> HttpRoute route = conn.getRoute();
> if (route.isTunnelled()) { <= line 88, NPE here
> return;
> }
> There's no null check on the returned route although getRoute() can return null.
> I guess it's not supposed to happen.
> In the httpclient code, there's a few more calls to getRoute() without a null check on the returned route.
> java.lang.NullPointerException
> at com.bubblesoft.org.apache.http.client.protocol.RequestProxyAuthentication.process(SourceFile:88)
> 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)
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:821)
> execute
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:755)
> execute
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:733)
> execute
--
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
[jira] [Updated] (HTTPCLIENT-1122) NPE in
RequestProxyAuthentication on Android
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oleg Kalnichevski updated HTTPCLIENT-1122:
------------------------------------------
Fix Version/s: 4.2 Alpha1
The HttpRoute should never be null (a connection is always open for a particular route) _unless_ the request has been aborted in the middle of execution process. I'll try to mitigate the problem by adding a check for HttpRoute being non-null, but it would be helpful to know what exactly Httpclient was doing at the point when the exception occurred.
Oleg
> NPE in RequestProxyAuthentication on Android
> --------------------------------------------
>
> Key: HTTPCLIENT-1122
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1122
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.1.1
> Environment: Android 2.3.4. Using repackaged httpcore 4.1.1 in an app obfuscated with Proguard.
> must be very rare as I only saw it once for > 10K users.
> Reporter: Michael Pujos
> Priority: Minor
> Fix For: 4.2 Alpha1
>
>
> Got a NPE backtrace in RequestProxyAuthentication.process().
> HttpRoute route = conn.getRoute();
> if (route.isTunnelled()) { <= line 88, NPE here
> return;
> }
> There's no null check on the returned route although getRoute() can return null.
> I guess it's not supposed to happen.
> In the httpclient code, there's a few more calls to getRoute() without a null check on the returned route.
> java.lang.NullPointerException
> at com.bubblesoft.org.apache.http.client.protocol.RequestProxyAuthentication.process(SourceFile:88)
> 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)
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:821)
> execute
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:755)
> execute
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:733)
> execute
--
This message is automatically generated by JIRA.
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
[jira] [Commented] (HTTPCLIENT-1122) NPE in
RequestProxyAuthentication on Android
Posted by "Michael Pujos (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13097828#comment-13097828 ]
Michael Pujos commented on HTTPCLIENT-1122:
-------------------------------------------
Now that I think of it, the app code related to the stack trace above does indeed have plenty of HttpRequest.abort() going on while the request is executing.
I'd say it has more aborting than usual, since requests are made to download thumbnails images in a list, and requests are aborted during scrolling when previously visible list item are now invisible.
> NPE in RequestProxyAuthentication on Android
> --------------------------------------------
>
> Key: HTTPCLIENT-1122
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1122
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.1.1
> Environment: Android 2.3.4. Using repackaged httpcore 4.1.1 in an app obfuscated with Proguard.
> must be very rare as I only saw it once for > 10K users.
> Reporter: Michael Pujos
> Priority: Minor
> Fix For: 4.2 Alpha1
>
>
> Got a NPE backtrace in RequestProxyAuthentication.process().
> HttpRoute route = conn.getRoute();
> if (route.isTunnelled()) { <= line 88, NPE here
> return;
> }
> There's no null check on the returned route although getRoute() can return null.
> I guess it's not supposed to happen.
> In the httpclient code, there's a few more calls to getRoute() without a null check on the returned route.
> java.lang.NullPointerException
> at com.bubblesoft.org.apache.http.client.protocol.RequestProxyAuthentication.process(SourceFile:88)
> 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)
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:821)
> execute
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:755)
> execute
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:733)
> execute
--
This message is automatically generated by JIRA.
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
[jira] [Commented] (HTTPCLIENT-1122) NPE in
RequestProxyAuthentication on Android
Posted by "Michael Pujos (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13096085#comment-13096085 ]
Michael Pujos commented on HTTPCLIENT-1122:
-------------------------------------------
Noted, although this will be impossible to reproduce. Stack trace seems legit though. Proguard optimizations were disabled.
Recent versions of HttpComponents has been very little tested on Android as 99.999% of Android developers use the httpclient/httpcore of the platform from 2008
that has been hacked by Google.
There might be some specific bugs on Android, especially due to bad connectivity that can be lost at any time, more often that any other platform. I've had very few issues with 4.1.1 besides a few more HTTPCORE-263 crashes in automatic user crash reports (with matching backtrace lines this time).
For this specific issue, why not add null checks for calls to conn.getRoute() ?
> NPE in RequestProxyAuthentication on Android
> --------------------------------------------
>
> Key: HTTPCLIENT-1122
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1122
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.1.1
> Environment: Android 2.3.4. Using repackaged httpcore 4.1.1 in an app obfuscated with Proguard.
> must be very rare as I only saw it once for > 10K users.
> Reporter: Michael Pujos
> Priority: Minor
>
> Got a NPE backtrace in RequestProxyAuthentication.process().
> HttpRoute route = conn.getRoute();
> if (route.isTunnelled()) { <= line 88, NPE here
> return;
> }
> There's no null check on the returned route although getRoute() can return null.
> I guess it's not supposed to happen.
> In the httpclient code, there's a few more calls to getRoute() without a null check on the returned route.
> java.lang.NullPointerException
> at com.bubblesoft.org.apache.http.client.protocol.RequestProxyAuthentication.process(SourceFile:88)
> 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)
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:821)
> execute
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:755)
> execute
> at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.createHttpProcessor(SourceFile:733)
> execute
--
This message is automatically generated by JIRA.
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