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
find_property method in parser.hpp - cache having duplicated entries #49
Comments
Hi, Could you please provide a proof of concept or a more detailed explanation of this issue? A debug dump with full symbols demonstrating the duplicated properties in the cache would be sufficient. krabsetw is single-threaded per trace session. We don't guarantee a unique cache across trace sessions. I'm confused as to how we might end up in a scenario where we've already added something to the cache if there's only a single thread. thanks, Zac |
This sounds like the same issue that @aydany has a pull request out for. |
Ah that’s right. I’ll link it. Could you ping them internally and see if they have bandwidth to address the PR? If not, I might be able to carve some time out to add the tests since we have a second +1 for the issue. |
After I run and tested the code, I see this fix may cause other problems (lastPropertyIndex_ is stored into member variable), the fix should be more wide... Sorry for misleading ... |
why std::deque<std::pair<const wchar_t *, property_info>> is used and not std::map? it could replace all the logic with find_property etc.. and make it much simplier? |
@issaharnoam - I believe historically, it was an optimization based on the observation that for a small N (number of items), traversing the deque would actually be faster than using a Binary/Hash map. As to the fix, I'm open to an alternative if you have one. |
Thanks! I’ll try to find some time then :). |
Fixed in #41 |
row 179, parser.hpp
needto to following fix (move caching inside if statement)
otherwise it is occasionally duplicated
...
// The property was found, return it
if (name == pName) {
property_info propInfo(pBufferIndex_, currentPropInfo, propertyLength);
cache_property(pName, propInfo);
return propInfo;
}
The text was updated successfully, but these errors were encountered: