-
Notifications
You must be signed in to change notification settings - Fork 819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault with attach_server_session_to_client
and Puma backend
#10116
Comments
I have attempted to reproduce this bug with a few other backend servers, but I have not been successful. I am very curious about what exactly Puma is doing with the connection to elicit this response from ATS. |
attach_server_session_to_client
and Puma backendattach_server_session_to_client
and Puma backend
Thank you for the very details reproduction steps. I was able to get this to crash with the steps you provided. I'll try to figure out what is going on and provide another update. |
This crash is due to a use after free that occurs when a client transaction with an attached server session closes after the server session is released. The server session has a state of PoolableSession::KA_RESERVED, but the server session teardown code doesn't handle this so destroys itself even though the client still has a pointer to it. I will create a PR that fixes the crash, but I haven't yet figured out the appropriate way to get the server session returned to the global pool. I suspect this bug might be an old one created by #7849 but I don't know the history or code well enough to be certain. After I create the PR I'll ask for further help to fully resolve this. |
Chris noted that this may be the same error I'm seeing #10396. I was running with ASAN enabled, so the use-after-free triggered reliably although I wasn't seeing the crash (much I think). |
I reran the reproduction steps after checking out pr #10399 and it no longer crashes. |
@kenballus Now that this is merged, could you please verify this fix? |
I can no longer reproduce the issue. Seems like it's fixed. Thanks everyone! |
🪲 Description
ATS, when configured with
attach_server_session_to_client
, segfaults when forwarding a request to a Puma backend.Steps to reproduce
master
. (The current commit at time of writing ise6182d9ac9c3f611cb33b3ef6dc98327df41c3d6
)apt -y install ruby-dev && gem install sinatra --version 3.0.6
ruby /repro/server.rb &
traffic_server &
Files
/usr/local/etc/trafficserver/records.yaml
/usr/local/etc/trafficserver/remap.config
/repro/server.rb
Crash log
Versions
ATS: master branch, commit
e6182d9ac9c3f611cb33b3ef6dc98327df41c3d6
OS: Debian Bookworm container running on top of Arch Linux with a 6.4.3 kernel
All other versions are either Debian defaults or specified in the reproduction steps.
EDIT: Add beetle emoji
The text was updated successfully, but these errors were encountered: