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

std::bad_alloc when returning maxNodeOffset as UINT64_MAX #1673

Closed
rfdavid opened this issue Jun 13, 2023 · 1 comment
Closed

std::bad_alloc when returning maxNodeOffset as UINT64_MAX #1673

rfdavid opened this issue Jun 13, 2023 · 1 comment
Assignees

Comments

@rfdavid
Copy link
Collaborator

rfdavid commented Jun 13, 2023

Introduction

When running a match query on an empty node/rel tables, a std::bad_alloc is caused.
As pointed out by @andyfengHKU:

> it's because the following line
static inline uint64_t getMaxNodeOffsetFromNumTuples(uint64_t numTuples) {
        return numTuples == 0 ? UINT64_MAX : numTuples - 1;
}
> when the table id empty
> we return maxNodeOffset as UINT64_MAX
> but our semi mask was interrept 64_MAX as a valid maxNodeOffset
> so it tries to generate a bitmask with size of 64_MAX which explore the memory
> that's why there is no error msg being throw out

To reproduce:

Run the following in a new database:

create node table person (ID INT64, PRIMARY KEY (ID));
create rel table knows (FROM person TO person, int64Prop INT64, MANY_MANY);
match (p0:person)-[r:knows]->(p1:person) WHERE p0.ID = 0 return p1.ID;
@andyfengHKU
Copy link
Contributor

Solved in PR #1790

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

4 participants