You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2021/12/06 14:18:50 UTC
[Bug 65726] New: NullPointerException while reading request input with H2C upgraded exchanges
https://bz.apache.org/bugzilla/show_bug.cgi?id=65726
Bug ID: 65726
Summary: NullPointerException while reading request input with
H2C upgraded exchanges
Product: Tomcat 9
Version: 9.0.55
Hardware: PC
OS: Mac OS X 10.1
Status: NEW
Severity: normal
Priority: P2
Component: Connectors
Assignee: dev@tomcat.apache.org
Reporter: bclozel@vmware.com
Target Milestone: -----
See https://github.com/spring-projects/spring-boot/issues/28912 for original
issue.
It looks like trying to read the request body with an H2C-upgraded request
fails with an NPE, while this doesn't fail with H2C prior-knowledge or HTTP
1.1.
Here is the stacktrace:
java.lang.NullPointerException: Cannot invoke
"org.apache.coyote.InputBuffer.doRead(org.apache.tomcat.util.net.ApplicationBufferHandler)"
because "this.inputBuffer" is null
at org.apache.coyote.Request.doRead(Request.java:640)
at
org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:317)
at
org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer.java:600)
at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:340)
at
org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:132)
at java.base/java.io.InputStream.readNBytes(InputStream.java:409)
at java.base/java.io.InputStream.readAllBytes(InputStream.java:346)
at h2c.H2cServlet.doGet(H2cServlet.java:18)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
at
org.apache.coyote.http2.StreamProcessor.service(StreamProcessor.java:413)
at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at
org.apache.coyote.http2.StreamProcessor.process(StreamProcessor.java:74)
at org.apache.coyote.http2.StreamRunnable.run(StreamRunnable.java:35)
at
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:833)
A sample application can be found here: https://github.com/bclozel/h2c-tomcat
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 65726] NullPointerException while reading request input with H2C upgraded exchanges
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65726
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from Mark Thomas <ma...@apache.org> ---
Fixed in:
- 10.1.x for 10.1.0-M9 onwards
- 10.0.x for 10.0.15 onwards
- 9.0.x for 9.0.57 onwards
- 8.5.x for 8.5.74 onwards
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 65726] NullPointerException while reading request input with H2C upgraded exchanges
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65726
bclozel <bc...@vmware.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bclozel@vmware.com
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 65726] NullPointerException while reading request input with H2C upgraded exchanges
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65726
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Thanks for the report.
There are a couple of TODOs for support for request bodies during HTTP/1.1
upgrade in the code. The NPE is caused by the current lack of support.
I have a patch for this. Just need to do a little more testing.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org