当我打开由我的软件创建的核心文件时,我看到:
0x0000000800d2afc7 in g_slice_set_config () from /usr/local/lib/libglib-2.0.so.0
0x0000000800d2b21b in g_slice_set_config () from /usr/local/lib/libglib-2.0.so.0
0x0000000800d2b703 in g_slice_free1 () from /usr/local/lib/libglib-2.0.so.0
0x00000000004a027d in user_free (user=0x859945bc0) at user/user.c:178
0x00000000004a016c in user_exit () at user/user.c:349
0x000000000049e865 in dpi_exit () at dpi.c:465
0x00000000004156ae in worker_run () at itapworker.cpp:818
0x00000000004168fc in worker_main (wptr=0x8006a7124) at itapworker.cpp:957
0x0000000000416ddb in spawn_newworker (wptr=0x8006a7124) at itapworker.cpp:265
0x0000000000416ee6 in spawn_workers () at itapworker.cpp:162
0x0000000000414569 in main (argc=5, argv=0x7fffffffebc0) at itap.cpp:463
我在项目中熟悉的代码是user_free
. 内部user_free
:
static inline void
user_free(dpi_user_t *user)
{
if (user->policy)
policy_rem_ref(user->policy);
user_remove(user);
g_slice_free(dpi_user_t, user);
}
当我打印可疑指针时:
(gdb) print user
$5 = (dpi_user_t *) 0x859945bc0
(gdb) print user->policy
$6 = (rbpe_policy_t *) 0x80b1acc20
因为核心发生在一个自由函数中,所以我想到的只有空指针访问。但是当我检查指针时,它们根本不为空。各位大佬知道可能是什么原因吗?