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 2024/11/27 13:48:33 UTC
[Bug 69479] New: The HTTP2 header data is confused in H2C, resulting in parsing failure
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
Bug ID: 69479
Summary: The HTTP2 header data is confused in H2C, resulting in
parsing failure
Product: Tomcat 9
Version: 9.0.65
Hardware: All
OS: Linux
Status: NEW
Severity: critical
Priority: P2
Component: Connectors
Assignee: dev@tomcat.apache.org
Reporter: qingdaoheze@163.com
Target Milestone: -----
We are using H2C mode. When it runs for some time, there are several exception
as below. Meanwhile, there is another thread which processed the request header
correctly. I guess that the constant table may go wrong. The problem doesn't
appear in the version 9.0.48.
An exception has been raised by
Name:tomcat-exec-55,ThreadId:128,Message:java.lang.NumberFormatException: For
input string: "application/json; charset=UTF-8"
at
java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
at java.base/java.lang.Long.parseLong(Long.java:711)
at java.base/java.lang.Long.parseLong(Long.java:836)
at org.apache.tomcat.util.buf.MessageBytes.getLong(MessageBytes.java:559)
at org.apache.coyote.Request.getContentLengthLong(Request.java:450)
at org.apache.coyote.http2.Stream.receivedData(Stream.java:564)
at
org.apache.coyote.http2.Http2UpgradeHandler.startRequestBodyFrame(Http2UpgradeHandler.java:1557)
at
org.apache.coyote.http2.Http2AsyncUpgradeHandler.startRequestBodyFrame(Http2AsyncUpgradeHandler.java:41)
at org.apache.coyote.http2.Http2Parser.readDataFrame(Http2Parser.java:173)
at
org.apache.coyote.http2.Http2AsyncParser$FrameCompletionHandler.completed(Http2AsyncParser.java:248)
at
org.apache.coyote.http2.Http2AsyncParser$FrameCompletionHandler.completed(Http2AsyncParser.java:164)
at
org.apache.tomcat.util.net.SocketWrapperBase$VectoredIOCompletionHandler.completed(SocketWrapperBase.java:1122)
at
org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper$NioOperationState.run(NioEndpoint.java:1702)
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:840)
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
--- Comment #4 from Christopher Schultz <ch...@christopherschultz.net> ---
Are you able to use a recent version of Tomcat 9.0.x? You could run that and
see if the intermittent problems disappear.
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|critical |normal
--- Comment #2 from Mark Thomas <ma...@apache.org> ---
No response in almost 48 hours. Clearly not "critical". Reducing severity to
normal.
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |NEW
--- Comment #13 from Mark Thomas <ma...@apache.org> ---
I agree with Rémy that the proposed fix doesn't look right.
We will take a look at the test case (thank you for that) and update the issue
when we have some useful information to report.
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |NEEDINFO
--- Comment #9 from Mark Thomas <ma...@apache.org> ---
We still need a test case and without one this is still going to get resolved
as "works for me". An incomplete stack trace is not a test case.
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
--- Comment #10 from Thomas <qi...@163.com> ---
Please see the repo for the test case to reproduce the problem.
https://github.com/qingdaoheze/tomcat-header-mix
One solution to resolve the problem:
https://github.com/qingdaoheze/tomcat/pull/1
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
--- Comment #12 from Thomas <qi...@163.com> ---
OK, so you will give the better solution, right?
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
--- Comment #11 from Remy Maucherat <re...@apache.org> ---
(In reply to Thomas from comment #10)
> Please see the repo for the test case to reproduce the problem.
> https://github.com/qingdaoheze/tomcat-header-mix
>
> One solution to resolve the problem:
> https://github.com/qingdaoheze/tomcat/pull/1
This is wrong, so this change will not be considered.
However, your investigations might demonstrate that the current implementation
of removeHeader has bad side effects.
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
Thomas <qi...@163.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |qingdaoheze@163.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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
9.0.65 is over two years old. Please provide the simplest possible test case
that recreates this issue with the current 9.0.x release (9.0.97 as I write
this).
Without the ability to recreate the issue, this bug will eventually be resolved
as "works for me".
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
Thomas <qi...@163.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|WORKSFORME |---
Status|RESOLVED |REOPENED
--- Comment #8 from Thomas <qi...@163.com> ---
at
org.apache.tomcat.util.http.MimeHeaders.removeHeader(MimeHeaders.java:418)
at
org.apache.tomcat.util.http.MimeHeaders.removeHeader(MimeHeaders.java:407)
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:692)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
at org.apache.coyote.http2.StreamProcessor.service(StreamProcessor.java:426)
at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.http2.StreamProcessor.process(StreamProcessor.java:87)
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:840)
This request process results the result.
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #14 from Mark Thomas <ma...@apache.org> ---
9.0.65 was released in July 2022.
When this issue was opened you were asked to test with the current Tomcat 9 by
multiple committers.
Some 3 months after this issue was opened and a test case provided it took me
less than 20 minutes to reproduce the issue with 9.0.65, update to 9.0.100 and
see that the issue no longer occurs.
When we ask people to test with the latest version, it isn't an attempt to fob
them off. It is a recognition that Tomcat has bugs, those bugs get fixed and
that over a period of more than 2 years quite a few bugs will have been fixed.
If you are using an old version we don't want to waste our time investigating
an issue that has already been fixed and you don't have to waste your time if a
fix is already available.
If I had to guess at which fix it was in the changelog, my guess would be this
fix from 9.0.79:
"Correct a race condition that could cause spurious RST messages to be sent
after the response had been written to an HTTP/2 stream."
but I haven't done anything to confirm that.
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |RESOLVED
Resolution|--- |WORKSFORME
--- Comment #7 from Mark Thomas <ma...@apache.org> ---
Two months. No response. Resolve as Works for Me.
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
--- Comment #6 from Mark Thomas <ma...@apache.org> ---
No response in over a month. This is heading towards "works for me".
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
--- Comment #3 from Thomas <qi...@163.com> ---
I can't provide a reproducible test case because this problem only occurs a few
times in an hour of running.
--
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 69479] The HTTP2 header data is confused in H2C, resulting in parsing failure
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69479
--- Comment #5 from Mark Thomas <ma...@apache.org> ---
A test case that generates the issue a few times an hour is a start. It doesn't
have to reproduce it instantly. We often find that provides some clues that
enable us to trigger the issue more frequently.
--
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