Skip to content

TS Seg Faulting on HTTP_EVENT_TUNNEL_CLOSE #3143

@xf6wang

Description

@xf6wang

There is a problem in closing the Http Tunnel if there is lock contention.

Without lock contention: HttpSM.cc:2589 default_handler is tunnel_handler and it is given HTTP_TUNNEL_EVENT_CLOSE, kill_this() (HttpSM.cc:2602) eventually calls state_api_callout(0, nullptr). Plugin lock is acquired in HttpSM.cc:1443 does some stuff and exits function. Continues correctly.

With lock contention: HttpSM.cc:2589 default_handler is tunnel_handler and it is given HTTP_TUNNEL_EVENT_CLOSE, kill_this() (HttpSM.cc:2602) eventually calls state_api_callout(0, nullptr). In line HttpSM:1441, the default handler is set to state_api_callout. It is rescheduled in HttpSM.cc:1443. Now, when it renters the SM, the event code HTTP_EVENT_TUNNEL_CLOSE is given to state_api_callout rather than state_api_callout(0, nullptr). This causes it to enter a different switch case and eventually messes up.

Test to produce bug: #3047 (openclose_h2.test.py)
Potential Fix (kinda hacky): xf6wang@58fa79e

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