Skip to content

fix(judgelib): Read judge stderr before waiting for exit#548

Merged
SvizelPritula merged 3 commits intomasterfrom
fix/judgelib-stderr-deadlock
Dec 4, 2025
Merged

fix(judgelib): Read judge stderr before waiting for exit#548
SvizelPritula merged 3 commits intomasterfrom
fix/judgelib-stderr-deadlock

Conversation

@SvizelPritula
Copy link
Contributor

This stops Pisek from deadlocking when judging a wrong output using out_check=tokens with very long tokens.

A more systematic solution would be nice, as this issue can almost certainly occur almost anywhere where Pisek runs a program.

@SvizelPritula
Copy link
Contributor Author

Actually, we should probably just use capture_output.

@SvizelPritula
Copy link
Contributor Author

Actually, we should probably just use capture_output.

Nevermind, that only exists for run and similar methods, not for raw Popen.

@SvizelPritula
Copy link
Contributor Author

SvizelPritula commented Dec 4, 2025

In reality, anywhere we call _run_subprocess with stdout or stderr set to PIPE is simply broken. We should probably modify _run_subprocess or add a new helper to run process.comunicate() in a seperate thread, or somehow implement pipe reading ourselves. Or pipe everything to temporary files.

@SvizelPritula SvizelPritula merged commit 0627185 into master Dec 4, 2025
2 checks passed
@SvizelPritula SvizelPritula deleted the fix/judgelib-stderr-deadlock branch December 4, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants