Skip to content
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

dynamic_modules: don't call on_http_filter_destroy_ if filter is null #37899

Merged
merged 5 commits into from
Jan 8, 2025

Conversation

bplotnick
Copy link
Contributor

I tested dynamic modules from rust and was getting a segfault. I noticed that drop was getting called twice. It turns out that onDestroy gets called twice. The right solution here is probably to prevent onDestroy() from being called twice... but barring that, this change works.

Commit Message: dynamic_modules: don't call on_http_filter_destroy_ if filter is null
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@bplotnick
Copy link
Contributor Author

/assign @mathetake

Copy link

bplotnick is not allowed to assign users.

🐱

Caused by: a #37899 (comment) was created by @bplotnick.

see: more, trace.

Signed-off-by: Ben Plotnick <[email protected]>
Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for finding this out.. but i am still not sure when does this happen. Can you add a test case in filter_test.cc to cover this case as well as a basic integration test?

@bplotnick
Copy link
Contributor Author

thank you for finding this out.. but i am still not sure when does this happen. Can you add a test case in filter_test.cc to cover this case as well as a basic integration test?

i'm not sure 🫤. I can't think of why it would, but I know it happens and segfaults when i use it and that this PR fixes the issue. I will take a look at reproing with an integration test though.

Signed-off-by: Ben Plotnick <[email protected]>
@bplotnick
Copy link
Contributor Author

@mathetake I was able to repro the issue with an integration test and confirmed that this PR fixes things. I still don't know why it is happening though.

If you want to repro on this branch as well, you can comment out https://github.com/envoyproxy/envoy/pull/37899/files#diff-c3823903be9c28689c8502bf6bbcc3ec6e771b6903b4cdf2317f99c82ce679caR21-R23 and run bazel test //test/extensions/dynamic_modules/http:integration_test

@mathetake
Copy link
Member

cool, thank you for adding the integration test that hits the case!

Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for scaffolding the integration test. Deferring to @mattklein123

@mattklein123 mattklein123 self-assigned this Jan 8, 2025
@mattklein123 mattklein123 merged commit 2bacbc4 into envoyproxy:main Jan 8, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants