Repository navigation
-mm=own: fixes from mm_fuzz.py campaigns; --deep fuzzer mode - #1130
Open
ASDAlexander77 wants to merge 2 commits into
Open
ASDAlexander77 wants to merge 2 commits into
ASDAlexander77 wants to merge 2 commits into
Conversation
Found by running mm_fuzz.py --classes and a new --deep mode against the TSLANG 240 build:
- A call's result that borrows a counted argument (`const r = g(h, h.n)` of a `g` returning its
argument) holds the count until its own last use, not just the call.
- A virtual call through `this` lent back (`k.self().drain(k.arr[0])` of an overridden `drain`)
and a call on a module-level object (`k.drain(k.at(0))`, each mention a load of its own) reach
what the borrow was read from: counted, where they were neither counted nor refused.
- A chain with no root known no longer takes the owned-root shortcut (all_of over no roots).
- A counted read stored into a record (`f({ v: g.items[0] })`) or used by a call in a `try`
(an invoke ends its block) is not counted: refused as before TSLANG 240.
- A closure's copy of a parameter in a function that returns a borrow of it is checked as a
capture (refused), not taken for the returned value's reference.
- A parameter given twice to one call that keeps both is a use after move.
mm_fuzz.py --deep adds a subclass overriding K's methods, a getter/setter, a call that throws
after freeing, and a generator method.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he call Found by mm_fuzz.py --classes: a call on the right side that gives the place another array released the one the left side read, and the store and the growth went into a freed block. The array is now held in a slot the scope owns, retained right after its read: given back where the scope ends, and on the unwind when the call throws (a release after the store would leak it then - why the call case was left open). In module-level code, where no scope owns slots, it is released after the store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes for what
mm_fuzz.pyfound in three campaigns against the TSLANG 240 build (1,500 programs each:--classes, the new--deep,--classesagain), plus the new--deepmode.Regressions from TSLANG 240 (counting every argument form)
const r = g(h, h.n)wheregreturns its argument: the count onh.nwas given back right after the call whilerstill used it. It now lasts untilr's last use (the call's result is followed like a view).k.self().drain(k.arr[0])withdrainoverridden in a subclass: the virtual call'sthis/method (GetThis/GetMethodofThisVirtualSymbolRef) wasn't traced back tok, so the drop was missed. Neither counted nor refused.f({ v: g.items[0] }): a counted read stored into the object literal's field was given back after the store. Now not counted (refused, as before 240).try(an invoke ends its block) had its count given back before that call. Now not counted (refused).Older holes
k.drain(k.at(0))on a module-levelk: each mention of a global is its own load, and the chain under a lent result had no known roots.all_ofover no roots made the owned-root shortcut say "nothing dropped". The shortcut now needs a root;argumentOwnsApartfollows lent sources (lentSources) and matches reads of the same global.p.setCb(() => p.x); return p.arr[0];): the box's copy was taken for the returned value's reference. Now refused like any other such capture.f(p, p)of a parameterpgiven to a callee that keeps both: the two moves were taken as moves on exclusive paths. Now a use after move.Tests
00tslang_issue_240_fuzzruns under gc/rc/none/own, JIT and compiled.own_err_*cases.--deepcampaign on the fixed compiler had no failures.rc:
k.arr[i] = g(k)wheregreplacesk.arr(found by the last campaign)rc released the array the left side read inside
g, then stored into it and grew it. The array is now held in a slot the scope owns, retained right after the read. The scope gives it back at its end, or on the unwind if the call throws. A release right after the store would leak the array on a throw, which is why this case had been left open. In module-level code, where no scope owns slots, the array is released after the store.this.data[i] = f(i)stores: about 20 ms, against 15 ms through a local alias.00rc_element_store_array_replaced_by_callunder gc/rc/none, including a throwing call in try/catch, plus an rc IR check.mm_fuzz.py leakson it shows no rc growth.🤖 Generated with Claude Code