-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
lua filter: ensure active_request_ is verified before deletion Fixes #38017 #38863
base: main
Are you sure you want to change the base?
Conversation
…aders Lua filter was removing ":status", which was causing envoy to terminate with a SIGSEGV. The issue occurred because "onEncodeComplete()" attempted to delete "active_request_" via "deferredDelete()", but "active_request_" had already been deleted earlier, leading to a segmentation fault. This fix ensures that "active_request_" is only deleted once, preventing double deletion. Signed-off-by: Leonor Figueira <leonor.figueira@tecnico.ulisboa.pt>
Hi @leocfig, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
I believe the pipeline is failing because the tests are running in debug mode. The code eventually reaches a verification where ENVOY_BUG() forcefully aborts the program, when in debug mode. What my fix avoids is the program ending with a segmentation fault in release mode. |
Hey @leocfig , Thank you for working on this. We do run CI (strangely under pre-check) with the release mode run of tests: https://github.com/envoyproxy/envoy/actions/runs/14021237617/job/39253502671 It seems like the test is still failing in release mode. You can also try wrapping the test with a macro similar to envoy/test/test_common/utility.h Line 99 in 2533c82
/wait |
Thanks for the suggestion! I’ll first investigate why it’s still failing in release mode since it passed locally, then update the test to use |
Signed-off-by: Leonor Figueira <leonor.figueira@tecnico.ulisboa.pt>
I realized that my test was failing in the pipeline despite passing locally because my code was not up-to-date with a recent commit that modified the Additionally, I added the |
I noticed that the |
Commit Message:
Lua filter was removing ":status" and then setting a response body, which was causing envoy to terminate with a SIGSEGV. The issue occurred because "onEncodeComplete()" attempted to delete "activerequest" via "deferredDelete()", but "activerequest" had already been deleted earlier, leading to a segmentation fault. This fix ensures that "activerequest" is only deleted once, preventing double deletion. This is done by verifying that "activerequest" is not null before the existing check of "activerequest->remotecomplete".
Additional Description:
I compiled Envoy in release mode (using the -c flag) and also ran the new test in release mode to verify the fix.
Risk Level: Low
Testing:
I added a new integration test in "lua_integration_test.cc" file specifically for this bug. Without the fix, the test fails; with it applied, the test passes successfully.
Fixes #38017