Fix crashes when http2 parent stream gets aborted. #1125
Closed
+93
−3
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.
I can reproduce a use-after-free situation with libcurl and http2 by doing the following:
send A
send B which depends on A, apply dependency
abort B using curl_multi_remove_handle and subsequently free it using curl_easy_cleanup
Since A knows nothing about B's dependency on it we can't clean this up.
The patch fixes this by keeping a list of all children.
I believe the reprioritization is correct but it should be checked. I couldn't clearly understand what is supposed to happen if you do the following:
B depends on A
C depends on A exclusively
D depends on A
My assumption is that this should lead to:
D
C
B
A
E.g. C would lose its exclusivity when someone's dependency is applied afterwards. I'm not 100 sure this is correct.
The patch also allows for unsetting dependencies.
This is the output from our app reproducing the problem: