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

Tor Trac #18642: Teach the OOM handler about the DNS cache #223

Closed
wants to merge 3 commits into from

Conversation

Labels
None yet
Projects
None yet
2 participants
@neelchauhan
Copy link
Contributor

@neelchauhan neelchauhan commented Jul 11, 2018

For the bug here.


/* Update amount of bytes removed and array size. */
bytes_removed += current_size - dns_cache_total_allocation();
current_size -= bytes_removed;
Copy link
Contributor

@dgoulet-tor dgoulet-tor Jul 16, 2018

I think there is a problem here. Since bytes_removed increment every loop, is it possible you'll get offset as you go like this (considering initial state to be bytes_removed = 0 and current_size = 100 and every loop, let say we remove 1 entry of size 10:

bytes_removed - current_size
0 - 100
10 - 90
20 - 70
30 - 40
40 - 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment