Operating System - Tru64 Unix
1748052 Members
5221 Online
108758 Solutions
New Discussion юеВ

Re: Problem with memcpy

 
Not applicable

Problem with memcpy

Hi,

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.

Regards,
ajaydec
2 REPLIES 2
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
seeing?

> 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.
Not applicable

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.

Regards,
ajaydec