macOS TCP Networking Bug: A Ticking Time Bomb That Detonates After Exactly 49 Days
Available in: 中文
Researchers at Photon have discovered a critical bug in macOS networking: TCP connections stop working entirely after the system has been running for exactly 49.7 days — a classic integer overflow ...
Researchers at Photon have discovered a critical bug in macOS networking: TCP connections stop working entirely after the system has been running for exactly 49.7 days — a classic integer overflow that turns any long-running Mac into an isolated island with no network access.
The Bug
The discovery reveals a fundamental flaw in macOS's TCP implementation:
- Trigger: System uptime reaches approximately 49.7 days (4,294,967,295 milliseconds — the maximum value of a 32-bit unsigned integer)
- Effect: All TCP networking stops functioning — no web, no email, no API calls, no SSH
- Cause: Integer overflow in a millisecond counter used by the TCP stack
- Severity: Critical for servers, critical infrastructure, and always-on Macs
- Fix: A simple reboot resolves the issue — until 49.7 days later
Why 49.7 Days?
This is a classic computer science problem:
- 2^32 milliseconds = 4,294,967,295 ms ≈ 49.7 days
- Integer overflow: When the counter wraps around, calculations produce incorrect values
- Historical precedent: Similar bugs have affected GPS systems (week rollover), Unix time (Y2038 problem), and various network protocols
Who Is Affected?
Any Mac running for extended periods:
- Mac Mini servers: Often run for months without rebooting
- macOS CI/CD runners: Build servers that stay online continuously
- Development machines: Developers who rarely restart their Macs
- Apple Silicon Macs: All architectures affected
- macOS Sequoia and earlier: Confirmed affected versions
The Impact
For different use cases, the impact varies:
- Personal Mac: Annoying but fixable with reboot
- Mac server: Complete service outage
- CI/CD pipeline: Failed builds, lost productivity
- IoT/edge Mac: Remote devices losing connectivity
- Production services: Potential data loss, SLA violations
The Research
The team at Photon discovered the bug while investigating network issues with their own long-running Mac servers:
- Discovery method: Systematic debugging of unexplained network failures
- Confirmation: Reproduced reliably on multiple Mac systems
- Disclosure: Published as a public service to the Mac community
- HN reception: 86 points, 44 comments within hours of posting
What Apple Should Do
The fix is straightforward:
- Use 64-bit counters instead of 32-bit for time calculations
- Add monitoring for uptime-based issues in the networking stack
- Implement automatic recovery when overflow is detected
Broader Implications
This bug highlights persistent challenges in software engineering:
- Integer overflow remains a problem even in 2026, despite being a well-known class of bug
- Long-running systems expose bugs that testing doesn't catch
- Apple's QA process should include extended uptime testing
- Classic bugs like Y2K and GPS week rollover keep recurring in new forms
← Previous: AI Has Flooded All the Weather Apps: Machine Learning Transforms Forecasting From Data to ConversationsNext: Trump Proposes Massive 55% Cut to NSF Budget, Dissolves Social Sciences Division in 2027 Budget Plan →
0