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

Segfault in getArrowSchema #2152

Closed
Riolku opened this issue Oct 5, 2023 · 0 comments · Fixed by #2156
Closed

Segfault in getArrowSchema #2152

Riolku opened this issue Oct 5, 2023 · 0 comments · Fixed by #2156
Assignees
Labels
bug Something isn't working

Comments

@Riolku
Copy link
Contributor

Riolku commented Oct 5, 2023

#include "kuzu.h"

int main() {
    kuzu_system_config conf;
    kuzu_database* db = kuzu_database_init("test", conf);
    kuzu_connection* conn = kuzu_connection_init(db);
    kuzu_query_result* result = kuzu_connection_query(conn, "LOAD FROM 'test.csv' RETURN *;");
    kuzu_query_result_get_arrow_schema(result);
}

This segfaults, because:

            for (auto j = 0u; i < numProperties; j++) {
                auto name = NodeVal::getPropertyName(value, j);
                auto val = NodeVal::getPropertyVal(value, j);
                columnTypeInfo->childrenTypesInfo.push_back(
                    DataTypeInfo::getInfoForDataType(*val->getDataType(), name));
            }

This loop, in query_result.cpp, is infinite, as diagnosed by clang-tidy. Specifically, we have a typo, we are using i instead of j.

@Riolku Riolku self-assigned this Oct 5, 2023
Riolku added a commit that referenced this issue Oct 5, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 5, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 5, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 6, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 6, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 6, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 6, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 6, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 7, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 10, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 10, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 10, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 10, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
@ray6080 ray6080 added the bug Something isn't working label Oct 10, 2023
@ray6080 ray6080 mentioned this issue Oct 10, 2023
10 tasks
Riolku added a commit that referenced this issue Oct 10, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 10, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 10, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 10, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Riolku added a commit that referenced this issue Oct 10, 2023
clang-tidy is a static analyzer, and can find many different issues.
So far I have integrated a few simple checks, and disabled the remaining
ones. They will be enabled in future PRs.

Closes #2152. Ref #2148.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants