branch-4.0: [fix](http) Fix EvHttpServer crash during graceful shutdown in ASAN mode #59769#65279
Open
github-actions[bot] wants to merge 1 commit into
Open
branch-4.0: [fix](http) Fix EvHttpServer crash during graceful shutdown in ASAN mode #59769#65279github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
…ode (#59769) The crash occurred because evhttp was created as a local shared_ptr in the lambda function, and its destruction happened after event_base_dispatch returned. This caused use-after-free issues when ASAN/UBSAN tried to verify the object dynamic type during shared_ptr destruction. Fix by: 1. Moving evhttp objects to class member _evhttp_servers for explicit lifecycle management 2. Reordering resource cleanup in stop(): - Close server_fd first to reject new connections - Break event loops to make dispatch return - Wait for worker threads to finish - Clear evhttp before event_base (correct dependency order)
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
|
run buildall |
1 similar comment
Contributor
|
run buildall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picked from #59769