Comments (7)
I released 0.4.2 with this fixed.
from cpp_demangle.
This pathological symbol triggers the default recursion limits in cpp_demangle. The error handling paths are slow (I haven't investigated that) and lead to the 0.5 second runtime you see. If you bump the recursion limits (I haven't attempted to find minimal values here) like so, it will parse correctly in less than a tenth of that time.
if let Ok(sym) = cpp_demangle::BorrowedSymbol::new_with_options(name.as_bytes(), &ParseOptions::default().recursion_limit(256)) {
let mut demangled = String::new();
let options = cpp_demangle::DemangleOptions::default()
.recursion_limit(256);
if let Ok(()) = sym.structured_demangle(&mut demangled, &options) {
dbg!(demangled);
}
}
from cpp_demangle.
Thanks for the swift response!
Oh wow, yeah, I can confirm that this speeds things up quite significantly. The error path being slow certainly wasn't on my list of possible reasons here -- I figured it would just bubble up an error and that's it. Interesting.
I actually have to raise the limit to 512 in order to not run into this for all symbols in this executable (also not minimized, but 256 is not enough so I just doubled).
from cpp_demangle.
Thanks a lot for the swift fix -- works great here! The pathological executable where it used to take more than an hour to demangle all the symbols now parses in 3 seconds.
from cpp_demangle.
Was that with the recursion limit at the default?
from cpp_demangle.
Yes.
from cpp_demangle.
Great!
from cpp_demangle.
Related Issues (20)
- Support transaction clone symbols HOT 1
- fuzzing crash HOT 3
- afl_crash_32 isn't a valid fuzzer input
- Objective-C symbols cannot be demangled HOT 1
- UnexpectedText when demangling symbol HOT 1
- Signal safe demangling HOT 6
- Add support for `enable_if` Attribute HOT 3
- Broken link in Readme HOT 1
- Demangle _ZN4glslL7combineIhLi2EEEDvmlT0_Li4E_T_DvT0__S1_S3_S3_S3_ HOT 5
- Remove `impl Display for Symbol` HOT 1
- Demangle failure with dragonbox symbol HOT 4
- Symbol::demangle fails to display parameters of some symbols HOT 5
- Panics demangling some symbols from a Linux build of Firefox HOT 6
- Cannot demangle a handful of symbols from a Linux build of Firefox HOT 2
- 0.3.6 breaks addr2line HOT 1
- Add ability to bound `SubstitutionTable` HOT 7
- Documentation for structured demangling HOT 3
- Failure to demangle symbol handled by other demanglers HOT 4
- Is Travis CI still being used? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpp_demangle.