开发者

Segmentation fault. 0xb7d9e768 in memmove () from /lib/libc.so.6 [closed]

开发者 https://www.devze.com 2023-03-20 07:13 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague开发者_C百科, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. Fo
It's difficult to tell what is being asked here. This question is ambiguous, vague开发者_C百科, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

GDB gives me the above error WRT my C++ program. Nowhere I have used any memory function including new and delete etc.

I want to understand the 'MEANING' of this error.


If run your program under gdb, you should be able to print out the backtrace and see what part of your code is causing the segmentation fault. memmove() may being called indirectly through a different system call.


It is possible that an array operation in your code gets optimized as a call to memmove: this is probably why the compiled code uses memmove, whereas your source code doesn't.

I think you should check that you are not accessing your arrays out of bounds.


memmove tried to access (read or write) a memory segment it shouldn't touch.

The reasons can be manifold, but probably pointer corruption. Check it with a debugger, valgrind, check stack trace, etc...

0

精彩评论

暂无评论...
验证码 换一张
取 消