apache / kvrocks

Apache Kvrocks is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol.
https://kvrocks.apache.org/
Apache License 2.0
3.55k stars 466 forks source link

Memory leak reports in tcl test cases #702

Closed git-hulk closed 2 years ago

git-hulk commented 2 years ago

Search before asking

Version

unstable

Minimal reproduce step

$ ./build.sh build -DENABLE_ASAN=ON
$ cd tests/tcl
$ ./runtest --dont-clean

What did you expect to see?

No memory leak reported

What did you see instead?

https://github.com/apache/incubator-kvrocks/runs/7133747333?check_suite_focus=true

=================================================================
==30270==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 1023 byte(s) in 1 object(s) allocated from:
    #0 0x7f0b2c2e5b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x55ef1f258c72 in strbuf_init (/home/runner/work/incubator-kvrocks/incubator-kvrocks/tests/tcl/redis-server+0xa1ec72)

Anything Else?

I noticed only the cjson library is using strbuf_init.

Are you willing to submit a PR?

tisonkun commented 2 years ago

@git-hulk is it an issue on unstable branch or #697 only? We shouldn't create issue for further problem. It seems we may fix this issue at KvrocksLabs/luajit aspect?

In another word, I don't see what we can do before #697 merged and on unstable branch.

git-hulk commented 2 years ago

@git-hulk is it an issue on unstable branch or #697 only? We shouldn't create issue for further problem. It seems we may fix this issue at KvrocksLabs/luajit aspect?

In another word, I don't see what we can do before #697 merged and on unstable branch.

My bad. I think the Lua library is using cjson, so it should have the same problem as well. Will close this issue since it looks introduced by #697 and have an eye on this case.