leanprover / leanprover/lean4

lake sometimes hangs on NetBSD

Open
#14,587 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P-low
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Prerequisites
Description

After packaging lean 4.32.1, I've been building it repeatedly in a clean environment. Sometimes (1 out of 3? 5? times) during a build, lake will hang.

I've attached a debugger once, reading the backtrace there is a process hanging in pthread_join, one in fread, the others are idle in pthread_cond_timedwait.

I can only see one fread() in the code, in src/runtime/io.cpp - perhaps this code should have a timeout (i.e. use select or poll and non-blocking reads.

Context

n/a

Steps to Reproduce
  1. Build lean4 4.32.1 repeatedly.
  2. be unlucky

Expected behavior: [Clear and concise description of what you expect to happen]

lake should not hang.

Actual behavior: [Clear and concise description of what actually happens]

lake sometimes does hang.

Versions

4.32.1
NetBSD 11.99.7/x86_64

Additional Information

n/a

Impact

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/runtime/io.cpp and the reported backtraces involving fread, pthread_join, and pthread_cond_timedwait. Repeatedly build Lean 4.32.1 on NetBSD 11.99.7 to investigate the intermittent hang; done means lake completes without hanging during repeated clean builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.