-
-
Notifications
You must be signed in to change notification settings - Fork 75
-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Extremely slow demangling of malformed symbol using excessive memory #477
Comments
Indeed, this is not an issue upstream. I suspect because upstream has some tighter limits around recursion (both parsing as well as pretty printing). We had to increase those limits to support more complex (but still valid) mangled symbols. As you say that it blows up memory usage, I suspect its rather a matter of either adding a potentially huge amount of substitutions, or blowing past some limit when pretty printing. |
Interesting. The problem does not seem to be the pretty printing, but rather some part of the parsing. Even when I reset the recursion depth back to the default of So this does need some more investigation. While #481 does not fix this particular issue, IMO it is still worth merging and bounding the length of demangled symbols. |
Looking at this again after a while and running this in a profiler… In general, I recently added an LRU cache for the demangling that we do in symbolicator: getsentry/symbolicator#1124 |
cpp_demangle 0.4.1 has been released and contains a fix for this. |
Test case:
This is probably a cpp_demangle issue, but I can't reproduce this there. At least, that's where the stack trace led.
When fuzzing, this hits a memory limit and then stops. When running normally, it does complete successfully, but uses a few gigabytes of RAM on the way, and I assume it can be easily crafted to OOM any normal system, though I haven't tried it.
The text was updated successfully, but these errors were encountered: