c++ - core dump, <Address 0x5bf6 out of bounds> -
getting core dump on rare scenario. code have been using last 10 years , not faced core till , no new code added this. suspecting because of addresses out of bounds , not sure resolve core. asking one's suggestion on this. in advance.
gdb) fr 8 #8 0x082905e0 in parse(_htstream*, char const*, int) (me=0x83684f8, data=0x8368710 "", data_len=2896) @ wmhttpstream.cpp:1497 1497 wmhttpstream.cpp: no such file or directory. in wmhttpstream.cpp current language: auto; c++ (gdb) info locals state = (parser_state *) 0x8368500 guid = {guid = "0&²u\216fÏ\021¦Ù\0ª\0bÎl", size = 2013} data_cur = 0x83689bc "\202" remaining = 2212 block_len = -135896812 type = -1 read_len = 684 parse_done = 1 block_buf = (data_buf_t *) 0x1 __pretty_function__ = "void parse(htstream*, const char*, int)" (gdb) fr 7 #7 0x0828d1c0 in process_file_data(_htstream*, int, _buf_t*) (me=0x83684f8, type=0, block=0x833d4e0) @ wmhttpstream.cpp:1062 1062 in wmhttpstream.cpp (gdb) info locals iov = {{iov_base = 0x8357de0, iov_len = 1250}, {iov_base = 0xffe87344, iov_len = 4293424288}, {iov_base = 0xffffffff, iov_len = 0}, { iov_base = 0xffffffff, iov_len = 4151443444}, {iov_base = 0xffe874a0, iov_len = 4293423940}, {iov_base = 0xffe873f0, iov_len = 4150651851}, { iov_base = 0xffe87344, iov_len = 4159359433}, {iov_base = 0xffe87420, iov_len = 4293424288}, {iov_base = 0x0, iov_len = 4222451713}, { iov_base = 0xffe874a0, iov_len = 4293424288}, {iov_base = 0xffe874a0, iov_len = 4293424288}, {iov_base = 0xffe874a3, iov_len = 4294967295}, { iov_base = 0xffe874a0, iov_len = 4294967295}, {iov_base = 0x0, iov_len = 0}, {iov_base = 0x0, iov_len = 4150704481}, {iov_base = 0x0, iov_len = 4150704481}, {iov_base = 0x0, iov_len = 742}, {iov_base = 0x0, iov_len = 4150704481}, {iov_base = 0xf44942f0, iov_len = 4150704481}, {iov_base = 0x2, iov_len = 4150704481}, {iov_base = 0x0, iov_len = 746}, {iov_base = 0x3fd18, iov_len = 4150704481}, { iov_base = 0xf7eae414, iov_len = 4150704481}, {iov_base = 0xffe873d8, iov_len = 4150704481}, {iov_base = 0x835efe0, iov_len = 4293424288}, { iov_base = 0x2, iov_len = 22284}, {iov_base = 0x836850c, iov_len = 137132324}, {iov_base = 0xffe87418, iov_len = 136869189}, { iov_base = 0x8358016, iov_len = 137791248}, {iov_base = 0x2ac, iov_len = 136921305}, {iov_base = 0x82c7924, iov_len = 324}, { iov_base = 0x2630, iov_len = 136868550}} n = 1 stime = 0 ptime = 3303 ds_type = 0 rc = 0 client = (wmhttpclient *) 0x8332688 state = (parser_state *) 0x8368500 stream = (stream_info *) 0x83326b8 asf_head = 0x1 <address 0x1 out of bounds> len = 137790720 (gdb) here sample code snippet:
void process_file_data(htstream *me, int type, data_buf_t *block) { wmhttpclient *client = me->client; parser_state *state = &me->state; stream_info *stream = &client->_stream_info; char *asf_head; int len = 0; switch (type) { case block_head: { len = state->block_len; asf_head = (char *)malloc(len); if (asf_head == null) { ad_debug_error("malloc(%d)", len); client->eventloopstop(stop_for_error); break; } copy_from_buf(asf_head, block, len);
is block allocated sufficient buffer size? if not, please so, check such pointers, whether pointing allocated space before accessing
Comments
Post a Comment