Agent process crashes with Bun segfault after long run on Linux

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

After a long agent session (around 1 hour), the agent process exits with:

  • Bun panic: “Segmentation fault at address 0x7FFD28A6A815”
  • “Illegal instruction (core dumped)”
  • Message: “This indicates a bug in Bun, not your code.”

Root cause (diagnostic): The RSS: 0.02ZB value in the crash output is the key fingerprint for this bug. Bun tracks process memory stats in a C struct — after ~45–60 minutes, an integer overflow corrupts the RSS field, which then corrupts adjacent heap memory. When the GC next tries to collect, it dereferences a wild pointer and the process receives SIGILL. The upstream fix widens the stats field to a larger integer type. Note: since Claude Code bundles Bun as a standalone executable (not the system Bun), the fix will arrive when Anthropic ships a new Claude Code release with an updated Bun build.

Steps to Reproduce

  1. Run Cursor agent (Composer / agent mode) on a Linux server.
  2. Let it run for 30–60+ minutes with tool use, terminals, and file edits.
  3. After the work completes (e.g. PR created, cleanup), the Bun process sometimes crashes with segfault and illegal instruction.

Expected Behavior

Process should exit cleanly or stay responsive; it should not crash with a native segfault / SIGILL after long agent runs.

Operating System

Linux

Version Information

Linux kernel 6.8.0, glibc 2.39, x64
Bun: 1.3.10
CPU: sse42 popcnt avx avx2 avx512
Session: ~1 hour elapsed, peak RSS ~1.5 GB before crash
Crash trigger: after agent work completed (e.g. after “Team cleaned up”), not during a specific command

Additional Information

Bun crash report link: Crash Recorded - bun.report

Partially blocks usage — long agent runs are unreliable; short sessions are fine.

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the detailed report and root cause analysis. This is super helpful.

A couple quick questions:

  1. What Cursor version are you on? (Help > About)
  2. Is this the local agent (Composer) or the Background/Cloud Agent?

I’ll pass this to the team.

As a workaround for now, please split long sessions into smaller chunks (up to 30 to 40 minutes) so you don’t hit the overflow threshold.

Let me know if there’s anything else to add.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.