核心转储,<地址0x5bf6越界>
core dump, <Address 0x5bf6 out of bounds>
在非常罕见的情况下获取核心转储。这个代码从过去10年一直在使用,直到现在还没有面对这个核心,也没有添加新的代码。怀疑这是因为地址越界,并且不确定是否解析此核心。询问某人对此的建议。提前谢谢。
gdb) fr 8
#8 0x082905e0 in parse(_HTStream*, char const*, int) (me=0x83684f8, data=0x8368710 "", data_len=2896) at WMHttpStream.cpp:1497
1497 WMHttpStream.cpp: No such file or directory.
in WMHttpStream.cpp
Current language: auto; currently c++
(gdb) info locals
state = (parser_state *) 0x8368500
guid = {guid = "0&²u216fÏ 21¦Ù ª bÎ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) at 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)
以下是示例代码片段:
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);
是否为块分配了足够的缓冲区大小?如果没有,请检查所有这样的指针,在访问之前是否指向已分配的空间
相关文章:
- 缓冲区溢出 - 数组索引越界(严重)
- C++:成员的越界声明必须是纯虚函数的定义错误
- 越界成员函数定义是否需要一个完全限定的类名,直到全局范围
- mlpack :在 FFN 中索引越界<>
- 越界访问 CUDA 共享内存
- 访问矢量元素时索引越界异常
- C++不给出越界错误.有没有办法强制编译器检查而不是未定义的行为?
- 未检测到越界指针算法?
- 分段错误:为什么这里的数组索引越界了
- 在 C++ 中更改越界指针的取消引用是否安全?
- 为什么简单的C++向量函数会产生越界的下标
- 特征:优化入口周围的越界矩阵块/切片
- 这不应该发出越界警告吗?
- 是什么导致了数组越界运行时错误?
- 自定义迭代器越界
- 矢量不是被保护不越界吗?
- 越界操作数组,似乎无法理解含义
- c++检查变量以寻址越界
- 数组越界或错误等于 nullptr?C++
- 核心转储,<地址0x5bf6越界>