-
Notifications
You must be signed in to change notification settings - Fork 357
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
[BUG] coredump happened in case connect_callback with exception for async mode #573
Comments
Can you try the latest redis-plus-plus? I cannot reproduce your problem with the latest code on master branch. The following is my test code:
I specified a cacert file that does not exist:
Sorry for the late reply, too busy these days... Regards |
ok, I miss a key point, I send a "cluster info" after create client to understand server state. It is a multiple thread issue... |
Sorry, but I still cannot reproduce your problem in Muti-thread env (Check the following code). Can you give me a minimum code that reproduces your problem?
Regards |
I use your code, coredump still is happened in my test env.
FBT gdb -c ./core.2313 ./redisTest (gdb) bt |
Which version of redis-plus-plus do you use? Can you test it with the latest code on master branch? Regards |
I tried use latest master branch, coredump kept. |
I retried the code on both macOS and ubuntu with the latest redis-plsu-plus and hiredis. Unfortunately, still cannot reproduce your problem. Maybe you can try to update your hiredis to the latest version to see if it's a fixed hiredis problem. Regards |
I reproduced your problem with hiredis-v1.0.0. Looks like this is a hiredis bug and has been fixed with the latest hiredis code. You can upgrade your hiredis version to the latest tag, i.e. hiredis-v1.2.0, to solve the problem. Regards |
Describe the bug
in AsyncConnection::connect_callback, there throw error during handle different state, my case is throw error during State::CONNECTING, then program fire SegV.
To Reproduce
To simple reproduce, you can use TLS, provide CA file which didn't exist, then , core dump will happen
Expected behavior
Program shouldn't crash.
Environment:
Additional context
I think it is a multiple thread issues.
AsyncConnection::connect_callback, handle exception via AsyncConnection::disconnect, then redisAsyncContext is freed.
While, it seems libuv still not aware of context invalid, and still try to access, then segV.
bt
#0 0x00007f1a8a28799e in redisAsyncHandleWrite (ac=0x7f1a8000dee0) at async.c:687
#1 0x00007f1a884f6f2b in uv__io_poll (loop=loop@entry=0x153e100, timeout=)
at src/unix/linux.c:1526
#2 0x00007f1a884e5a4b in uv_run (loop=0x153e100, mode=UV_RUN_DEFAULT) at src/unix/core.c:447
#3 0x00007f1a89e27330 in std::(anonymous namespace)::execute_native_thread_routine (__p=)
at ../../../../../libstdc++-v3/src/c++11/thread.cc:84
#4 0x00007f1a8b24bea5 in start_thread (arg=0x7f1a86a1b700) at pthread_create.c:307
#5 0x00007f1a8958ab0d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) f 0
#0 0x00007f1a8a28799e in redisAsyncHandleWrite (ac=0x7f1a8000dee0) at async.c:687
687 c->funcs->async_write(ac);
Below shown details, c->funcs had been invalid.
p *(redisAsyncContext *)ac
$3 = {c = {funcs = 0xffffffffffffffff, err = -1,...
All in all, redis-plus-plus seems is not thread safe when interact with libuv at rainy cases.
The text was updated successfully, but these errors were encountered: