Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Operating System - Tru64 Unix
Showing results for 
Search instead for 
Did you mean: 

Problem with memcpy


Problem with memcpy


I am facing a very strange problem with memcpy function in our C code under our build environment.

Just to give a brief history, our build system got crashed a while ago (2 months) and now we setup a new build system with same software installed of aprox. of same version as prior to crash.

Now when we build the image, image build is successfull with no errors but image is behaving abnormally. When I tried to run the debug image it is running successfully. Then I tried to put Trace-logs within the code to find where the image is failing and i figured out: memcpy is copying 1 less character from source to destination.

Could you please help me at what should i try to look at to fix this problem.

We are running Tru64 UNIX 5.1 OS and making use of GNU make to build the image. Major code is written in C.

Please let me know if any further information is requried.

Steven Schweda
Honored Contributor

Re: Problem with memcpy

> Please let me know if any further
> information is requried.

How about a failing test program? My psychic
powers are too weak to tell me what's wrong
with your code if I can't see the code, how
you built it, or how you ran it. One guess:

"man memcpy":

The memcpy() function copies n bytes from the string pointed to by the s2
parameter into the location pointed to by the s1 parameter. When copying
overlapping strings, the behavior of this function is unreliable.

Does "unreliable" sound like what you're

> We are running Tru64 UNIX 5.1 OS [...]

Actual output from, say, "sizer -v" would be
more trustworthy than anything you say.

> [...] GNU make [...]

That's probably the _least_ important thing
about how the program was compiled or linked.

Re: Problem with memcpy

Thanks a lot for your time and efforts.

Problem got resolved after i upgrade my C compiler to the latest version.