我有一段新内存分配完成的代码片段。并且它在此片段中的转储总线错误。
void NewNode ( MyStruct *pi_Object )
{
pi_Object = new MyStruct ( );
}
这个程序是多线程的。堆栈显示以下内容。
ffffffff7ccdb3d8 _lwp_kill (6, 0, 1007902f8, ffffffffffffffff, ffffffff7ce3e000, 0) + 8
ffffffff7cc4b780 abort (1, 1d8, 1003598e0, 1f298c, 0, 0) + 118
00000001000e0ffc _Z12catchsigcorei (a, 0, ffffffff759fab60, ffffffff7ce4eba0, 0, 0) + 404
ffffffff7ccd7498 __sighndlr (a, 0, ffffffff759fab60, 1000e0bf8, 0, 9) + c
ffffffff7cccb02c call_user_handler (ffffffff7e90f200, ffffffff7e90f200, ffffffff759fab60, 0, 0, 0) + 3e0
ffffffff7cccb238 sigacthandler (0, 0, ffffffff759fab60, ffffffff7e90f200, 0, ffffffff7ce3e000) + 68
--- called from signal handler with signal 0 (SIGEXIT) ---
ffffffff7cc636f4 t_splay (106756fd0, 0, 0, 0, 0, 106756ff0) + 44
ffffffff7cc63524 t_delete (106756fd0, 11fc33170, 1dab30, 0, ffffffff7ce3e000, 0) + 60
ffffffff7cc62b30 _malloc_unlocked (9d0, 0, 106756fd0, 0, 0, 0) + 1a8
ffffffff7cc62968 malloc (9c8, 23b8, 1db6e8, 0, ffffffff7ce3e000, 2000) + 5c
ffffffff7d5ce8bc _Znwm (9c8, 0, ffffffff7ce4a240, 9c8, ffffffff7e90f200, 0) + 18
000000010015aaa0 _Z7NewNodev (1, 3, 0, ffffffff6a5188d0, 107a57f58, ffffffff6a518828) + c
我在malloc期间搜索了SO的BUS错误原因,到目前为止我已经阅读了这些概率
我正在搞清楚这一点。代码中没有野生指针用法,也没有双删除/免费。我已经读过OS /内核现在管理内存对齐过程。是否有其他可能导致此错误?
非常感谢您的任何想法。