Repository navigation
Adjust follow redirect logic to address a crash and avoid arguments shadowing - #4902
Merged
shinrich merged 1 commit intoFeb 1, 2019
Merged
Conversation
…hadowing member variables.
SolidWallOfCode
approved these changes
Jan 31, 2019
Member
Author
|
[approve ci autest] |
Contributor
|
Cherry picked to 8.1.0 |
Contributor
|
This doesn't cherry-pick cleanly to 8.1.x, do we need this for 8.1.0? If not, please remove Project 8.x. |
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.
Two changes. The change in HttpSM, is just renaming the parameters for HttpSM::redirect_request so they don't shadow HttpSM member variables.
The fix in HttpTransact::build_request addresses a crash we were seeing which I still do not fully understand. We have a cluster of machines configured as forward proxies that follow redirects. On this machine after I moved our build machine to use gcc-6.3, the builds would crash after around 5 minutes with the following stack.
Building the code with compilers from devtoolset 7 or 8 would avoid the problem. Removing the redirect_info.redirect_url completely also solves the problem. And truthfully I don't see why we need to set the request_url again in build_request when we had just set it in redirect_request. I ran an instrumented build to make more checks to see when the client_request (base_request) URL differs from the redirect_info.redirect_urls, and in my runs it never differed, but perhaps there is an additional edge case that our deployment does not exercise?
This change also seems to make the crash go away.
Looking at the details of the stack, m_size is 0, so the system heap free() is called instead of the ATS thread_allocator free method. I don't know why the m_size is set to 0. I assume that the rediredt_url URL object is already corrupted before it gets to this destroy call.
But I have stared at this for a couple days already. This semantically equivalent (and shorter) sequence seems to address the issue.
I am also open to replacing redirect_info.redirect_url with a local variable in the HttpSM::redirect_request method if we decide that we don't need to double set the client request URL.