facebookresearch / CompilerGym

Reinforcement learning environments for compiler and program optimization tasks
https://compilergym.ai/
MIT License
906 stars 127 forks source link

compiler_gym::util::LocalShellCommand::checkCall() does not kill process on timeout #677

Closed ChrisCummins closed 2 years ago

ChrisCummins commented 2 years ago

🐛 Bug

If the process fails to terminate within the specified timeout period, it is abandoned:

https://github.com/facebookresearch/CompilerGym/blob/63dbfac72d9f888adf8332a73fefa34faae9b2f0/compiler_gym/util/Subprocess.cc#L62-L66

Instead, the

To Reproduce

This unit test covers the timeout case:

https://github.com/facebookresearch/CompilerGym/blob/63dbfac72d9f888adf8332a73fefa34faae9b2f0/tests/util/SubprocessTest.cc#L110-L126

run it using bazel test //tests/util:SubprocessTest.

Expected behavior

The child process should be terminated.

Environment

Please fill in this checklist:

Additional context

Reported by @uduse https://github.com/facebookresearch/CompilerGym/issues/326#issuecomment-1121646847.