Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[parallel] If not num_threads, use queue instead of tail recursion
Previously, running `bt fuzz --jobs 0` would crash with a stack overflow after 244 iterations (±4 stack frames per iteration). This happened because after every GeneratorTask, a new task was started by calling Parallel.put, which in turn called its lambda, which called the new GeneratorTask, which called Parallel.put again in finish_task, etc. I've rewritten the task handling in the case of `not num_threads` by moving it all to Parallel.done. Parallel.put now puts the task in the same priority queue as in the case where we _do_ want parallelism (num_threads > 0). The fuzzer should now be able to run more than 244 iterations again 😄
- Loading branch information