Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memory Corruption in C

Status
Not open for further replies.

sanketgajane

Programmer
May 10, 2009
1
US
Hi
I am seeing an unusual memory corruption.
The following is the type of program I am using. The function shown below is part of large code, and not all details of it are given.
The value 'val' which is passed to func1() gets corrupted after the call to func3(), hence it cannot be used in the function further.
Also if I add a print between func2() and func3() I don't see the memory corruption. It looked like stack corruption or memory overwrite error. I have already verify the stack and it was not of much help.
Can anyone point anything related to the root cause?

void func1(ubyte val)
{
ubyte var1;
ubyte var2;

func2(val);
func3(val);

......
......


}


Thanks
Sanket.
 
You haven't really given much to go on. Can you post the code for [tt]func3()[/tt] at least?


 
I'd be willing to bet it's a stack corruption problem.
Need to see more code to track it down though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top