Repository navigation
Drain tar stderr while streaming archives - #800
Closed
antlassagne wants to merge 1 commit into
Closed
antlassagne wants to merge 1 commit into
antlassagne wants to merge 1 commit into
Conversation
Drain tar's stderr concurrently while writing archive data to its stdin. Otherwise, diagnostics can fill the stderr pipe and deadlock both processes. Drain stderr to EOF, retaining its first 4096 bytes for error reporting, and join the drain thread before releasing the subprocess.
Author
|
Fix: #797 |
Author
Owner
|
I don't think this is the right solution, creating an entire thread to read a pipe is like pushing a stamp onto a letter with a cannon shot: It kinda works, but is way too much! I'll have a look at this, my first idea is to just send it to a memfd and limit its size (so a hostile tarball can't exhaust all memory). |
Owner
|
I resolved this with a memfd to catch the output (and a tempfile on systems which don't have memfds) via 6ed4e61 Please test it and see if that resolves the issue for you, and thank you for the patch! :-) |
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.
Drain tar's stderr concurrently while writing archive data to its stdin. Otherwise, diagnostics can fill the stderr pipe and deadlock both processes. Drain stderr to EOF, retaining its first 4096 bytes for error reporting, and join the drain thread before releasing the subprocess.
I used AI to assist me writing this patch