-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
i hava got a problem in function "sdsMakeRoomFor" #110
Comments
hi, Program terminated with signal 11, Segmentation fault.
#0 0x00007f71b5d43693 in malloc_consolidate.part.3 () from /lib64/libc.so.6
#0 0x00007f71b5d43693 in malloc_consolidate.part.3 () from /lib64/libc.so.6
#1 0x00007f71b5d44b28 in _int_malloc () from /lib64/libc.so.6
#2 0x00007f71b5d463aa in _int_realloc () from /lib64/libc.so.6
#3 0x00007f71b5d47d46 in realloc () from /lib64/libc.so.6
#4 0x00007f71bad0dc2a in sdsMakeRoomFor (s=, t=0x7f71943225a0, len=405) at sds.c:97
#5 sdscatlen (s=, t=0x7f71943225a0, len=405) at sds.c:131
#6 0x00007f71bad0b1d0 in __redisAppendCommand (c=0x7f71940038c0, cmd=, len=) at hiredis.c:1186
#7 0x00007f71bad0bef7 in redisvAppendCommand (c=0x7f71940038c0, format=, ap=) at hiredis.c:1206
#8 0x00007f71bad0bfd8 in redisAppendCommand (c=, format=) at hiredis.c:1220 |
Both of these traces look like they are caused by something in the allocator; tcmalloc in the top one, and the libc allocator in the bottom one. It is more likely that you have bad memory rather than this being a bug in the allocator code. You can check the memory on your machine with memcheck, or with the built-in memory checker in Redis. Execute it with: |
But I got 3 crashes in last 2 days on 3 different machines. It was working regards On Tue, Jun 11, 2013 at 9:18 PM, Pieter Noordhuis
|
You should run that command on the machines where the crash happened, not on the server. It doesn't look like hiredis itself is the problem here; the crash is caused by the allocator. |
thanks,i have solved it 2013/6/12 Pieter Noordhuis [email protected]
|
How did you solve it in the end? What was the cause for these crashes? |
I ran into basically the same issue(apart from the fact that glibc is used instead of tcmalloc), which turned out to be a normal heap corruption bug. If the segfault happened randomly at any place using malloc, don't blame hiredis.(Although hiredis uses realloc a lot, which makes it more likely to trigger the problem) |
@monRedis |
Hi monRedis and Denny007, |
For those who have the same issue, I have fixed my problem. The answer is that the cause is my own memory bug not related to hiredis lib. Perhaps hiredis use many dynamic allocations, the program is prone to crash inside it. |
when i use hiredis,i get a problem in function sdsMakeRoomFor.this problem does't accre frequently,only sometimes. follow is this coredump partly,why this is cause? can you tell me how to fix it?
#0 0x007c2854 in SLL_Next(void*) () from /usr/local/lib/libtcmalloc.so.0
#1 0x007c28ad in SLL_Pop(void**) () from /usr/local/lib/libtcmalloc.so.0
#2 0x007c70a5 in TCMalloc_ThreadCache_FreeList::Pop() ()
from /usr/local/lib/libtcmalloc.so.0
#3 0x007c8344 in TCMalloc_ThreadCache::Allocate(unsigned int) ()
from /usr/local/lib/libtcmalloc.so.0
#4 0x007c682b in do_malloc(unsigned int) ()
from /usr/local/lib/libtcmalloc.so.0
#5 0x007e60ed in realloc () from /usr/local/lib/libtcmalloc.so.0
#6 0x001371f5 in sdsMakeRoomFor (s=0x0, t=0x8744564, len=6) at sds.c:97
#7 sdscatlen (s=0x0, t=0x8744564, len=6) at sds.c:131
#8 0x00134f72 in redisvFormatCommand (target=0xb7504d9c,
#9 0x001353bf in redisvAppendCommand (c=0x8755dc0,
#10 0x00136fe0 in redisvCommand (c=0x8755dc0,
#11 0x0013704e in redisCommand (c=0x8755dc0, format=0x805a07e "HSET %s %s %s")
#12 0x08054704 in CRedisImplCommond::ImplCommondHashSet (this=0x874daf4,
The text was updated successfully, but these errors were encountered: