Fix HTTP/3 crash in HQTransaction::_signal_event#13093
Open
bneradt wants to merge 1 commit intoapache:masterfrom
Open
Fix HTTP/3 crash in HQTransaction::_signal_event#13093bneradt wants to merge 1 commit intoapache:masterfrom
bneradt wants to merge 1 commit intoapache:masterfrom
Conversation
This fixes a crash where the assertion at HttpSM.cc:2765 fails: ink_assert(default_handler != (HttpSMHandler) nullptr) The crash is triggered when VC_EVENT_EOS, VC_EVENT_ERROR, or a timeout propagates from the QUIC stream up to HQTransaction::state_stream_open, which calls _signal_event. The previous implementation forwarded the triggering Event* as the data argument to HttpSM::handleEvent. HttpSM::main_handler, however, casts that data to VIO* and uses it to look up the vc_table entry. Because an Event* never matches any registered VIO, find_entry returns null and main_handler falls through to default_handler. When the SM is in early setup or has already been torn down (kill_this clears default_handler), default_handler is null and the assertion fires. This patch passes the appropriate VIO pointer to each handleEvent call, matching the convention used by _signal_read_event, _signal_write_event, and the HTTP/2 Http2Stream equivalents. The original dual-VIO dispatch is preserved so tunnel consumers bound to the write side still receive connection-level events. Fixes: apache#12112
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm running this is docs now and I have no longer seen this rather frequent
crash.
This fixes a crash where the assertion at HttpSM.cc:2765 fails:
ink_assert(default_handler != (HttpSMHandler) nullptr)
The crash is triggered when VC_EVENT_EOS, VC_EVENT_ERROR, or a
timeout propagates from the QUIC stream up to
HQTransaction::state_stream_open, which calls _signal_event. The
previous implementation forwarded the triggering Event* as the data
argument to HttpSM::handleEvent. HttpSM::main_handler, however, casts
that data to VIO* and uses it to look up the vc_table entry. Because
an Event* never matches any registered VIO, find_entry returns null
and main_handler falls through to default_handler. When the SM is in
early setup or has already been torn down (kill_this clears
default_handler), default_handler is null and the assertion fires.
This patch passes the appropriate VIO pointer to each handleEvent
call, matching the convention used by _signal_read_event,
_signal_write_event, and the HTTP/2 Http2Stream equivalents. The
original dual-VIO dispatch is preserved so tunnel consumers bound to
the write side still receive connection-level events.
Fixes: #12112