AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 29 Bitcoin

Fix startup failure with RLIM_INFINITY fd limits

Public commit record

What the developer wrote

Authored by Sjors Provoost

78/100 · Adequate
Fix startup failure with RLIM_INFINITY fd limits

When setting the fd limit to unlimited, the node fails to start:

ulimit -n unlimited
build/bin/bitcoind
Error: Not enough file descriptors available. -1 available, 160 required.

This was caused by RaiseFileDescriptorLimit() casting limitFD.rlim_cur
to int, which for RLIM_INFINITY overflows to -1. Fix it by returning
std::numeric_limits<int>::max() instead.

This commit also adds a functional test, which is skipped on environments
with a hard limit below infinity.

Co-authored-by: Luke Dashjr <luke-jr+git@utopios.org>
Co-authored-by: winterrdog
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug where Bitcoin Core would refuse to start if the user's system was configured to allow an unlimited number of open files ('ulimit -n unlimited'). The program incorrectly treated 'unlimited' as -1 available file descriptors, then reported 'Not enough file descriptors available' and exited. The fix makes the program recognize 'unlimited' as the maximum integer value instead, so startup succeeds. This is a reliability/availability fix, not a security vulnerability that an attacker can exploit.

Recommended action

Apply the patch to restore correct startup behavior on systems with unlimited file-descriptor limits. No urgent security response is needed; treat as a normal bug fix.

Security signals we found

01

Integer conversion/casting issue: RLIM_INFINITY cast to int yields -1

02

Denial-of-service-like symptom: local node fails to start under a legitimate system configuration

03

No attacker-controlled input or privilege boundary crossed

04

Fix is localized to resource-limit handling with added bounds/Asserts

Risk score

Why this scored 29/100

Our methodology →
Potential impact 8/30
Exploitability 0/25
Stealth signal 2/15
Affected reach 5/15
Confidence 9/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.