Skip to content
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

Segfault when using timed-out unix socket handle #57

Closed
hikeonpast opened this issue Aug 1, 2011 · 2 comments
Closed

Segfault when using timed-out unix socket handle #57

hikeonpast opened this issue Aug 1, 2011 · 2 comments

Comments

@hikeonpast
Copy link

In my application, I check all of my Hiredis handles before using them if they have been dormant for awhile. This allows me to catch and restore connections that may have timed out. It's been working well thus far. It's never required in production, but it helps prevent issues for us in development and staging when things are slow.

I recently upgraded from Hiredis v.0.10.0 to v.0.10.1, and now seem to be getting segfaults when sending on my one Redis handle that uses a unix socket (presumably after its timed out on the server side). The TCP/IP-based handles seem to do fine still. It's a simple blocking ping. Call stack follows.

write ()] ../sysdeps/unix/syscall-template.S:82
redisBufferWrite (c=0x12999a0, done=0x7f6c063eb52c)] hiredis.c:1113
redisGetReply (c=0x12999a0, reply=0x7f6c063eb568)] hiredis.c:1156
__redisBlockForReply ()] hiredis.c:1257
redisvCommand (c=0x12999a0, format=, ap=)] hiredis.c:1267
redisCommand (c=0xe, format=0x129f4c8 "*1\r\n$4\r\nPING\r\n")] hiredis.c:1274

Let me know what other details would be helpful.

Cheers,

Dean

@drbobbeaty
Copy link

We've just had the same issue and found that it was an EPIPE generating a SIGPIPE and killing the process. There's a few ways to fix this, one is to change the timeout in the redis.conf file, the other is to ignore the SIGPIPE signal, as demonstrated in the test.c application, and the last - maybe the best, would be to have it handled in the hiredis code itself.

As for us, we're going to deal with it as a combination of these and I think we should be OK.

@pietern
Copy link
Contributor

pietern commented Jul 11, 2013

Can you let me know if this is still an issue?

Closing the issue in the mean time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants