llvm / llvm/llvm-project

Jobserver wrongly assumes that it will be able to read tokens for all available jobs on setup

Open
#170,184 3 comments 1 reaction 1 assignee Claimed by @yxsamliu View on GitHub
llvm:support
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

https://github.com/llvm/llvm-project/blob/0ff0f52460531c0bfa213d0dcfa0cfb4ba61e934/llvm/lib/Support/Unix/Jobserver.inc#L42-L44

https://github.com/llvm/llvm-project/blob/0ff0f52460531c0bfa213d0dcfa0cfb4ba61e934/llvm/lib/Support/Unix/Jobserver.inc#L93-L103

This wrongly assumes that all tokens will be immediately available at setup time. However, it is entirely likely that the jobserver will be performing some tasks already, and therefore not all tokens will be immediately available, resulting in wrong estimation. In fact, it is entirely possible that all job tokens will be consumed at the time and therefore `NumJobs` will become 0 and the assertion will fail.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.