Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack Overflow during TextFormat generation #1182

Closed
thomasvl opened this issue Sep 17, 2021 · 2 comments
Closed

Stack Overflow during TextFormat generation #1182

thomasvl opened this issue Sep 17, 2021 · 2 comments
Labels
kind/bug Feature doesn't work as expected.

Comments

@thomasvl
Copy link
Collaborator

oss-fuzz found a test case that is properly parsed, but fails to re-serialized it back out to TextFormat, but only in the debug version of the fuzz test. The input is:

79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{49{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{49{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}49{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}49{79{79{79{79{79{79{79{79{79{79{79{79{79{79{79{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}#49{79{79{7}{7

Which basically boils down to just deep nesting of the recursive message, close to the recursion limit.

This sorta appears to be like #1034.

Since the TextFormat output is used for the debugDescription not being able to dump a deep message that were were able to parse will likely be a little confusing to developers that run into this.

@thomasvl thomasvl added the kind/bug Feature doesn't work as expected. label Sep 17, 2021
@thomasvl
Copy link
Collaborator Author

I tried a manual edit to the generated fuzz_testing.pb.swift version of traverse to wrap each if let ... block with a try { if let ... }() closure, like we did for the other issue. That does seem to reduce the stack usage in debug build so the a rerun of the data on FuzzTextFormat passes.

@thomasvl
Copy link
Collaborator Author

Fixed via #1183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Feature doesn't work as expected.
Projects
None yet
Development

No branches or pull requests

1 participant