开发者

What is the memmove_overlay command in AIX?

开发者 https://www.devze.com 2023-02-22 10:40 出处:网络
I\'m debugging a dynamic memory allocation problem in some C code in AIX 6.1 and in my stack trace I get the command memmove_overlay before the crash.

I'm debugging a dynamic memory allocation problem in some C code in AIX 6.1 and in my stack trace I get the command memmove_overlay before the crash.

Before the program crashed I had called the memcpy f开发者_运维问答unction.

What is this command doing ?


memcpy copies a memory area from *src to *dest. It might crash your program if the memory areas overlap. Try memmove instead.


Verify the parameters to your memmove() call. The internal-sounding memmove_overlay() function is part of the implementation of memmove(), so it's doing the same thing as memmove() is doing, probably.

You could of course set up a dummy test case using a known safe set of parameters, like so:

char test1[2], test2[2] = { 47, 11 };

memmove(test2, test1, sizeof test2);

And then use your debugger to step into memmove() to see how it ends up in memmove_overlay().

But, chances are that the crash just is because of bad input to memmove(), and thus has nothing to do with the fact that the memmove_overlay() function is running.

0

精彩评论

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