Data Corruption

Jonathan I. Kamens jik at athena.mit.edu
Wed Mar 20 17:01:41 AEST 1991


In article <7187 at bgsuvax.UUCP>, pthonda at bgsuvax.UUCP (Killer B) writes:
|> Hi, I am getting data corruption.I have a pointer to an integer and I 
|> check the value it's pointing to in a loop.For some iterations the value
|> is okay, but unexpectedly there is a change in the value .Can somebody
|> help me .

  Given only the information in your posting, it is virtually impossible for
us to help you.

  The most likely explanation for your problem is, "There is a bug in your
program."  That is, at some point in your program, you do some incorrect
pointer math, or write past the end of a previously allocated block of data,
or something like that.

  You haven't told us what your program does.  You haven't told us what kind
of machine you're using, or what version of Unix it's running.  You haven't
told us what happens in your program in between the last check that indicates
the correct value and the first check that indicates the incorrect value.  You
haven't given us your source code so that we can help you figure out what's
wrong.  You can't given us a small test program that exhibits this problem.

  Is the pointer exhibiting this problem a pointer into a region of memory
allocated with malloc() or calloc()?  If so, have you considered using one of
the various malloc debugging packages available on the net for pinpointing
more accurately where in your program the malloc arena gets corrupted?

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710



More information about the Comp.unix.programmer mailing list