mysterious execution failure and core dump generation

Posting again, as previous query had a typo.

Hi, I am running a c++ program in unix AIX machine. There are two functions in a file which are being used by a third function in the same file. the two functions being used are of the same type. one function is returning a success and the control is redeemed by the calling function. for teh second function, it is executing fine and is returning a success, but the control is not taken back by the caliing function and a core dump is getting generated. what can be the reason ?

details of functions:

calling function :
int lnClassType::updateDP(updatestruct lupdatestruct, localstruct llocalstruct)
{
retVal = validateDP(lupdatestruct,llocalstruct);
if ( FAILURE == updateAcctDP( lupdatestruct,localstruct)) {
return FAILURE;
}
}

called functions:
int limitnodeClassType::validateDP(updatestruct lupdatestruct, localstruct llocalstruct)
int limitnodeClassType::updateAcctDP(updatestruct lupdatestruct, localstruct llocalstruct)

.. this is the code flow..

function validateDP is goin thru fine. UpdateAcctDP is giving the core. Included logs to find out wer exactly the execution is stopping. Found that updateAcctDP is returning success, but the value is not being caught at the calling function and exectuin is stopping there and core is generated. plz help.

please suggest a solution for this.

When you have dumped core at the return of a function - it usually means that you have overwritten the return address on the stack frame.

Oversimplified example:

void foo( void )
{
   char p[32];
   memset(*(p-128),0x0,128);
}

All of this is OS and architecture dependent. You can clobber memory from another anywhere down the call tree, then eventually come back to the function that has the bad variable. This makes it hard to find the problem.

I would try either Electric Fence or Valgrind, if you have them.