Skip to content

Need DestructorGuard in HQSession::handleWriteError(HQStreamTransportBase* hqStream, quic::QuicErrorCode err)? #582

@ryanchiu0416

Description

@ryanchiu0416

Hi, our codebase uses proxygen and recently we saw a crash inside the proxygen HTTPTransaction/HQSession stack. It looks like the underlying txn object was gone inside the dguards destructor.

Could it be that there should be a DestructorGuard in the method HQSession::handleWriteError as well? The comment also seems to suggest similar concern.

// Do I need a dguard here?
abortStream(ex.getDirection(),
hqStream->getStreamId(),
HTTP3::ErrorCode::HTTP_REQUEST_CANCELLED);
hqStream->errorOnTransaction(ex);
}

While this crash is not easily reproducible as this is our first time seeing it, I wonder what the thoughts are from the team. Thanks.

Core dump after crash:

* thread #1, name = '', stop reason = signal SIGSEGV: address not mapped to object
  * frame #0: 0x0000000001831c13 `folly::DelayedDestructionBase::DestructorGuard::~DestructorGuard(this=<unavailable>) at DelayedDestructionBase.h:94:16
    frame #1: 0x00000000019026e8 `proxygen::HTTPTransaction::processIngressError(this=<unavailable>, error=<unavailable>) at HTTPTransaction.cpp:762:1
    frame #2: 0x000000000194a451 `proxygen::HQSession::handleWriteError(proxygen::HQSession::HQStreamTransportBase*, quic::QuicErrorCode) [inlined] proxygen::HQSession::HQStreamTransportBase::errorOnTransaction(this=0x000000013d286628, ex=HTTPException @ 0x00007f54a7be1888) at HQSession.cpp:985:10
    frame #3: 0x000000000194a42d `proxygen::HQSession::handleWriteError(this=<unavailable>, hqStream=<unavailable>, err=<unavailable>) at HQSession.cpp:1974:13
    frame #4: 0x000000000193a5e5 `proxygen::HQSession::onStopSending(this=<unavailable>, id=<unavailable>, error=<unavailable>) at HQSession.cpp:268:5
    frame #5: 0x0000000001a63fc1 `quic::QuicTransportBaseLite::handleStreamStopSendingCallbacks(this=<unavailable>) at QuicTransportBaseLite.cpp:1957:20
    frame #6: 0x0000000001a62301 `quic::QuicTransportBaseLite::processCallbacksAfterNetworkData(this=<unavailable>) at QuicTransportBaseLite.cpp:1571:3
    frame #7: 0x0000000001a5fc60 `quic::QuicTransportBaseLite::onNetworkData(this=<unavailable>, peer=<unavailable>, networkData=<unavailable>) at QuicTransportBaseLite.cpp:145:7
    frame #8: 0x00000000019ceea7 `quic::QuicServerWorker::dispatchPacketData(folly::SocketAddress const&, quic::RoutingData&&, quic::NetworkData&&, folly::Optional<quic::QuicVersion>, bool)::$_1::operator()(this=<unavailable>, transport=<unavailable>) const at QuicServerWorker.cpp:855:16
    frame #9: 0x00000000019cd886 `quic::QuicServerWorker::dispatchPacketData(this=<unavailable>, client=<unavailable>, routingData=<unavailable>, networkData=<unavailable>, quicVersion=<unavailable>, isForwardedData=false) at QuicServerWorker.cpp:0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions