Repository navigation
Bound the text the fuzz comparison builds for a value - #512
Open
dimensionscape wants to merge 1 commit into
Open
dimensionscape wants to merge 1 commit into
dimensionscape wants to merge 1 commit into
Conversation
The scheduled fuzz run of 2026-11-30 stopped in the serializer target with libFuzzer's out-of-memory error, 4185 MB against its 4096 MB limit. Loading the 3,881 cached inputs had already taken it from 115 MB to 3472 MB at 9 inputs a second. ASan counted 88 MB live, and the large stacks were all canon() concatenating strings. The input it stopped on, "Moy0:r0gr0h...", is an ObjectMap whose key, an object, and value both hold the map. canon() stops after 100,000 steps, but in such a map the text also grows about 1.6 times a level, and each level copies the texts below it. That input built 20 million characters of text before it ran out of steps; with a 3,000 character string beside the key's reference, 720 million, which took 850 MB and 8 seconds under ASan, and mutants of it up to 1.3 GB and 23 seconds. None of them was compared in the end, since each ran out of steps. canon() now also gives up after 4,194,304 characters, counting each level's text as it is built, so it allocates at most a few times that for a value. Without references or runs of nulls, 4096 bytes of input build under a third of it. A value past it is not compared, as one past the step limit already was; 99,000 nulls 32 levels down, which builds 16 million characters, was compared before and is not now. Tests: the input is in test/fuzz/regressions/serializer. With clang 18, ASan and UBSan in WSL, every target replays its seeds and regressions, and the inputs above take 167 to 189 MB and under 0.3 seconds each. Loading 3,392 serializer inputs that local runs gathered took main 620 seconds and 1.4 GB before a 20-second timeout, and this change 158 seconds and 750 MB. From there a 30-minute run of 78,263 inputs stayed at 760 MB throughout.
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.
The scheduled fuzz run of 2026-11-30 (run 46464537090) stopped in the serializer target with
libFuzzer: out-of-memory (used: 4185Mb; limit: 4096Mb). Loading the 3,881 cached inputs had already taken RSS from 115 MB to 3472 MB at 9 inputs a second. ASan counted 88 MB live, and the large stacks were allcanon()intest/fuzz/Fuzz.hxconcatenating strings. The input it stopped on,Moy0:r0gr0h..., is an ObjectMap whose key, an object, and value both hold the map.canon()stops after 100,000 steps, but in such a map the text also grows about 1.6 times a level, and each level copies the texts below it. That input built 20 million characters before it ran out of steps. With a 3,000 character string beside the key's reference it built 720 million, which took 850 MB and 8 s under ASan, and mutants of it reached 1.3 GB and 23 s. None of them was compared in the end, since each ran out of steps.canon()now also gives up after 4,194,304 characters, counting each level's text as it is built, so it allocates at most a few times that for a value. Without references or runs of nulls, 4096 bytes of input build under a third of it. A value past it is not compared, like one past the step limit; 99,000 nulls 32 levels down (16 million characters) was compared before and is not now. Values that fit compare as before.The CI input goes in
test/fuzz/regressions/serializer.Checked with clang 18, ASan and UBSan in WSL:
Every target replays its seeds and regressions. Test-only, so no Changes.md line.