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
Recursive Stack Frames: HandleCompactMap, HandleMap, HandleFlowSequence, HandleSequence, HandleNode #657
Comments
|
This is simply running out of stack space. You can make the number of recursions go up by 11,000 or so by dynamically allocating variables instead of using stack space, but at the end of the day, you can work around this (for this test case) by doing:
Of course, a much larger (deeper) YAML file will still make it crash. You can thus, make it happen far faster by doing:
The crash does not seem to happen due to any buffer overflows or memory corruption; it's simply the kernel saying "you're out of stack space, please die". One simple way to avoid the crash itself is to do a depth-check of the tree and compare it to some value related to the stack size returned and produce an error if the values are way out of whack. A more complicated solution would involve removing recursion, which looks like it would not be a trivial fix. |
|
Similar cases occur in binutils v2.31, too. Too fix this problem, for example, binutils v2.32 add a recursion limit to libiberty's demangling code. The limit is enabled by default, but can be disabled via a new demangling option. |
|
hello, can we close this issue now that #660 is merged? and 0.6.3 |
Hi there,
An issue was discovered in singledocparser.cpp, as distributed in yaml-cpp v0.6.2. Stack Exhaustion occurs in the YAML::SingleDocParser, and there is a stack consumption problem caused by recursive stack frames: HandleCompactMap, HandleMap, HandleFlowSequence, HandleSequence, HandleNode.
Here is the POC file. Please use "./parse $POC" to reproduce the bug
POC.zip
$git log
I have confirmed them with address sanitizer too.
The text was updated successfully, but these errors were encountered: