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

deadlock when running multiple c compilations in parallel #22453

Open
Techatrix opened this issue Jan 9, 2025 · 0 comments
Open

deadlock when running multiple c compilations in parallel #22453

Techatrix opened this issue Jan 9, 2025 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@Techatrix
Copy link
Contributor

Zig Version

0.14.0-dev.2628+5b5c60f43

Steps to Reproduce and Observed Behavior

The following bash script will never teminate:

repo.sh
#!/usr/bin/env bash

# Requires GNU parallel

# Ensure that no manifest files exist
rm -rf ~/.cache/zig

[ ! -d tree-sitter-jsdoc ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-jsdoc
[ ! -d tree-sitter-python ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-python
[ ! -d tree-sitter-vimdoc ] && git clone --depth 1 https://github.com/neovim/tree-sitter-vimdoc
[ ! -d tree-sitter-luap ] && git clone --depth 1 https://github.com/vhyrro/tree-sitter-luap
[ ! -d tree-sitter-query ] && git clone --depth 1 https://github.com/tree-sitter-grammars/tree-sitter-query
[ ! -d tree-sitter-luadoc ] && git clone --depth 1 https://github.com/tree-sitter-grammars/tree-sitter-luadoc
[ ! -d tree-sitter-printf ] && git clone --depth 1 https://github.com/tree-sitter-grammars/tree-sitter-printf
[ ! -d tree-sitter-xml ] && git clone --depth 1 https://github.com/tree-sitter-grammars/tree-sitter-xml
[ ! -d tree-sitter-yaml ] && git clone --depth 1 https://github.com/tree-sitter-grammars/tree-sitter-yaml
[ ! -d tree-sitter-bash ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-bash
[ ! -d tree-sitter-markdown ] && git clone --depth 1 https://github.com/tree-sitter-grammars/tree-sitter-markdown
[ ! -d tree-sitter-typescript ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-typescript
[ ! -d tree-sitter-vim ] && git clone --depth 1 https://github.com/tree-sitter-grammars/tree-sitter-vim
[ ! -d tree-sitter-markdown ] && git clone --depth 1 https://github.com/tree-sitter-grammars/tree-sitter-markdown
[ ! -d tree-sitter-tsx ] && git clone --depth 1 https://github.com/sourcegraph/tree-sitter-tsx
[ ! -d tree-sitter-agda ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-agda
[ ! -d tree-sitter-c ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-c
[ ! -d tree-sitter-cpp ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-cpp
[ ! -d tree-sitter-css ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-css
[ ! -d tree-sitter-go ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-go
[ ! -d tree-sitter-haskell ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-haskell
[ ! -d tree-sitter-html ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-html
[ ! -d tree-sitter-java ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-java
[ ! -d tree-sitter-javascript ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-javascript
[ ! -d tree-sitter-jsdoc ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-jsdoc
[ ! -d tree-sitter-json ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-json
[ ! -d tree-sitter-julia ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-julia
[ ! -d tree-sitter-python ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-python
[ ! -d tree-sitter-regex ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-regex
[ ! -d tree-sitter-ruby ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-ruby
[ ! -d tree-sitter-rust ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-rust
[ ! -d tree-sitter-scala ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-scala
[ ! -d tree-sitter-toml ] && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-toml

echo "Begin compiling..."

parallel -j32 ::: \
  "cd tree-sitter-jsdoc; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-python; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-vimdoc; zig c++ -o parser.so src/parser.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-luap; zig c++ -o parser.so src/parser.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-query; zig c++ -o parser.so src/parser.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-luadoc; zig c++ -o parser.so src/parser.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-printf; zig c++ -o parser.so src/parser.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-xml/xml; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-yaml; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-bash; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-markdown/tree-sitter-markdown-inline; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-markdown/tree-sitter-markdown; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-typescript/typescript; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-vim; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-tsx/tsx; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-agda; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-c; zig c++ -o parser.so src/parser.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-cpp; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-css; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-go; zig c++ -o parser.so src/parser.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-haskell; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-html; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-java; zig c++ -o parser.so src/parser.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-javascript; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-jsdoc; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-json; zig c++ -o parser.so src/parser.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-julia; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-python; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-regex; zig c++ -o parser.so src/parser.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-ruby; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-rust; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-scala; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os" \
  "cd tree-sitter-toml; zig c++ -o parser.so src/parser.c src/scanner.c -lc -Isrc -shared -Os"
Output of lslocks | grep zig
zig             179911 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179792 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179935 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179799 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179790 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             180122 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             180074 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179856 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             180074 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179935 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             180087 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             180020 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179799 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179856 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179792 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179935 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             180573 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             180573 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             180573 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179790 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179800 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179797 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179881 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179949 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             180122 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179795 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             180001 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179799 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             180027 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             180054 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             180122 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179949 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             180054 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             180122 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179949 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             180573 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             180027 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             180122 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179933 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179969 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179904 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179799 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             180119 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179856 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179791 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             180087 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179911 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179999 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179801 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179798 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179949 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179868 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179800 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179795 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179881 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179935 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             180001 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179790 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             180054 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             180074 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179797 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179792 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             180020 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179970 FLOCK   8,4K READ   0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179970 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             180020 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179904 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             180119 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179797 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179999 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179792 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             180020 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             180027 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179791 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179800 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179904 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179881 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179969 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179791 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179969 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             180027 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             180573 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179856 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179790 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179798 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179868 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179797 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179933 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179969 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             180087 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179935 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179800 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179801 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179799 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             180027 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             180122 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179970 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             180001 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179904 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179881 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             180119 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             180020 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179791 FLOCK    11K READ   0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             180054 FLOCK    11K READ   0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179791 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             180074 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             180087 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179969 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179881 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179911 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179801 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179792 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179911 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179801 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             180119 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179911 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179949 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179933 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             180054 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179935 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             180119 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             180074 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             180087 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179856 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179799 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179790 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179881 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             180573 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179795 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179969 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179856 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179801 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179801 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179904 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             180087 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179868 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179797 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             180119 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179797 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179904 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             180020 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179868 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179933 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179868 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179999 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179798 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179933 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179999 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179790 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179795 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179970 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             180001 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179933 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179800 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179970 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179999 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179798 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             180027 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             180054 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             180001 FLOCK  16,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b32d74cf33debeb8fed5166378c1476a.txt
zig             179791 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179868 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179800 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179970 FLOCK  20,1K READ   0          0          0 /home/techatrix/.cache/zig/h/b4ff4a8f3c42603aa2ab1225568c776a.txt
zig             179798 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             180001 FLOCK 126,8K READ   0          0          0 /home/techatrix/.cache/zig/h/c211d488984bfaacf74d2f78bd10536b.txt
zig             179795 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt
zig             179798 FLOCK  92,8K READ   0          0          0 /home/techatrix/.cache/zig/h/98573db57848ef6f2b456bcaee891b01.txt

The deadlock can be observed in the following lines:

zig             179791 FLOCK    11K READ   0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt
zig             179791 FLOCK   8,4K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179970 FLOCK   8,4K READ   0          0          0 /home/techatrix/.cache/zig/h/a52cf79dd888f0fc3f1fcf20603aa79d.txt
zig             179970 FLOCK    11K WRITE* 0          0          0 /home/techatrix/.cache/zig/h/3b56e9bf1e38e2113939d216af801760.txt

The backtrace of the affacted processes shows the following:

(lldb) process attach --pid 179970
(lldb) thread backtrace 3
  thread #3, name = 'zig', stop reason = signal SIGSTOP
    frame #0: 0x00007f52f230564b
    frame #1: 0x0000000001ca5b04 zig`fs.File.lock(file=<unavailable>, l=exclusive) at File.zig:1648:27
    frame #2: 0x0000000001ac8921 zig`Build.Cache.Manifest.upgradeToExclusiveLock(self=0x00007f52f1203070) at Cache.zig:1114:31
    frame #3: 0x0000000001962dc4 zig`Build.Cache.Manifest.hit(self=0x00007f52f1203070) at Cache.zig:738:52
    frame #4: 0x00000000022e889d zig`Compilation.updateCObject(comp=0x000000001a9d7d80, c_object=0x000000001a9e5980, c_obj_prog_node=<unavailable>) at Compilation.zig:4718:63
    frame #5: 0x0000000001ee2bda zig`Compilation.workerUpdateCObject(comp=0x000000001a9d7d80, c_object=0x000000001a9e5980, progress_node=<unavailable>) at Compilation.zig:4541:23
    frame #6: 0x0000000001ee2d5b zig`Thread.Pool.spawnWg__anon_205269.Closure.runFn(runnable=0x000000001a9e5f78) at Pool.zig:115:39
    frame #7: 0x0000000001e933be zig`Thread.Pool.worker(pool=0x00007fffbb38ff48) at Pool.zig:291:32
    frame #8: 0x0000000001c6aa9b zig`Thread.callFn__anon_197232(args=<unavailable>) at Thread.zig:486:13
    frame #9: 0x0000000001a94333 zig`Thread.PosixThreadImpl.spawn__anon_133060.Instance.entryFn(raw_arg=0x000000001a9bf920) at Thread.zig:755:30

All other threads were idle. The line numbers may not be accurate since I used a compiler build from about a week ago.

Expected Behavior

no deadlock

@Techatrix Techatrix added the bug Observed behavior contradicts documented or intended behavior label Jan 9, 2025
@andrewrk andrewrk added this to the 0.14.0 milestone Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

2 participants