[Bug] High CPU usage and input lag from futex contention with sched_yield spin-waiting

Resolved 💬 3 comments Opened Jan 11, 2026 by blockems Closed Jan 15, 2026

Bug Description
futex contention + sched_yield spin-waiting causing 80%+ CPU and multi-second input lag

| time % | seconds | usecs/call | calls | errors | syscall |
|--------|---------|------------|-------|--------|---------|
| 67.17 | 8.648213 | 1292 | 6691 | 593 | futex |
| 11.06 | 1.423371 | 118614 | 12 | 4 | restart_syscall |
| 9.77 | 1.257509 | 19960 | 63 | | epoll_pwait2 |
| 7.80 | 1.004175 | 85 | 11791 | | sched_yield |
| 3.74 | 0.481445 | 59 | 8105 | | madvise |
| 0.28 | 0.036002 | 10 | 3499 | | pread64 |
| 0.05 | 0.007019 | 38 | 184 | | statx |
| 0.04 | 0.005431 | 27 | 196 | 184 | access |
| 0.04 | 0.005192 | 13 | 383 | | clock_gettime |
| 0.02 | 0.002756 | 30 | 89 | | write |
| 0.01 | 0.001065 | 28 | 38 | | recvfrom |
| 0.00 | 0.000453 | 18 | 24 | | timerfd_settime |
| 0.00 | 0.000342 | 342 | 1 | | gettid |
| 0.00 | 0.000312 | 62 | 5 | | rt_sigprocmask |
| 0.00 | 0.000305 | 12 | 25 | 24 | epoll_ctl |
| 0.00 | 0.000244 | 244 | 1 | | clone3 |
| 0.00 | 0.000215 | 23 | 9 | | close |
| 0.00 | 0.000163 | 163 | 1 | | prctl |
| 0.00 | 0.000140 | 17 | 8 | | openat |
| 0.00 | 0.000111 | 111 | 1 | | set_robust_list |
| 0.00 | 0.000109 | 109 | 1 | | sched_getaffinity |
| 0.00 | 0.000088 | 1 | 55 | | read |
| 0.00 | 0.000059 | 59 | 1 | | sched_setscheduler |
| 0.00 | 0.000029 | 29 | 1 | | rseq |
| 0.00 | 0.000000 | 0 | 1 | | sendto |
| 100.00 | 12.874748 | 412 | 31185 | 805 | total |

Environment Info

  • Platform: linux
  • Terminal: windows-terminal
  • Version: 2.1.4
  • Feedback ID: a8e5e4a4-93a2-409b-aa8c-2f0825ce6d04

Errors

[{"error":"Error: String not found in file. Failed to apply edit.\n    at jyH (/$bunfs/root/claude:2039:731)\n    at YC$ (/$bunfs/root/claude:2039:107)\n    at s9D (/$bunfs/root/claude:2092:123)\n    at HdI (/$bunfs/root/claude:1798:2286)\n    at E5 (/$bunfs/root/claude:680:20691)\n    at fG (/$bunfs/root/claude:680:39063)\n    at _R (/$bunfs/root/claude:680:49671)\n    at W5 (/$bunfs/root/claude:680:85807)\n    at ph (/$bunfs/root/claude:680:84787)\n    at Fq (/$bunfs/root/claude:680:84612)","timestamp":"2026-01-11T08:51:02.632Z"},{"error":"Error: String not found in file. Failed to apply edit.\n    at jyH (/$bunfs/root/claude:2039:731)\n    at YC$ (/$bunfs/root/claude:2039:107)\n    at s9D (/$bunfs/root/claude:2092:123)\n    at HdI (/$bunfs/root/claude:1798:2286)\n    at E5 (/$bunfs/root/claude:680:20691)\n    at fG (/$bunfs/root/claude:680:39063)\n    at _R (/$bunfs/root/claude:680:49671)\n    at W5 (/$bunfs/root/claude:680:85807)\n    at ph (/$bunfs/root/claude:680:84787)\n    at Fq (/$bunfs/root/claude:680:84612)","timestamp":"2026-01-11T08:51:03.896Z"},{"error":"Error: String not found in file. Failed to apply edit.\n    at jyH (/$bunfs/root/claude:2039:731)\n    at YC$ (/$bunfs/root/claude:2039:107)\n    at s9D (/$bunfs/root/claude:2092:123)\n    at HdI (/$bunfs/root/claude:1798:2286)\n    at E5 (/$bunfs/root/claude:680:20691)\n    at fG (/$bunfs/root/claude:680:39063)\n    at _R (/$bunfs/root/claude:680:49671)\n    at W5 (/$bunfs/root/claude:680:85807)\n    at ph (/$bunfs/root/claude:680:84787)\n    at Fq (/$bunfs/root/claude:680:84612)","timestamp":"2026-01-11T08:51:13.437Z"},{"error":"Error: String not found in file. Failed to apply edit.\n    at jyH (/$bunfs/root/claude:2039:731)\n    at YC$ (/$bunfs/root/claude:2039:107)\n    at s9D (/$bunfs/root/claude:2092:123)\n    at HdI (/$bunfs/root/claude:1798:2286)\n    at E5 (

Note: Error logs were truncated.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗