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

Dragonfly crashes during JSON.SET command when experimental_flat_json is enabled #4326

Open
BagritsevichStepan opened this issue Dec 17, 2024 · 2 comments
Assignees
Labels
bug Something isn't working minor nice to have enhancement

Comments

@BagritsevichStepan
Copy link
Contributor

How to reproduce:
run in the redis-cli:

json.set j1 . '{"v":"v"}'
> ./dragonfly --alsologtostderr --experimental_flat_json=true
I20241216 15:25:10.743274 823338 init.cc:78] ./dragonfly running in opt mode.
* Logs will be written to the first available of the following paths:
/tmp/dragonfly.*
./dragonfly.*
* For the available flags type dragonfly [--help | --helpfull]
* Documentation can be found at: https://www.dragonflydb.io/docs
I20241216 15:25:10.743471 823338 dfly_main.cc:691] Starting dragonfly df-dev-0000000
I20241216 15:25:10.743598 823338 dfly_main.cc:735] maxmemory has not been specified. Deciding myself....
I20241216 15:25:10.743606 823338 dfly_main.cc:744] Found 18.52GiB available memory. Setting maxmemory to 14.81GiB
I20241216 15:25:10.747597 823339 uring_proactor.cc:178] IORing with 1024 entries, allocated 98368 bytes, cq_entries is 2048
I20241216 15:25:10.822304 823338 proactor_pool.cc:147] Running 16 io threads
I20241216 15:25:10.824172 823338 server_family.cc:826] Host OS: Linux 6.8.0-50-generic x86_64 with 16 threads
I20241216 15:25:10.824293 823338 snapshot_storage.cc:185] Load snapshot: Searching for snapshot in directory: "/home/bagrstepan/Documents/GitHub/dragonfly/build-opt"
W20241216 15:25:10.824368 823338 server_family.cc:941] Load snapshot: No snapshot found
I20241216 15:25:10.824476 823340 listener_interface.cc:101] sock[36] AcceptServer - listening on port 6379
*** SIGSEGV received at time=1734348322 on cpu 0 ***
PC: @     0x5c95fb68da0b  (unknown)  reflex::Matcher::match()
    @     0x7a9c47137d9c        224  __snprintf_chk
    @     0x7a9c4003e470        272  (unknown)
    @ ... and at least 1 more frames
Segmentation fault (core dumped)
@BagritsevichStepan BagritsevichStepan added the bug Something isn't working label Dec 17, 2024
@BagritsevichStepan BagritsevichStepan self-assigned this Dec 17, 2024
@BagritsevichStepan
Copy link
Contributor Author

The issue is in CompactObj::GetJson() where the flat JSON case is not being handled correctly.

@romange
Copy link
Collaborator

romange commented Dec 17, 2024

Note, that experimental_flat_json is not something we use in production and it's not enabled by default.

@romange romange added the minor nice to have enhancement label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working minor nice to have enhancement
Projects
None yet
Development

No branches or pull requests

2 participants