PragmaTwice opened a new issue, #609:
URL: https://github.com/apache/incubator-kvrocks/issues/609

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-kvrocks/issues) and found no 
similar issues.
   
   
   ### Version
   
   `redisGenericCommand` use `raiseError` to process errors, but `raiseError` 
will perform a longjmp in the `lua_error` api call.
   
   longjmp does not compatible with RAII in C++ (C++ exceptions may use longjmp 
but the compiler will insert some dtor call carefully), so every object in the 
stack of `redisGenericCommand` will never be destroyed, i.e. no destructor will 
be call, hence all resource allocated in ctor like `std::vector`, 
`std::unique_ptr` etc. cannot be released.
   
   @git-hulk
   
   ### Minimal reproduce step
   
   `./runtest --dont-clean` on a kvrocks binary with Address Sanitizer enabled.
   You can only run tests in unit/scripting to save time.
   
   ### What did you expect to see?
   
   No memory leaks
   
   ### What did you see instead?
   
   Memory leaks are reported by Address Sanitizer
   
   ### 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]

Reply via email to