Skip to content

Fix HTTP/3 crash in HQTransaction::_signal_event#13093

Open
bneradt wants to merge 1 commit intoapache:masterfrom
bneradt:fix-h3-reset
Open

Fix HTTP/3 crash in HQTransaction::_signal_event#13093
bneradt wants to merge 1 commit intoapache:masterfrom
bneradt:fix-h3-reset

Conversation

@bneradt
Copy link
Copy Markdown
Contributor

@bneradt bneradt commented Apr 16, 2026

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

@bneradt bneradt added this to the 11.0.0 milestone Apr 16, 2026
@bneradt bneradt self-assigned this Apr 16, 2026
@bneradt bneradt requested a review from maskit April 16, 2026 17:09
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
@bneradt bneradt changed the title Fix HTTP/3 crash in _signal_event Fix HTTP/3 crash in HQTransaction::_signal_event Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

HttpSM.cc:2627: failed assertion default_handler != (HttpSMHandler) nullptr

1 participant