You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "JakeChampion (via GitHub)" <gi...@apache.org> on 2026/02/23 15:28:40 UTC
[PR] fix(http): crash in `HttpTunnel::producer_run` when 100 Continue precedes a transformed response [trafficserver]
JakeChampion opened a new pull request, #12905:
URL: https://github.com/apache/trafficserver/pull/12905
When an origin sends 100 Continue before a compressible response, `setup_100_continue_transfer()` sets `client_response_hdr_bytes` to the intermediate header size.
The subsequent call to `setup_server_transfer_to_transform()` creates the tunnel buffer with `hdr_size=0` - body only, but `client_response_hdr_bytes` is not reset for non-chunked responses.
`perform_cache_write_action()` then passes the stale value as `skip_bytes` to the cache-write consumer, causing `ink_release_assert(c->skip_bytes <= c->buffer_reader->read_avail())` to fire in `producer_run` when the response body is smaller than the 100 Continue headers.
Fix: set `cache_write_skip` to `0` whenever a transform is present, since `setup_server_transfer_to_transform()` never writes headers into the tunnel buffer.
Fixes: #12244
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(http): crash in `HttpTunnel::producer_run` when 100 Continue precedes a transformed response [trafficserver]
Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall commented on PR #12905:
URL: https://github.com/apache/trafficserver/pull/12905#issuecomment-3947765028
@JakeChampion we weren't going to do another 10.1.x release.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(http): crash in `HttpTunnel::producer_run` when 100 Continue precedes a transformed response [trafficserver]
Posted by "JakeChampion (via GitHub)" <gi...@apache.org>.
JakeChampion commented on PR #12905:
URL: https://github.com/apache/trafficserver/pull/12905#issuecomment-3947770262
> @JakeChampion we weren't going to do another 10.1.x release.
I've also opened this against main, and can back port to 10.2.x instead of 10.1.x if preferred
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(http): crash in `HttpTunnel::producer_run` when 100 Continue precedes a transformed response [trafficserver]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #12905:
URL: https://github.com/apache/trafficserver/pull/12905#discussion_r2843466217
##########
tests/gold_tests/pluginTest/compress/compress_100_continue_client.py:
##########
@@ -0,0 +1,129 @@
+#!/usr/bin/env python3
+"""Client that sends a POST with Expect: 100-continue through ATS.
+
+Used to reproduce the crash in HttpTunnel::producer_run when compress.so
+with cache=true is combined with a 100 Continue response from the origin.
Review Comment:
Docstring says the crash is reproduced with `compress.so` configured with `cache=true`, but the test config used here sets `cache false` (which corresponds to untransformed caching in compress). Please update the docstring to match the actual configuration/behavior to avoid confusion when maintaining the test.
```suggestion
with cache=false (untransformed caching) is combined with a 100 Continue response from the origin.
```
##########
tests/gold_tests/pluginTest/compress/compress-cache-untransformed.test.py:
##########
@@ -0,0 +1,112 @@
+'''
+Regression test for https://github.com/apache/trafficserver/issues/12244
+
+The crash requires two conditions in the same transaction:
+1. An intermediate response (100 Continue) is forwarded to the client, which
+ sets client_response_hdr_bytes to the intermediate header size via
+ setup_100_continue_transfer().
+2. The final response goes through a compress transform with untransformed
+ cache writing (cache=true), which calls setup_server_transfer_to_transform().
+ For non-chunked responses, client_response_hdr_bytes is NOT reset to 0.
+
+perform_cache_write_action() then passes the stale client_response_hdr_bytes
+as skip_bytes to the cache-write consumer, but the server-to-transform tunnel
+buffer contains only body data (no headers). The assertion in
+HttpTunnel::producer_run fires:
+
+ c->skip_bytes <= c->buffer_reader->read_avail()
+
+This test uses a custom origin that sends "100 Continue" followed by a
+compressible, non-chunked 200 OK to trigger the exact crash path.
+'''
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import sys
+
+from ports import get_port
+
+Test.Summary = '''
+Regression test for compress plugin with cache=true causing assertion failure
+when origin sends 100 Continue before a compressible response (#12244)
Review Comment:
`Test.Summary` mentions "cache=true" causing the assertion failure, but the config used in this test sets `cache false` (untransformed caching in compress). Please update the summary string to accurately reflect the configuration under test.
```suggestion
Regression test for compress plugin with untransformed caching (cache=false)
causing assertion failure when origin sends 100 Continue before a compressible
response (#12244)
```
##########
tests/gold_tests/pluginTest/compress/compress-cache-untransformed.test.py:
##########
@@ -0,0 +1,112 @@
+'''
+Regression test for https://github.com/apache/trafficserver/issues/12244
+
+The crash requires two conditions in the same transaction:
+1. An intermediate response (100 Continue) is forwarded to the client, which
+ sets client_response_hdr_bytes to the intermediate header size via
+ setup_100_continue_transfer().
+2. The final response goes through a compress transform with untransformed
+ cache writing (cache=true), which calls setup_server_transfer_to_transform().
+ For non-chunked responses, client_response_hdr_bytes is NOT reset to 0.
+
Review Comment:
This test description repeatedly refers to `compress` running with `cache=true`, but the config file used (`cache-true-untransformed.config`) currently sets `cache false` (untransformed caching). Please update the wording (and ideally the config filename) so the test documents the actual condition needed to hit the crash path.
##########
tests/gold_tests/pluginTest/compress/compress_100_continue_origin.py:
##########
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+"""Origin server that sends 100 Continue then a compressible 200 OK.
+
+Used to reproduce the crash in HttpTunnel::producer_run when compress.so
+with cache=true is combined with a 100 Continue response from the origin.
Review Comment:
Docstring says the crash is reproduced with `compress.so` configured with `cache=true`, but the test config used here sets `cache false` (which corresponds to untransformed caching in compress). Please update the docstring to match the actual configuration/behavior to avoid confusion when maintaining the test.
```suggestion
with cache=false (untransformed caching) is combined with a 100 Continue
response from the origin.
```
##########
tests/gold_tests/pluginTest/compress/etc/cache-true-untransformed.config:
##########
@@ -0,0 +1,5 @@
+cache false
Review Comment:
The config filename and surrounding test/docs say "cache=true", but this file sets `cache false`. In the compress plugin, `cache true` enables caching the transformed response and disables untransformed caching; `cache false` does the opposite. Please align the filename (and any references) with the actual setting, or flip the setting if the intent really is transformed caching.
```suggestion
cache true
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(http): crash in `HttpTunnel::producer_run` when 100 Continue precedes a transformed response [trafficserver]
Posted by "JakeChampion (via GitHub)" <gi...@apache.org>.
JakeChampion closed pull request #12905: fix(http): crash in `HttpTunnel::producer_run` when 100 Continue precedes a transformed response
URL: https://github.com/apache/trafficserver/pull/12905
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org