Tk Source Code

Artifact [e6ec51e0]
Login

Artifact e6ec51e01f77773a04b913ec90d1217d3928eb81e3d960f215253a38f1367df5:

Ticket change [e6ec51e0] - Add attachment report.tar.gz to ticket [b964b98d] by anonymous 2026-07-06 11:36:53.
A report.tar.gz b964b98d1b1fa9bc1abf08a09bcaef20c4ed0baf 94e7689385a50350e57548f313fee340ba68d96d5130f739ca1d22c1557bd1c3
C #\sTk\son\smacOS/Aqua:\suse-after-free\sfamily\sin\sthe\sgeometry-relayout\spath\sduring\swindow\steardown\sand\s`wm\smanage`/`wm\sforget`\sreparent\r\n\r\nRelates\sto\sticket\s**`b964b98d1b`**\s("ttk\smanager\srelayout\suse-after-free\sduring\steardown\s(Aqua)").\r\nThis\sreport\ssupersedes\sthe\soriginal\swith\s(a)\sa\s**deterministic,\sstandalone\s`wish`\sreproducer**\sand\sa\r\n**fix**\sfor\sthe\sticket\sas\sfiled,\sand\s(b)\s**AddressSanitizer\sfree-sites**\sfor\sa\sdeeper,\srelated\sfamily\sof\r\nUAFs\sthat\sthe\ssame\sworkload\sexposes\son\sAqua,\splus\sa\sfix\sfor\sone\smore\sof\sthem.\r\n\r\nPlatform:\smacOS\s26.x\s/\sarm64,\sAqua\sbackend.\sTk\s9.0.3\sand\s9.0.4\s(the\srelevant\scode\sis\sidentical\sbetween\r\nthem\sand\son\strunk).\sNot\sreproducible\son\sX11\s—\ssee\s"Why\sAqua\sonly"\sbelow.\sAll\ssymbol\soffsets\sbelow\sare\r\nfrom\sunstripped\s`-g`\sbuilds;\sthe\sstandalone\sreport\shas\s`file:line`.\r\n\r\n---\r\n\r\n##\sPart\s1\s—\sTicket\s`b964b98d1b`\sas\sfiled:\sreproducer\s+\sfix\s(actionable)\r\n\r\n###\sMechanism\r\n\r\n`Tk_MoveResizeWindow()`\s/\s`Tk_MapWindow()`\sdeliver\s`<Configure>`/`<Map>`\s**synchronously**\son\sAqua\r\n(`TkDoConfigureNotify`\s→\s`Tk_HandleEvent`,\sand\sthe\sAqua\sstubs\spump\sthe\srun\sloop).\sA\sttk\sgeometry\r\nmanager's\sdeferred\srelayout\s(`ManagerIdleProc\s→\sPlaceContent\s→\sTtk_PlaceContent\s→\r\nTk_MaintainGeometry\s→\sTk_MoveResizeWindow`)\stherefore\sruns\sa\sTcl\sbinding\s/\snested\srelayout\s**in\sthe\r\nmiddle\sof\splacing\sa\scontent\swindow**.\sIf\sthat\sre-entrant\swork\sdestroys\sa\scontent\swindow\s(or\sforgets\sa\r\npane),\s`RemoveContent()`/`Tk_UnmaintainGeometry()`\sfrees\sthe\srecord\sthe\souter\splacement\sstill\sholds,\sand\r\nthe\splacement\sthen\sdereferences\sfreed\smemory.\sOn\sX11\sthe\s`<Configure>`\sis\squeued,\sso\sthe\srelayout\r\nunwinds\sbefore\sanything\sis\sfreed\sand\sthe\sbug\snever\smanifests.\r\n\r\n###\sDeterministic\sstandalone\sreproducer\s—\scrashes\sstock\s`wish`\r\n\r\n`repro/repro-b964b98d-standalone-wish.tcl`.\sIt\sbuilds\sa\s`ttk::panedwindow`,\sbinds\s`<Configure>`\son\sthe\r\npane\sthat\sis\sabout\sto\sbe\splaced\sso\sthe\sbinding\s**destroys\sthat\spane\swhile\sit\sis\sbeing\splaced**,\sthen\r\nresizes\sin\sa\sloop.\sUnpatched\s`wish`\s9.0.4:\r\n\r\n-\s**macOS/Aqua:\s`SIGBUS`\severy\srun**\s(write\sto\s`winPtr->flags\s|=\sTK_MAPPED`\sthrough\sa\sfreed\scontent\r\n\s\swindow;\sthe\s`x0`\sarg\sto\s`Tk_MapWindow`\sis\sa\swild\spointer\sinto\s`__TEXT`).\r\n-\s**Linux/X11:\s`SIGSEGV`\severy\srun**\s—\si.e.\sthis\sreduced\sform\sis\s**not**\sactually\sAqua-only;\sthe\r\n\s\ssynchronous\s`<Configure>`\sfrom\s`Tk_MoveResizeWindow\s→\sTkDoConfigureNotify`\sis\sgeneric.\s(The\s*field*\r\n\s\sreports\swere\sAqua-only\sbecause\sonly\sAqua's\sspontaneous\srun-loop\spumping\striggers\sit\swithout\ssuch\sa\r\n\s\sbinding.)\r\n\r\n###\sAddressSanitizer\s—\sfree-site\r\n\r\n`asan/01-original-reentrancy--Tk_MapWindow--stock-wish.txt`\s(standalone\s`wish`,\s`-DPURIFY`\sso\sTcl's\r\nallocator\shands\sfrees\sto\sASan):\r\n\r\n```\r\nheap-use-after-free\s\sREAD,\sin\sTk_MapWindow\s\s\s\s\s\s\s\s\s\s\s\stkWindow.c:1782\r\n\s\s#1\sTk_MaintainGeometry\s\s\stkGeometry.c:446\s\s\s\s\s\s\s\s\s\s\s(direct-child\sfast\spath)\r\n\s\s#2\sTtk_PlaceContent\s\s\s\s\s\sttkManager.c:372\r\n\s\s#3\sPlacePanes\s/\sPanedPlaceContent\r\n\s\s#4\sRecomputeLayout\s←\sManagerIdleProc\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s(the\sdeferred\srelayout\sidle)\r\nfreed\sby:\r\n\s\s#2\sTcl_EventuallyFree\s\s\s\stclPreserve.c:294\r\n\s\s#3\sTk_DestroyWindow\s\s\s\s\s\stkWindow.c:1755\r\n\s\s#4\sTk_DestroyObjCmd\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s(the\s"destroy"\srun\sby\s…)\r\n\s\s#10\sTk_BindEvent\s\s\s\s\s\s\s\s\stkBind.c:2582\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s(…\sa\s<Configure>\sbinding\s…)\r\n\s\s#13\sTkDoConfigureNotify\s\stkWindow.c:2365\s\s\s\s\s\s\s\s\s\s\s\s\s(…\sdelivered\ssynchronously\sby\s…)\r\n\s\s#14\sTk_MoveResizeWindow\s\stkWindow.c:2069\s\s\s\s\s\s\s\s\s\s\s\s\s(…\sthe\svery\splacement\smove)\r\n```\r\n\r\n###\sFix\s—\s`patches/01-tk-b964b98d-reentrancy-uaf.patch`\s(3\sfiles,\sgeneric\s+\sttk)\r\n\r\nApplies\sfrom\sthe\sTk\ssource\sroot\s(`patch\s-p1`);\sagainst\s9.0.3/9.0.4,\sports\sto\strunk\swith\strivial\sfuzz.\r\n\r\n1.\s`generic/ttk/ttkManager.c`\s—\san\s`epoch`\scounter\son\sthe\smanager,\sbumped\son\severy\s`content[]`\r\n\s\s\smutation\s(`InsertContent`,\s`RemoveContent`,\s`Ttk_ReorderContent`).\s`Ttk_PlaceContent`\s/\r\n\s\s\s`Ttk_UnmapContent`\sbounds-check\sthe\sindex,\sskip\scontent\swhose\swindow\sis\s`TK_ALREADY_DEAD`,\sand\r\n\s\s\s**re-check\sthe\sepoch\safter\s`Tk_MaintainGeometry`**\s—\sbailing\swithout\stouching\sthe\s(possibly-freed)\r\n\s\s\srecord\sif\sthe\slist\schanged.\sBailing\sis\ssafe:\severy\smutation\spath\sschedules\sa\sfresh\srelayout.\sThe\r\n\s\s\s`ManagerEventHandler`\sMap/Unmap\sloops\sand\s`ManagerIdleProc`\sget\smatching\sguards.\r\n2.\s`generic/ttk/ttkPanedwindow.c`\s—\s`PlacePanes`\sreads\s`pane->sashPos`\s**before**\sthe\splacement\scall\r\n\s\s\s(the\s`Pane`\scan\sbe\sfreed\sby\sit).\r\n3.\s`generic/tkGeometry.c`\s—\s`Tk_MaintainGeometry`'s\sdirect-child\sfast\spath\swraps\sthe\r\n\s\s\s`Tk_MoveResizeWindow`\s+\s`Tk_MapWindow`\spair\sin\s`Tcl_Preserve`/`Tcl_Release`\sand\sskips\sthe\smap\swhen\r\n\s\s\seither\swindow\sdied\sin\sthe\ssynchronous\s`<Configure>`.\r\n\r\nValidated:\sthe\sstandalone\sreproducer\sgoes\sfrom\scrash-every-run\sto\s0\scrashes\son\sboth\sAqua\sand\sX11;\sASan\r\nbuild\sreports\snothing;\s`tests/ttk`\s200/200\sbefore\sand\safter.\r\n\r\n---\r\n\r\n##\sPart\s2\s—\sThe\sdeeper\sfamily\sthe\ssame\sworkload\sexposes\s(ASan\sfree-sites\sattached)\r\n\r\nOnce\sPart\s1's\sfix\sis\sin,\sa\s*heavier*\sversion\sof\sthe\sworkload\s—\sfloat/dock\schurn\s(`wm\smanage`\s/\r\n`wm\sforget`)\sof\sa\s**deep**\swidget\ssubtree,\se.g.\sa\sscroll\sviewport\s+\snested\spanes\s+\sa\splaced\soverlay\s—\r\nstill\scrashes\son\sAqua.\sIt\sis\sthe\ssame\sshape\sone\slayer\sdown:\s**drawable/record\sreferences\sthat\soutlive\sa\r\ndestroy\sor\sreparent,\sdereferenced\sby\sa\slater\srelayout.**\sWe\scaptured\sthese\swith\san\sAddressSanitizer\r\nbuild\s(recipe\sin\s`repro/build-asan-player.sh`);\seach\sis\sdeterministic\sunder\sASan.\r\n\r\nNote\son\sthe\sreproducer:\sthis\sheavier\svariant\sdid\s**not**\sreduce\sto\sa\sstandalone\s`wish`\sscript\s(five\r\nattempts\sin\s`repro/standalone-attempts/`\sall\ssurvive)\s—\sit\sneeds\sa\shost\sthat\sdrives\sfloat/dock\schurn\r\nfrom\sinside\sthe\sevent\sloop.\sThe\sattached\s`repro/churn-heavy.js`\sreproduces\sit\s~90%/run\sin\sour\shost\r\n(embeds\sTk\svia\sCGo).\sWe\srecognize\sthat\sis\sless\sconvenient\sthan\sa\s`wish`\sscript\sand\sare\shappy\sto\shelp\sa\r\nmaintainer\sreproduce;\sthe\sASan\sstacks\sbelow\sare\sunambiguous\sregardless.\r\n\r\n###\sFree-site\sA\s—\srefcounted\s`toplevel`\s`MacDrawable`\sdangles\s→\s**fixed**,\s`patches/02-…`\r\n\r\n`asan/02-heavy-toplevel-MacDrawable--MoveResizeWindow.txt`:\r\n\r\n```\r\nheap-use-after-free\s\sREAD,\sin\sMoveResizeWindow\s\s(macosx/tkMacOSXSubwindows.c)\r\n\s\s\s←\sXMoveResizeWindow\s←\sTk_MoveResizeWindow\s←\sTk_MaintainGeometry\s←\sTtk_PlaceContent\s←\srelayout\r\n\s\s\s(reads\smacWin->toplevel->winPtr\svia\sTkMacOSXGetNSWindowForDrawable,\son\sa\sLIVE\swindow)\r\nfreed\sby:\s\sXDestroyWindow\s(referenceCount==0)\s←\sTk_DestroyWindow\s←\s[destroy]\r\nallocated:\sTk_MakeWindow\s←\sTk_MakeWindowExist\s\s(a\srefcounted\stoplevel\sMacDrawable)\r\n```\r\n\r\nRoot\scause\sis\sin\s**`RemapWindows()`**\s(`macosx/tkMacOSXWm.c`,\sthe\s`wm\smanage`/`wm\sforget`\ssubtree\r\nreparent\swalk):\sit\srecurses\sinto\schildren\spassing\s`winPtr->window`\sas\stheir\s`parentWin`,\sbut\swhen\san\r\nintermediate\swindow\sis\snot\syet\srealized\s(`window\s==\sNone`)\sit\spasses\s`None`.\sEach\schild\sthen\sdoes\r\n`macWin->toplevel\s=\s((MacDrawable\s*)None)->toplevel`\s—\sreading\swild\smemory\sand,\sworse,\s**decrementing\r\nits\sreal\stoplevel's\s`referenceCount`\swhile\sre-pointing\selsewhere**,\sso\sa\slive\s`toplevel`\sMacDrawable\sis\r\nfreed\searly\sand\severy\swindow\sstill\sreferencing\sit\sdangles.\sDeep\ssubtrees\s(many\sunrealized\sframes\sduring\r\nchurn)\shit\sit.\sFix\s(`patches/02-tk-remapwindows-toplevel-refcount.patch`,\sone\shunk):\spass\sthe\snearest\r\n*realized*\sancestor's\sdrawable\sdown\sinstead\sof\s`None`.\sValidated\sunder\sASan\s—\sthis\sfree-site\sis\sgone.\r\n\r\n###\sFree-site\sB\s—\spack\s`MaintainContent`/`MaintainContainer`\sre-entrancy\r\n\r\n`asan/03-heavy-pack-MaintainContent--Tk_MaintainGeometry.txt`\s(with\sfix\sA\sapplied):\r\n\r\n```\r\nheap-use-after-free\s\sREAD,\sin\sTk_MaintainGeometry\s\s(generic/tkGeometry.c)\r\n\s\s\s←\sArrangePacking\s←\sTclServiceIdle\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s(a\spack\srelayout\sidle)\r\nfreed\sby:\s\sTk_UnmaintainGeometry\s←\sTk_PackObjCmd\s\s\s\s\s("pack\sforget"\sduring\sthe\schurn)\r\nallocated:\sTk_MaintainGeometry\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s(the\sMaintainContainer/Content\srecord)\r\n```\r\n\r\nA\sre-entrant\s`pack\sforget`\sfrees\sthe\s`Maintain*`\srecord\sthat\san\sin-flight\s`Tk_MaintainGeometry`\s(driven\r\nby\sa\spack\srelayout\sidle)\sstill\sholds\s—\sthe\sgeneric-code\sanalogue\sof\sPart\s1,\sin\s`tkGeometry.c`'s\r\nslow-path\smaintain\smachinery.\sNot\syet\sfixed;\sa\s`Tcl_Preserve`/re-validate\sguard\saround\sthe\spump-capable\r\ncalls\sis\sthe\slikely\sshape,\smirroring\sPart\s1's\sfast-path\sfix.\r\n\r\n###\sIt\sis\sa\sfamily,\snot\sa\ssingle\sbug\r\n\r\nEach\stargeted\sfix\sshifts\sthe\scrash\sto\sthe\snext\sfreed\sstructure:\sttk\s`Ttk_Content`\s(Part\s1)\s→\stoplevel\r\n`MacDrawable`\s(A)\s→\spack\s`MaintainContent`\s(B)\s→\sa\s*relative*\s`MacDrawable`\sread\sby\sthe\smove\sstubs\s→\s…\r\nWe\salso\stried\stwo\s*general*\sfixes\sand\sreport\sthem\sas\sdead\sends\sso\sthey\sare\snot\sre-attempted:\r\n\r\n-\s**Suppress\sidle\sservicing\sduring\steardown/reparent**\s(the\sapproach\ssuggested\son\sthe\soriginal\sticket).\r\n\s\sDoes\snot\swork:\sthere\sare\smany\sidle-drain\ssites\son\sAqua\s(`MapFrame`,\s`TkInstallFrameMenu`,\s`setState`,\r\n\s\s`updateLayer`,\sthe\sCFRunLoop\snotifier),\sand\sthe\sdangling\s*use*\shappens\sin\sa\s**later**\sevent\safter\sthe\r\n\s\steardown\sreturns,\sso\sa\steardown-scoped\sguard\scannot\scover\sit.\r\n-\s**A\s`winTable`-validity\sguard\son\sthe\sAqua\smove\sstubs**\s(`XMoveResizeWindow`/`XMoveWindow`/\r\n\s\s`XResizeWindow`,\susing\s`Tk_IdToWindow()`\s—\sa\snon-dereferencing\shash\scheck).\sDoes\snot\sfully\swork:\sthe\r\n\s\sfreed\sobject\sis\soften\sa\s*relative*\s(`macWin->toplevel`,\sthe\sparent's\s`privatePtr`)\swhile\sthe\smoved\r\n\s\swindow\sitself\sis\sstill\sregistered;\sand\son\sAqua\s`Tk_DestroyWindow`\s**frees\sthe\s`MacDrawable`\r\n\s\s(`XDestroyWindow`,\s~`tkWindow.c:1578`)\sbefore\sremoving\sit\sfrom\s`winTable`\s(~`:1592`)**,\sso\sa\r\n\s\sfreed-but-still-registered\sdrawable\sis\sadmitted.\s(That\sordering\s—\sdelete-from-winTable\sbefore\sfree\s—\r\n\s\slooks\sworth\sfixing\son\sits\sown.)\r\n\r\nThe\sunderlying\scondition\sis\sthat\sAqua's\ssynchronous\srun-loop\spumping\slets\sgeometry\srelayouts\srun\sagainst\r\ndrawables/records\sthat\sare\sfreed\sbut\sstill\sreferenced\sfrom\sseveral\splaces,\swith\sno\ssingle\schoke\spoint.\r\nA\scomplete\sfix\sis\sa\ssystematic\spass\sover\sthe\s`MacDrawable`/`toplevel`-refcount\slifecycle\sand\sthe\r\nmove/relayout\sstubs\s(plus\sthe\swinTable\sdelete-before-free\sreorder),\sgated\sby\sthe\sfull\sTk\sregression\r\nsuite.\sWe're\sdeferring\sthat\sbehind\san\sapp-side\sworkaround\sand\sraising\sit\shere\swith\sthe\sevidence\sso\sthe\r\nlifecycle\swork\scan\sstart\sfrom\sASan\sstacks\srather\sthan\sguesswork.\r\n\r\n---\r\n\r\n##\sWhy\sAqua\sonly\r\n\r\nThe\sgeneric\sre-entrancy\sin\sPart\s1\salso\sbites\sX11\swith\sthe\sexplicit\sbinding,\sbut\snot\sspontaneously,\r\nbecause\s`Tk_MoveResizeWindow`/`Tk_MapWindow`\sdo\snot\spump\sthe\sevent\sloop\son\sX11.\sPart\s2's\sfamily\sis\r\nAqua-specific:\sthe\splatform\smove/map\sstubs\s(`macosx/tkMacOSXSubwindows.c`)\sdeliver\s`<Configure>`\r\nsynchronously\sand\spump\sthe\sCocoa\srun\sloop,\sso\srelayouts\srun\smid-teardown/mid-reparent\swhere\sX11\swould\r\nhave\sdeferred\sthem.\r\n\r\n##\sContents\sof\sthe\sattached\sarchive\s—\s`report.tar.gz`\r\n\r\nExtracts\sto\s`report/`:\r\n\r\n```\r\nreport.md\s\s\sThis\sreport.\r\n\r\npatches/\r\n\s\s01-tk-b964b98d-reentrancy-uaf.patch\s\s\s\s\s\s\s\s\s\sPart\s1\sfix\s(the\sticket\sas\sfiled).\s3\sfiles:\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sgeneric/ttk/ttkManager.c,\sgeneric/ttk/ttkPanedwindow.c,\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sgeneric/tkGeometry.c.\s`patch\s-p1`\sfrom\sthe\sTk\ssource\sroot;\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sagainst\s9.0.3/9.0.4,\sports\sto\strunk\swith\strivial\sfuzz.\r\n\s\s02-tk-remapwindows-toplevel-refcount.patch\s\s\sPart\s2\sfree-site\sA\sfix.\s1\shunk\sin\smacosx/tkMacOSXWm.c.\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s`patch\s-p1`\sfrom\sthe\ssource\sroot.\r\n\r\nasan/\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sAddressSanitizer\sreports\s(heap-use-after-free;\sfull\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\salloc\s+\sfree\s+\suse\sstacks).\r\n\s\s01-original-reentrancy--Tk_MapWindow--stock-wish.txt\s\s\s\s\s\sPart\s1,\sstandalone\swish,\sfile:line\ssymbols.\r\n\s\s02-heavy-toplevel-MacDrawable--MoveResizeWindow.txt\s\s\s\s\s\s\sPart\s2\sfree-site\sA\s(before\spatch\s02).\r\n\s\s03-heavy-pack-MaintainContent--Tk_MaintainGeometry.txt\s\s\s\sPart\s2\sfree-site\sB\s(after\spatch\s02).\r\n\r\nrepro/\r\n\s\srepro-b964b98d-standalone-wish.tcl\s\s\sPart\s1\sreproducer.\s`wish\srepro-b964b98d-standalone-wish.tcl`\s—\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\scrashes\sstock/unpatched\sTk\s9.0.4\severy\srun\s(SIGBUS\son\sAqua,\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sSIGSEGV\son\sX11),\s0\swith\spatch\s01.\r\n\s\schurn-heavy.js\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sPart\s2\sreproducer\s(host-driven\sfloat/dock\schurn\sof\sa\sdeep\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\ssubtree;\sneeds\sa\sTk-embedding\shost).\s~90%/run\son\sAqua.\r\n\s\sbuild-asan-player.sh\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sASan\sbuild\srecipe\s(-fsanitize=address\s-g\s-DPURIFY\son\sTcl+Tk;\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s-DPURIFY\sessential\s—\swithout\sit\sTcl's\sckalloc\srecycler\shides\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sfrees\sfrom\sASan).\sAdapt\sthe\sfinal\slink\sstep\sto\syour\shost/wish.\r\n\s\sstandalone-attempts/\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sFive\swish\sscripts\sthat\stry\sand\sfail\sto\sreduce\sPart\s2\sto\sa\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sstandalone\sscript\s(they\ssurvive\son\sa\spatched\sbuild)\s—\skept\sso\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sthe\sreduction\sisn't\sre-attempted\sblindly.\r\n\r\nbackground/\r\n\s\sTK_TTK_MANAGER_MACOS_UAF.md\s\s\s\s\s\s\s\s\s\s\s\s\s\sThe\soriginal\supstream\swrite-up\sfor\sb964b98d1b.\r\n\s\sTK_MACOS_HEAVY_SUBTREE_RACE_FINDINGS.md\s\sFull\smulti-layer\sfindings:\severy\sfree-site,\sthe\sthree\sfix\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sapproaches\stried\s(one\slanded,\stwo\sdead\sends\sand\swhy),\sand\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sthe\s"no\sbounded\sfix\s/\slifecycle\spass\sneeded"\sconclusion.\r\n```\r\n\r\nFull\sdisclosure:\sThe\sabove\sreport\sand\sthe\sattached\sartifacts\swere\sboth\sproduced\sby\san\sAI\safter\smultiple\sdebugging\ssessions.
D 2026-07-06T11:36:53.415
U anonymous
Z 19f970a8c36f2aff13862375b9aea5ac