Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallelize tool may hang or crash #1619

Closed
gix opened this issue Feb 3, 2021 · 3 comments · Fixed by #1632
Closed

parallelize tool may hang or crash #1619

gix opened this issue Feb 3, 2021 · 3 comments · Fixed by #1632
Labels
fixed Something works now, yay! infrastructure Related to repository automation

Comments

@gix
Copy link
Contributor

gix commented Feb 3, 2021

Describe the bug
Adding batching of input files to the parallelize tool for my own needs (cuts the runtime for clang-format in half for me), I believe I encountered two issues:

  1. Quite often it would crash upon returning from p.wait_all() since a kernel mode operation corrupted the stack. This goes away when using an explicit manual-reset event for OVERLAPPED in output_collecting_pipe.
  2. It can hang on exit because the output_collecting_pipe destructor does not clear the running flag. The threadpool callback then starts another IO operation which never completes.

If useful, I can prepare a patch to fix these.

@StephanTLavavej StephanTLavavej added the infrastructure Related to repository automation label Feb 3, 2021
@StephanTLavavej
Copy link
Member

A patch would be great - please submit a pull request when you're ready!

@StephanTLavavej
Copy link
Member

I suspect this was the root cause of #257.

@BillyONeal
Copy link
Member

I suspect this was the root cause of #257.

It might contribute but I seem to recall getting hangs even when we ran it serially?

gix added a commit to gix/STL that referenced this issue Feb 11, 2021
cl -nologo -EHsc -O2 -std:c++latest -I..\inc -DWIN32_LEAN_AND_MEAN -DNOMINMAX -DUSE_EVENT2 .\parallelize.cpp -link -opt:ref -opt:icf userenv.lib
while ($true) { .\parallelize.exe "clang-format.exe -i" .; if ($LASTEXITCODE -ne 0) { echo $LASTEXITCODE; break } }
@StephanTLavavej StephanTLavavej added the fixed Something works now, yay! label Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Something works now, yay! infrastructure Related to repository automation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants