-
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
redisvFormatCommand crash #339
Comments
Can you show the code? |
memset (redis_cmd, 0x00, sizeof(redis_cmd));
sprintf(redis_cmd, "RPUSH %s %s %s %s %s %s %s",
session->ue_info.imsi,
session->ue_info.ue_ver,
session->ue_info.msisdn,
session->ue_info.lte_ip,
session->ue_info.cp_ip,
session->ue_info.svc_pkg,
session->ue_info.ue_model);
LOG(LOG_INF, "REDIS CMD = %s\n", redis_cmd);
if ( redis == NULL )
{
redis = redis_connect(R_MASTER);
if ( redis == NULL )
add_to_list(redis_cmd);
else
{
reply = redisCommand(redis, redis_cmd);
if ( reply == NULL )
add_to_list(redis_cmd);
else
freeReplyObject(reply);
}
}
else
{
reply = redisCommand(redis, redis_cmd);
if ( reply == NULL )
add_to_list(redis_cmd);
else
freeReplyObject(reply);
}
memset (redis_cmd, 0x00, sizeof(redis_cmd));
sprintf(redis_cmd, "SET %s_LTE 0", session->ue_info.imsi);
LOG(LOG_INF, "REDIS CMD = %s\n", redis_cmd);
if ( redis == NULL )
{
redis = redis_connect(R_MASTER);
if ( redis == NULL )
add_to_list(redis_cmd);
else
{
reply = redisCommand(redis, redis_cmd);
if ( reply == NULL )
add_to_list(redis_cmd);
else
freeReplyObject(reply);
}
}
else
{
reply = redisCommand(redis, redis_cmd); <<-- Crash
if ( reply == NULL )
add_to_list(redis_cmd);
else
freeReplyObject(reply);
} |
Which version of hiredis did you use? |
hiredis version is "### 0.12.1 - January 26, 2015" |
I can't reproduce it currently. It looks like some kind of memory corruption, as Is this reproducable on your side? Did you have any other memory-related issues so far? |
It has occured rarely so I can't reproduce it. |
How large is your |
the size of redis_cmd is 256 (char redis_cmd[256];) |
Please report back if this occurs again, currently I can't see another problem, but maybe there is. |
REDIS version : 3.0.0
#0 0x00007fa7256b45d7 in raise () from /lib64/libc.so.6
No symbol table info available.
#1 0x00007fa7256b5cc8 in abort () from /lib64/libc.so.6
No symbol table info available.
#2 0x00007fa7256f4e07 in __libc_message () from /lib64/libc.so.6
No symbol table info available.
#3 0x00007fa7256fac67 in malloc_printerr () from /lib64/libc.so.6
No symbol table info available.
#4 0x00007fa7256feb17 in _int_realloc () from /lib64/libc.so.6
No symbol table info available.
#5 0x00007fa7256ff702 in realloc () from /lib64/libc.so.6
No symbol table info available.
#6 0x000000000043121d in sdsMakeRoomFor (s=0x1777b <Address 0x1777b out of bounds>, addlen=97194) at sds.c:142
#7 0x000000000043138a in sdscatlen (s=s@entry=0x7fa5c0000c48 "", t=t@entry=0x7fa5cb0fb5d0, len=len@entry=1) at sds.c:241
#8 0x000000000042f3e4 in redisvFormatCommand (target=target@entry=0x7fa5cb0fb000, format=, ap=0x7fa5cb0fb048)
#9 0x0000000000430de2 in redisvAppendCommand (c=0x7fa5c00008c0, format=, ap=) at hiredis.c:891
---Type to continue, or q to quit---
#10 0x0000000000430f8d in redisvCommand (c=0x7fa5c00008c0, format=, ap=ap@entry=0x7fa5cb0fb048) at hiredis.c:961
No locals.
#11 0x0000000000431057 in redisCommand (c=, format=) at hiredis.c:970
#12 0x000000000040f3c2 in msg_hdlr (arg=0x0) at msg_thrd.c:2095
#13 0x00007fa725e2edf5 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#14 0x00007fa7257751ad in clone () from /lib64/libc.so.6
No symbol table info available.
The text was updated successfully, but these errors were encountered: