-
Notifications
You must be signed in to change notification settings - Fork 11
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
Potential Memory Leak in string_configuration_get Due to Ownership Mismatch #177
Comments
Hi Zack! make distclean
make -j4 SANITIZER=address
./src/valkey-server --loadmodule ../valkey-bloom/target/release/libvalkey_bloom.so here's the exact error I got when compiling like this and calling the
|
Thanks for giving the commands you used! Trying that returned the memory leak you showed I will now take a look at fixing it. |
We found the source of the leak in the SDK's config interface and Cameron is working on the fix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There seems to be a mismatch in ownership semantics between
valkeymodule-rs
and the Valkey C API when handling string config getters, which may be causing a memory leak.Problem:
string_configuration_get
returns a*mut RedisModuleString
using.take()
, which appears to transfer ownership.getModuleStringConfig
calls this getter and duplicates the string (sdsdup(val->ptr)
), assuming the original remains valid.Reproduction Steps:
valkey-bloom
).CONFIG GET bf.bloom-fp-rate
(or another registered config).Additional Context:
I'm not a Rust expert, but based on my understanding,
.take()
combined withConfigurationContext::new()
might be the cause.valkeymodule-rs/src/configuration.rs
Line 306 in 6497ac4
The text was updated successfully, but these errors were encountered: