ggyuchive opened a new issue, #3315: URL: https://github.com/apache/kvrocks/issues/3315
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/kvrocks/issues) and found no similar issues. ### Version kvrocks unstable `commit a320c90205bbe7a289e197470cd380a41e81f357` ### Minimal reproduce step Enter `zdiff 0 a` in redis-cli. ``` 127.0.0.1:6666> zdiff 0 a Error: Server closed the connection (4.77s) not connected> ``` ### What did you expect to see? Proper error with message like below. ``` 127.0.0.1:6666> zdiff 0 a (error) ERR value is out of range, must be positive ``` ### What did you see instead? Crash occurs instead of proper error. ``` [2025-12-29T23:45:48.919461+09:00][E][signal_util.h:34] Ooops! Apache Kvrocks unstable (commit a320c902) got signal: Segmentation fault: 11 (11) [2025-12-29T23:45:53.689682+09:00][E][signal_util.h:41] Stack trace (most recent call first): #0 0x00000001045ff923 in SegvHandler at /Users/ggyuchive/kvrocks/src/cli/signal_util.h:35 #1 0x0000000186432743 in _os_lock_handoff_lock at /usr/lib/system/libsystem_platform.dylib #2 0x00000001048a0c03 in ComposeNamespaceKey(rocksdb::Slice const&, rocksdb::Slice const&, bool) at /Users/ggyuchive/kvrocks/src/storage/redis_metadata.cc:139 #3 0x0000000104893d97 in redis::Database::AppendNamespacePrefix(rocksdb::Slice const&) at /Users/ggyuchive/kvrocks/src/storage/redis_db.cc:531 #4 0x000000010495ef1f in redis::ZSet::RangeByScore(engine::Context&, rocksdb::Slice const&, RangeScoreSpec const&, std::__1::vector<MemberScore, std::__1::allocator<MemberScore>>*, unsigned long long*) at /Users/ggyuchive/kvrocks/src/types/redis_zset.cc:306 #5 0x0000000104966dc3 in redis::ZSet::Diff(engine::Context&, std::__1::vector<rocksdb::Slice, std::__1::allocator<rocksdb::Slice>> const&, std::__1::vector<MemberScore, std::__1::allocator<MemberScore>>*) at /Users/ggyuchive/kvrocks/src/types/redis_zset.cc:903 #6 0x000000010479321b in redis::CommandZDiff::Execute(engine::Context&, Server*, redis::Connection*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*) at /Users/ggyuchive/kvrocks/src/commands/cmd_zset.cc:1497 #7 0x000000010483c073 in redis::Connection::ExecuteCommand(engine::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, redis::Commander*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*) at /Users/ggyuchive/kvrocks/src/server/redis_connection.cc:389 #8 0x000000010483a4f7 in redis::Connection::ExecuteCommands(std::__1::deque<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>, std::__1::allocator<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>>>*) at /Users/ggyuchive/kvrocks/src/server/redis_connection.cc:586 #9 0x00000001048391ab in redis::Connection::OnRead(bufferevent*) at /Users/ggyuchive/kvrocks/src/server/redis_connection.cc:115 #10 0x0000000104e3d1db in bufferevent_run_deferred_callbacks_unlocked at /Users/ggyuchive/kvrocks/build/_deps/libevent-src/bufferevent.c:208 #11 0x0000000104e4785f in event_process_active_single_queue at /Users/ggyuchive/kvrocks/build/_deps/libevent-src/event.c:0 #12 0x0000000104e44ccf in event_base_loop at /Users/ggyuchive/kvrocks/build/_deps/libevent-src/event.c:2006 #13 0x000000010486c59b in void* std::__1::__thread_proxy[abi:ne200100]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, StatusOr<std::__1::thread> util::CreateThread<WorkerThread::Start()::$_0>(char const*, WorkerThread::Start()::$_0)::'lambda'()>>(void*) at /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__thread/thread.h:214 #14 0x0000000186428c07 in _pthread_cond_wait at /usr/lib/system/libsystem_pthread.dylib #15 0x0000000186423ba7 in pthread_cond_broadcast at /usr/lib/system/libsystem_pthread.dylib [2025-12-29T23:45:53.690068+09:00][E][signal_util.h:44] It would be greatly appreciated if you could submit this crash to https://github.com/apache/kvrocks/issues along with the stacktrace above, logs and any relevant information. [1] 32609 segmentation fault ./build/kvrocks -c kvrocks.conf ``` ### Anything Else? _No response_ ### Are you willing to submit a PR? - [x] I'm willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
