Repository navigation
fix(isc): terminate truncated maps; name malformed escape errors (WO20 fuzz #43, #44) - #45
Merged
Merged
Conversation
Two WO20 differential fuzz fixes (campaign: interscript/maps#284): - interscript-py#43 (hang): the two _stage block loops broke only on `}`, so a map truncated before the closing brace span forever in the skip-line fallback. Add the standard EOF progress invariant (the _block_items guard); the trailing _expect("}") names the failure with line:col. The new sweep test parses every truncation of two verbatim corpus maps and requires a document or a named IscParseError - never a spin, never an accidental exception. - interscript-py#44 (the campaign's largest crash class, 107 cases): malformed \u escapes leaked a raw ValueError from int(), including from metadata note text, which shares this scanner. Decoding now routes through _unicode_escape and raises IscParseError with line:col at the escape. The capital \U form stays literal-U (the ts hand-parser parity deviation; decoding both spellings is the owner-held cross-runtime alignment).
This was referenced Nov 16, 2026
Closed
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.
Summary
Fixes the two py crash classes found by the WO20 differential fuzz campaign (triage: interscript/maps#284,
scripts/fuzz/TRIAGE.md):ISC parser hangs forever on truncated maps (unterminated sub/stage block spins in _stage) #43 (hang): the two
_stageblock loops broke only on}, so a map truncated before a closing brace spun forever in the skip-line fallback (_stage<-_block_items<-parse, 100% CPU). Added the standard EOF progress invariant - the sameself._pos >= len(self._src)guard_block_itemsalready has - to the stage loop and the sequence/parallel rule loop; the trailing_expect("}")then names the failure with a line:col pointer.Malformed \u escapes raise raw ValueError instead of IscParseError (107 fuzz cases) #44 (107 cases - the campaign's largest crash class): malformed
\uescapes raised a rawValueError: invalid literal for int() with base 16: ...instead ofIscParseError- including from metadata note text, which shares the string scanner. Decoding now routes through_unicode_escape: exactly 4 hex digits (the grammar'sesc_uni4), otherwiseIscParseErrorwith line:col at the escape's backslash. The capital\Uform stays literal-U - the deviation ts documents inactions.ts(ruby's artifact parser decodes both spellings; aligning the runtimes is an owner decision, not this fix's to make).Error-path only - no accept-language changes
\uXXXXdecodes byte-identically (control test passes pre- and post-fix).\Uhandling untouched (pinned by a new test to the ts-parity literal passthrough).\u{...}/\uZZZZ/\u00Enow reject named, exactly like ruby/ts/rs.Tests
IscParseError, never a spin or an accidental exception (2,414 prefixes, sub-second).Gates
hang.isc->IscParseError: hang.isc: line 10:4: Expected '}' but got ''escape.isc->IscParseError: escape.isc: line 4:12: Invalid \u escape: expected exactly 4 hexadecimal digitsknown -> agree(all seven were pyValueError-crash cases now agreeing onIscParseError) - smoke corpus untouched.--hand-rev 7a84260holds at canonical 432/435, raw 432/435.Fixes #43
Fixes #44