Skip to content

Crash in grid_clear_lines when entering copy mode (macOS ARM64) #4962

@bcotton

Description

@bcotton

Related to #4777 (closed). Still crashing with both fixes applied:

  • 2c7f73f ("Do not use recallocarray...")
  • 035a2f3 ("Clear trimmed lines after moving...")

The crash is POINTER_BEING_FREED_WAS_NOT_ALLOCATED in grid_clear_lines, triggered when entering
copy mode after a long session (~9 hours uptime).

Stack trace:
grid_clear_lines+140
screen_reinit+256
window_copy_clone_screen+236
window_copy_init+88
window_pane_set_mode+196
cmd_copy_mode_exec+348

Environment:

  • tmux next-3.7 (pinned to d0caf0a, 2026-03-06)
  • macOS 26.3.1 (25D2128), Apple Silicon (MacBookPro18,2)
  • Terminal: Ghostty

Full crash report (macOS .ips):

{"app_name":"tmux","timestamp":"2026-03-28 16:00:19.00
-0600","app_version":"","slice_uuid":"fa45b2ee-8c88-3e40-bd0c-ab9654d2b6cf","build_version":"","p
latform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 26.3.1
(25D2128)","roots_installed":0,"incident_id":"4D27E921-A851-4850-B911-F34D2B2C51A2","name":"tmux
"}
{
"uptime" : 290000,
...
}


{"app_name":"tmux","timestamp":"2026-03-28 16:00:19.00 -0600","app_version":"","slice_uuid":"fa45b2ee-8c88-3e40-bd0c-ab9654d2b6cf","build_version":"","platform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 26.3.1 (25D2128)","roots_installed":0,"incident_id":"4D27E921-A851-4850-B911-F34D2B2C51A2","name":"tmux"}
{
"uptime" : 290000,
"procRole" : "Unspecified",
"version" : 2,
"userID" : 501,
"deployVersion" : 210,
"modelCode" : "MacBookPro18,2",
"coalitionID" : 1135,
"osVersion" : {
"train" : "macOS 26.3.1",
"build" : "25D2128",
"releaseType" : "User"
},
"captureTime" : "2026-03-28 16:00:18.5742 -0600",
"codeSigningMonitor" : 1,
"incident" : "4D27E921-A851-4850-B911-F34D2B2C51A2",
"pid" : 42304,
"translated" : false,
"cpuType" : "ARM-64",
"procLaunch" : "2026-03-28 06:45:48.5057 -0600",
"procStartAbsTime" : 6223018762094,
"procExitAbsTime" : 7021499346476,
"procName" : "tmux",
"procPath" : "/Volumes/VOLUME//tmux",
"parentProc" : "launchd",
"parentPid" : 1,
"coalitionName" : "com.mitchellh.ghostty",
"crashReporterKey" : "76991A30-3867-0999-8692-B29CCB49AED1",
"appleIntelligenceStatus" : {"state":"unavailable","reasons":["notOptedIn","siriAssetIsNotReady","assetIsNotReady"]},
"developerMode" : 1,
"responsiblePid" : 1597,
"responsibleProc" : "ghostty",
"codeSigningID" : "tmux",
"codeSigningTeamID" : "",
"codeSigningFlags" : 570556929,
"codeSigningValidationCategory" : 10,
"codeSigningTrustLevel" : 4294967295,
"codeSigningAuxiliaryInfo" : 0,
"instructionByteStream" : {"beforePC":"fyMD1f17v6n9AwCRFOD/l78DAJH9e8Go/w9f1sADX9YQKYDSARAA1A==","atPC":"AwEAVH8jA9X9e7+p/QMAkQng/5e/AwCR/XvBqP8PX9bAA1/WcAqA0g=="},
"bootSessionUUID" : "88A30596-509A-4FD3-ABBA-0DC0A0C4F4BB",
"wakeTime" : 33360,
"sleepWakeUUID" : "64C8863B-F0CC-4977-A386-0C8438ABDCE5",
"sip" : "enabled",
"exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
"termination" : {"flags":0,"code":6,"namespace":"SIGNAL","indicator":"Abort trap: 6","byProc":"tmux","byPid":42304},
"asi" : {"libsystem_c.dylib":["crashed on child side of fork pre-exec"]},
"extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":6},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
"faultingThread" : 0,
"threads" : [{"triggered":true,"id":138601240,"threadState":{"x":[{"value":0},{"value":0},{"value":0},{"value":0},{"value":115},{"value":46},{"value":1},{"value":1152},{"value":11797568139964707920},{"value":11797568135259145552},{"value":2},{"value":1099511627776},{"value":4294967293},{"value":0},{"value":0},{"value":0},{"value":328},{"value":8337575872},{"value":0},{"value":6},{"value":515},{"value":8314761696,"symbolLocation":224,"symbol":"_main_thread"},{"value":6498052002},{"value":6133060112},{"value":0},{"value":0},{"value":6133064587},{"value":8314761472,"symbolLocation":0,"symbol":"_main_thread"},{"value":4334518625}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6499924104},"cpsr":{"value":1073745920},"fp":{"value":6133058400},"sp":{"value":6133058368},"esr":{"value":1442840704,"description":"(Syscall)"},"pc":{"value":6499685808,"matchesCrashFrame":1},"far":{"value":0}},"queue":"com.apple.main-thread","frames":[{"imageOffset":38320,"symbol":"__pthread_kill","symbolLocation":8,"imageIndex":5},{"imageOffset":26760,"symbol":"pthread_kill","symbolLocation":296,"imageIndex":6},{"imageOffset":497744,"symbol":"abort","symbolLocation":124,"imageIndex":7},{"imageOffset":57892,"symbol":"malloc_vreport","symbolLocation":892,"imageIndex":8},{"imageOffset":73592,"symbol":"malloc_report","symbolLocation":64,"imageIndex":8},{"imageOffset":93700,"symbol":"___BUG_IN_CLIENT_OF_LIBMALLOC_POINTER_BEING_FREED_WAS_NOT_ALLOCATED","symbolLocation":76,"imageIndex":8},{"imageOffset":234588,"symbol":"grid_clear_lines","symbolLocation":140,"imageIndex":0},{"imageOffset":395384,"symbol":"screen_reinit","symbolLocation":256,"imageIndex":0},{"imageOffset":572476,"symbol":"window_copy_clone_screen","symbolLocation":236,"imageIndex":0},{"imageOffset":563756,"symbol":"window_copy_init","symbolLocation":88,"imageIndex":0},{"imageOffset":653796,"symbol":"window_pane_set_mode","symbolLocation":196,"imageIndex":0},{"imageOffset":36816,"symbol":"cmd_copy_mode_exec","symbolLocation":348,"imageIndex":0},{"imageOffset":91744,"symbol":"cmdq_next","symbolLocation":1452,"imageIndex":0},{"imageOffset":444436,"symbol":"server_loop","symbolLocation":92,"imageIndex":0},{"imageOffset":353036,"symbol":"proc_loop","symbolLocation":68,"imageIndex":0},{"imageOffset":442552,"symbol":"server_start","symbolLocation":664,"imageIndex":0},{"imageOffset":24124,"symbol":"client_main","symbolLocation":1044,"imageIndex":0},{"imageOffset":494252,"symbol":"main","symbolLocation":2016,"imageIndex":0},{"imageOffset":36180,"symbol":"start","symbolLocation":7184,"imageIndex":9}]}],
"usedImages" : [
{
"source" : "P",
"arch" : "arm64",
"base" : 4333813760,
"size" : 819200,
"uuid" : "fa45b2ee-8c88-3e40-bd0c-ab9654d2b6cf",
"path" : "/etc/profiles/
/tmux",
"name" : "tmux"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4335304704,
"size" : 360448,
"uuid" : "231c1b1b-d0e4-3e3d-849c-a5e49ef154a5",
"path" : "/Volumes/VOLUME//libutf8proc.3.2.2.dylib",
"name" : "libutf8proc.3.2.2.dylib"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4336107520,
"size" : 311296,
"uuid" : "1fc98d63-1b1a-397c-baa4-eb03cde8f432",
"path" : "/Volumes/VOLUME/
/libncursesw.6.dylib",
"name" : "libncursesw.6.dylib"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4335697920,
"size" : 147456,
"uuid" : "b96ba3a0-2f82-36f3-bf5f-b7903337b756",
"path" : "/Volumes/VOLUME//libevent_core-2.1.7.dylib",
"name" : "libevent_core-2.1.7.dylib"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4336517120,
"size" : 163840,
"uuid" : "56e8885e-61f2-30d9-95f3-1d91917ecc89",
"path" : "/Volumes/VOLUME/
/libresolv.9.dylib",
"name" : "libresolv.9.dylib"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 6499647488,
"size" : 246944,
"uuid" : "78ec33a6-6330-3836-8900-eb90836936e8",
"path" : "/usr/lib/system/libsystem_kernel.dylib",
"name" : "libsystem_kernel.dylib"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 6499897344,
"size" : 51916,
"uuid" : "0596a7b6-bce2-3f06-a2e8-3eaab5371ed8",
"path" : "/usr/lib/system/libsystem_pthread.dylib",
"name" : "libsystem_pthread.dylib"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 6498398208,
"size" : 532552,
"uuid" : "eb569350-0696-3397-838e-0344948107c0",
"path" : "/usr/lib/system/libsystem_c.dylib",
"name" : "libsystem_c.dylib"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 6497783808,
"size" : 310376,
"uuid" : "102061ad-ac62-30e9-a960-0cc2e38a2d5d",
"path" : "/usr/lib/system/libsystem_malloc.dylib",
"name" : "libsystem_malloc.dylib"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 6495916032,
"size" : 653076,
"uuid" : "044cd67e-3a0a-3ca4-8bb3-a9687d5328fe",
"path" : "/usr/lib/dyld",
"name" : "dyld"
},
{
"size" : 0,
"source" : "A",
"base" : 0,
"uuid" : "00000000-0000-0000-0000-000000000000"
}
],
"sharedCache" : {
"base" : 6494830592,
"size" : 5820792832,
"uuid" : "674db25a-34b2-3c56-8bd4-7d78005b2f2e"
},
"vmSummary" : "ReadOnly portion of Libraries: Total=595.3M resident=0K(0%) swapped_out_or_unallocated=595.3M(100%)\nWritable regions: Total=141.3M written=193K(0%) resident=193K(0%) swapped_out=0K(0%) unallocated=141.1M(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nActivity Tracing 256K 1 \nKernel Alloc Once 32K 1 \nMALLOC 132.8M 24 \nMALLOC guard page 32K 2 \nSTACK GUARD 56.0M 1 \nStack 8176K 1 \nVM_ALLOCATE 16K 1 \n__AUTH 35K 13 \n__AUTH_CONST 202K 44 \n__DATA 251K 38 \n__DATA_CONST 253K 47 \n__DATA_DIRTY 152K 36 \n__LINKEDIT 587.6M 6 \n__OBJC_RO 78.4M 1 \n__OBJC_RW 2571K 1 \n__TEXT 7804K 50 \n__TPRO_CONST 128K 2 \npage table in kernel 193K 1 \nshared memory 48K 2 \n=========== ======= ======= \nTOTAL 874.6M 272 \n",
"legacyInfo" : {
"threadTriggered" : {
"queue" : "com.apple.main-thread"
}
},
"logWritingSignature" : "d6c2f5a788244d6f644952cc4b34d3fc9591ca1d",
"bug_type" : "309",
"roots_installed" : 0,
"trmStatus" : 1,
"trialInfo" : {
"rollouts" : [
{
"rolloutId" : "67fd77fe1f9da9148f70d6ed",
"factorPackIds" : [

  ],
  "deploymentId" : 240000020
},
{
  "rolloutId" : "64c17a9925d75a7281053d4c",
  "factorPackIds" : [
    "64d29746ad29a465b3bbeace"
  ],
  "deploymentId" : 240000002
}

],
"experiments" : [

]
}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions