haskell / haskell/cabal

semaphore: Bad file descriptor errors

Open
#11,115 8 comments 3 reactions 0 assignees View on GitHub
blocked: needs reproducer re: semaphores type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I generally set `semaphore: True` in my `cabal.project.local` to speed up my builds. Occasionally, I see `cabal build` fail with messages like this:
```
semWaitInterrruptible: invalid argument (Bad file descriptor)
cabal_semaphore_3: semUnlink: does not exist (No such file or directory)
```
I'm afraid I don't have a reliable reproducer to share, but I didn't see any other issues in the tracker mentioning semaphores and bad file descriptors, so I figured I'd file this anyway just in case.

**Expected behavior**
The build simply completes, but faster than with `semaphore: False`.

**System information**
- macOS 15.5
- `cabal`: 3.14.2.0
- `ghc`: 9.8.4

Contributor guide

Open the contributing guide

Research direction

Start by exercising `cabal build` with `semaphore: True` in `cabal.project.local` on the reported macOS 15.5, Cabal 3.14.2.0, and GHC 9.8.4 setup. Investigate the `semWaitInterrruptible` and `semUnlink` failures; done means semaphore-enabled builds complete without these errors while retaining the expected speedup.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.