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

kuzu_shell.exe throws an exception Expression: back() called on empty string #3183

Closed
neeraj9 opened this issue Apr 1, 2024 · 0 comments · Fixed by #3184
Closed

kuzu_shell.exe throws an exception Expression: back() called on empty string #3183

neeraj9 opened this issue Apr 1, 2024 · 0 comments · Fixed by #3184
Assignees
Labels
bug Something isn't working

Comments

@neeraj9
Copy link
Contributor

neeraj9 commented Apr 1, 2024

Version: 6f0d8f8
Branch: master
Code: https://github.com/kuzudb/kuzu/tree/6f0d8f80bb9f2ebf830814802e9c20dedbdafe7b
Platform: Windows 11, 23H2 (OS Build 22631.3296)
Compiler: Visual Studio 2022, Enterprise x64, version 17.9.4

Error output:

[4/1/2024 9:27:07 PM] Debugging new process...[OK] Process ID: 46396
...
Debug Assertion Failed!

Program: G:\bin\kuzu_shell.exe
File: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\include\xstring
Line: 4129

Expression: back() called on empty string

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
  • filename;"history.txt" (0x46ECEFF020);const char*;
  • result._Mypair._Myval2._Bx._Buf;"";char [16];
int linenoiseHistoryLoad(const char* filename) {
    // ...
    std::string result;
    while (fgets(buf, LINENOISE_MAX_LINE, fp) != NULL) {
        // else we are parsing a Cypher statement
       // ....
        result += buf;
        if (result.back() == ';') {       // ERROR!!
            //...
        }
}

My history.txt is as follows:

quit ;
:help
MATCH (a:Url) RETURN a.url;
show_tables ;
:help
SHOW TABLES ;
CALL show_tables() RETURN *;
:help
MATCH (s) RETURN *;
CALL current_setting('threads') return *;
CALL db_version() RETURN *;
CALL show_tables() RETURN *;

@ray6080 ray6080 added the bug Something isn't working label Apr 1, 2024
neeraj9 added a commit to neeraj9/kuzu that referenced this issue Apr 1, 2024
Skip empty lines in history file within kuzu_shell.

This change closes kuzudb#3183
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.

3 participants