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

CPP Femtozip Infinite Loop in IntSet.h #8

Open
canselcik opened this issue Aug 13, 2014 · 0 comments
Open

CPP Femtozip Infinite Loop in IntSet.h #8

canselcik opened this issue Aug 13, 2014 · 0 comments

Comments

@canselcik
Copy link

When provided with a large quantity of files/data, femtozip gets into an infinite loop. This issue can be tracked down to the insert(int, int*, int*, size_t) method in IntSet.h.

inline int insert(int n, int *b, int *end, size_t capacity) {
    int *p = b + (n % capacity);
    while (*p != -1) {
        if (*p == n) {
            return 0;
        }
        p++;
        if (p == end) {
            p = b;
        }
    }  
    *p = n;
    return 1;
}

The loop while (*p != -1) never completes as p is never equal to -1 or n.

chrido pushed a commit to chrido/femtozip that referenced this issue Dec 1, 2016
Unit tests are failing, also in older versions
Sometimes tests get stuck in an endless loop, could be related to gtoubassi#8 ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant