You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the redisConnectUnix() function to connect to redis via a Unix domain socket, if redis-server exits and you try to issue a command using the context returned from redisConnectUnix() you get a SIGPIPE which is resulting in a segfault, crashing the entire application that uses hiredis.
Here's a backtrace from a simple program that makes a connection to hiredis, sleeps for 5 seconds during which I kill redis in another terminal, then continues to try to issue a DEL command.
(gdb) run
sleeping
done sleeping
Program received signal SIGPIPE, Broken pipe.
0xffffe424 in __kernel_vsyscall ()
(gdb) bt
#0 0xffffe424 in __kernel_vsyscall () #1 0xb7682a23 in write () from /lib/libc.so.6 #2 0xb7707ea6 in redisBufferWrite () from /usr/lib/libhiredis.so.0.10 #3 0xb7709a1f in redisGetReply () from /usr/lib/libhiredis.so.0.10 #4 0xb7709b0f in redisvCommand () from /usr/lib/libhiredis.so.0.10 #5 0xb7709b4b in redisCommand () from /usr/lib/libhiredis.so.0.10 #6 0x0804863e in main (argc=2, argv=0xbfab6a54) at t.c:25
The text was updated successfully, but these errors were encountered:
When using the redisConnectUnix() function to connect to redis via a Unix domain socket, if redis-server exits and you try to issue a command using the context returned from redisConnectUnix() you get a SIGPIPE which is resulting in a segfault, crashing the entire application that uses hiredis.
Here's a backtrace from a simple program that makes a connection to hiredis, sleeps for 5 seconds during which I kill redis in another terminal, then continues to try to issue a DEL command.
(gdb) run
sleeping
done sleeping
Program received signal SIGPIPE, Broken pipe.
0xffffe424 in __kernel_vsyscall ()
(gdb) bt
#0 0xffffe424 in __kernel_vsyscall ()
#1 0xb7682a23 in write () from /lib/libc.so.6
#2 0xb7707ea6 in redisBufferWrite () from /usr/lib/libhiredis.so.0.10
#3 0xb7709a1f in redisGetReply () from /usr/lib/libhiredis.so.0.10
#4 0xb7709b0f in redisvCommand () from /usr/lib/libhiredis.so.0.10
#5 0xb7709b4b in redisCommand () from /usr/lib/libhiredis.so.0.10
#6 0x0804863e in main (argc=2, argv=0xbfab6a54) at t.c:25
The text was updated successfully, but these errors were encountered: