mysterious execution failure and core dump generation


 
Thread Tools Search this Thread
Top Forums Programming mysterious execution failure and core dump generation
# 1  
Old 06-08-2009
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.
# 2  
Old 06-08-2009
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:
Code:
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Core File Generation

Hi I am using Linux and I am using Java as well as C++ services running on it. The ulimit -c is set to around 400Mb. Whenever any of the service fails they produce a core file.(Actual size of core could be greater than 400Mb). Whenever my Java service fails I get a core file of size 400Mb... (3 Replies)
Discussion started by: Raj999
3 Replies

2. HP-UX

Core dump in HP-UX

Hi Guys, I was wondering if somebody could give me a link to a very good source of information or document about core dump process and How to's about it. I have also googled it and found some articles myself. Thanks Messi (1 Reply)
Discussion started by: messi777
1 Replies

3. AIX

core dump generation in IBM machine

Hi, im getting a core dump file in a AIX machine while using a complex c++ program. The same program is working without any core error in another system with sun OS 5.9. The program has used structs, LL's and lots of call by references. What may be the reason. will it be a problem with the OS ? (3 Replies)
Discussion started by: suresh_kb211
3 Replies

4. Programming

execution failure and core dump generation

Hi, I am running a c++ program in unix sun OS 5.9. 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... (5 Replies)
Discussion started by: suresh_kb211
5 Replies

5. Programming

execution failure and core dump generation

Hi, I am running a c++ program in unix sun OS 5.9. 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... (2 Replies)
Discussion started by: suresh_kb211
2 Replies

6. Solaris

Core dump generation in sun OS

Hi, im getting a core dump file in my sun OS version 5.9 while using a complex c++ program. The same program is working without any core error in another system with same sun OS and same version. The program has used structs, LL's and lots of call by references. What may be the reason. will it be a... (3 Replies)
Discussion started by: suresh_kb211
3 Replies

7. AIX

core dump

My application gives core dump. When i am debugging with dbx getting instructions below: pthdb_session.c, 818: 695445 PTHDB_INTERNAL (internal error) pthreaded.c, 1941: PTHDB_INTERNAL (internal error) Illegal instruction (illegal opcode) in . at 0x0 warning: Unable to access address 0x0... (1 Reply)
Discussion started by: bapi
1 Replies

8. UNIX for Dummies Questions & Answers

Core dump in HP-UX..

Hi All I am new for this forum. I have a core file by using gdb and bt cmd I got the function name but I want to the exact cause of the core dump because of I can not reproduse the binary so if any one know the cmd plz plz plz let me know. (0 Replies)
Discussion started by: gyanusoni
0 Replies

9. UNIX for Dummies Questions & Answers

core dump

I've got a core dump in my weblogic home directory, which i have tried to debug by initiating savecore from /etc/init.d/savecore start but savecore failed to create the two files, that is vmcore.n and vmunix.n. savecore is enable on my server to save vmcore and vmunix in /var/crash/hostname 1)... (4 Replies)
Discussion started by: hassan2
4 Replies

10. UNIX for Dummies Questions & Answers

help, what is the difference between core dump and panic dump?

help, what is the difference between core dump and panic dump? (1 Reply)
Discussion started by: aileen
1 Replies
Login or Register to Ask a Question