question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite loop in XOR filter construction

See original GitHub issue

The following invocation leads to an infinite loop:

    XorPlus8.construct(new long[]{0xef9bddc5166c081cL, 0x33bf87adaa46dcfcL});

It appears that with these inputs, getHash(key, seed, index) always returns index. As a result, the two values always collide on all three of their table slots (regardless of the seed), and hence there are no single-occupied table slots and the construction algorithm never terminates. I am scratching my head at this; it seems impossible that the hash algorithm could behave in such a fashion regardless of seed. But this is the behavior I’ve observed. Any thoughts on why this might be?

Regardless of exactly what is happening here, for safety purposes, it would seem like a good idea to implement a maximum retry count for table construction (after which an exception would be thrown).

I will try to dig into this further. If I’m able to determine what is happening and implement a fix, would you be open to a pull request?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
steve-scalyrcommented, Oct 6, 2021

As a better-than-nothing fallback, what would you think of throwing an exception after some number of attempts to populate the table? Then the client could at least take some action to compensate (e.g. don’t create an XOR filter for this particular data set, and instead assume that all possible values might be present). It would also be an opportunity to provide a diagnostic message.

I can put together a pull request, if you like.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ribbon filter: practically smaller than Bloom and Xor
A Ribbon filter resembles an Xor filter modified to maximize locality and is constructed by solving a band-like linear system.
Read more >
How to break out of an infinite loop while the program is ...
The issue is that you're setting loop to exit/not, but the code is not testing loop , it's just testing True ... which...
Read more >
Xor Filters: Faster and Smaller Than Bloom Filters
Keep in mind that these filters are meant to be small. The construction of the xor filter requires several bytes of temporary memory...
Read more >
Phase Locked Loop Circuits
A PLL is a feedback system that includes a VCO, phase detector, and low pass filter within its loop. Its purpose is to...
Read more >
Infinite loop after reset all facet filters - iOS - Miscellaneous
Hi, I run into some strange problem when removing all filters. I got custom table view that works fine with InstantSearch.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found