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

SIGSEGV when quering a TAG indexed field using a NUMERIC field syntax #3983

Closed
finalgamer opened this issue Oct 24, 2024 · 0 comments · Fixed by #4043
Closed

SIGSEGV when quering a TAG indexed field using a NUMERIC field syntax #3983

finalgamer opened this issue Oct 24, 2024 · 0 comments · Fixed by #4043
Assignees
Labels
bug Something isn't working Next Up task that is ready to be worked on and should be added to working queue

Comments

@finalgamer
Copy link

Describe the bug

When quering a tag indexed field in the wrong way the FT.SEARCH command returns this error ERR Wrong access type for field: id. However when using FT.PROFILE this crashes the entire instance.

This is the log output of my docker instance

dragonfly-1  | *** SIGSEGV received at time=1729770213 on cpu 12 ***
dragonfly-1  | PC: @     0x55b98c1ea10b  (unknown)  dfly::SearchFamily::FtProfile()
dragonfly-1 exited with code 139

To Reproduce
Start dragonfly with docker docker.dragonflydb.io/dragonflydb/dragonfly
Connect to dragonfly
Run FT.CREATE idx ON JSON SCHEMA $.id AS id TAG to create an index
Run FT.PROFILE idx SEARCH QUERY "@id:[1 1]" this causes the crash

Expected behavior

Same as the FT.SEARCH command this should return the ERR Wrong access type for field: id error.

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • Kernel: Linux 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • Containerized: Docker
  • Dragonfly Version: v1.24.0

Reproducible Code Snippet

FT.CREATE idx ON JSON SCHEMA $.id AS id TAG
FT.PROFILE idx SEARCH QUERY "@id:[1 1]"
@finalgamer finalgamer added the bug Something isn't working label Oct 24, 2024
@adiholden adiholden added the Next Up task that is ready to be worked on and should be added to working queue label Oct 29, 2024
BagritsevichStepan added a commit to BagritsevichStepan/dragonfly that referenced this issue Nov 3, 2024
fixes dragonflydb#3983

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
BagritsevichStepan added a commit to BagritsevichStepan/dragonfly that referenced this issue Nov 3, 2024
fixes dragonflydb#3983

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
BagritsevichStepan added a commit to BagritsevichStepan/dragonfly that referenced this issue Nov 4, 2024
fixes dragonflydb#3983

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
BagritsevichStepan added a commit that referenced this issue Nov 4, 2024
…es (#4043)

* refactor(search_family): Remove unnecessary std::move in FT.SEARCH

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>

* fix(search_family): Fix crash in FT.PROFILE command for invalid queries

fixes #3983

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>

* refactor(search_family_test): address comments

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>

---------

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Next Up task that is ready to be worked on and should be added to working queue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants