CuckooTable insertLoop stack overflow #47

Open
opened 2025-07-08 08:35:54 -04:00 by AtHeartEngineer · 0 comments

Originally created by @karulont on 3/19/2025

We have a recursive algorithm for cuckoo table insert.
We do limit the recursion with maxEvictionCount value in the config. However, it turns out that there was an oversight. After recursively calling "expand" we reset the eviction count. This means that instead of doing only maxEvictionCount recursive calls, we are doing maxEvictionCount * number_of_expansions recursive calls.

We need to rewrite the insertLoop algorithm so that we have a proper upper bound on the recursion.

Acknowledgement goes to @fpseverino who brought this to our attention in #174

*Originally created by @karulont on 3/19/2025* We have a recursive algorithm for cuckoo table insert. We do limit the recursion with `maxEvictionCount` value in the config. However, it turns out that there was an oversight. After recursively calling "expand" we reset the eviction count. This means that instead of doing only `maxEvictionCount` recursive calls, we are doing `maxEvictionCount * number_of_expansions` recursive calls. We need to rewrite the `insertLoop` algorithm so that we have a proper upper bound on the recursion. Acknowledgement goes to @fpseverino who brought this to our attention in #174
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/swift-homomorphic-encryption#47