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

Bug: Crash when VALUES("xxx");; unsupported exception may should be handled. #750

Open
jamhus-tao opened this issue Sep 23, 2024 · 0 comments

Comments

@jamhus-tao
Copy link

BusTub crashed immediately when input VALUES("xxx");.
Such as follow:

bustub> VALUES ('123');
+--------------+
| __values#0.0 |
+--------------+
| 123          |
+--------------+
bustub> VALUES ("123");
AddressSanitizer:DEADLYSIGNAL
=================================================================
==15583==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x5634f19e280d bp 0x7ffc933d1290 sp 0x7ffc933d1270 T0)

which is securely handled on BustTub Web Shell like this:

bustub> VALUES ("123");
unsupported TableReferenceType

But SELECT "xxx"; can be handled.

bustub> SELECT "123";
Message :: unsupported TableReferenceType
unsupported TableReferenceType



The following information maybe useful to locate the problem:

VALUE("xxx"); was parsed as:

PGList(VALUES("xxx"))
     \
    PGList(("xxx"))
        \
       PGNode(("xxx"))
           \
     PGColumnRef("xxx")

And for SELECT "xxx";

PGSelectStmt(SELECT "xxx")
     \
    PGList("xxx")
        \
       PGResTarget("xxx")
           \
     PGColumnRef("xxx")

They step in the same funtion src/binder/bind_select.cpp:Binder::BindColumnRef but VALUE has no binder.scope_ (nullptr).

Thus, VALUE("xxx") takes runtime error on src/binder/bind_select.cpp:501.

@jamhus-tao jamhus-tao changed the title Bug: Crash when VALUES("xxx"); Bug: Crash when VALUES("xxx");; unsupported exception may should be handled. Sep 23, 2024
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