|
-
July 25th, 2008, 09:55 AM
#1
Program crash on exit?
hai
i have an application running on AIX 5.2 in C++
when iam trying to execute the application, everything is going fine, but on exit its getting core dumped, and the stack trace is as shown below
Illegal instruction (illegal opcode) in . at 0x0 ($t1)
warning: Unable to access address 0x0 from core
(dbx) where
warning: Unable to access address 0xfffffffffffffffc from core
warning: Unable to access address 0xfffffffffffffffc from core
warning: Unable to access address 0xfffffffffffffffc from core
warning: Unable to access address 0xfffffffffffffffc from core
.() at 0x0
strstrea.__dt__Q2_3std6localeFv(??, ??) at 0xd0642894
__dt__Q2_3std13basic_filebufXTcTQ2_3std11char_traitsXTc__Fv(??, ??, ??) at 0xd0672828
abc_agent.vtbl.~CD_TraceFilebuf()(0xf0931c28, 0x2, 0x0), line 16 in "abc_agent.vtbl.cc"
abc_agent.vtbl.~CD_Trace()(0xf0931c18, 0x2, 0xf0734cb0), line 16 in "abc_agent.vtbl.cc"
abc_program.__srterm__0()(), line 36 in "abc_program.cc"
cuexit.on_exit(??) at 0xd02198b4
plz help me what exactly is the problem?
Regards
Vadan
-
July 25th, 2008, 10:00 AM
#2
Re: Program crash on exit?
Without seeing the code, my guess would be that a class is being called AFTER being deleted. Another common cause of this is global buffers that are being used in a destructor after they have been deleted.
Check the order of your cleanup on exit.
-Erik
-
July 25th, 2008, 10:48 AM
#3
Re: Program crash on exit?
Is this program multithreaded? Another problem could be threads not being shut down correctly. Shared objects could have been destructed while child threads are still running. That's essentially the same kind of problem that egawtry is talking about (dangling pointer or reference). There are a number of reasons you might be having this problem. You could add some debug statements to destructors or set a breakpoint in the code where program begins to shut down and figure out what is going on. Good luck. Post some code and some more specific questions if you get stuck while debugging.
-
July 26th, 2008, 12:46 AM
#4
Re: Program crash on exit?
You can post your code here and let us investigate with you together.
-
July 26th, 2008, 04:33 AM
#5
Re: Program crash on exit?
Another possible reason could be 2 globals or statics dependent on each other interfereing with their destruction while the program shutdown. It goes down to the problem egawtry. What if you run the program in debug mode and let it exit and see what cause the issue? Or put in some intelligent logging in the functions mentioned in the trace output.
Can you help me with my homework assignment?, Before you post!, Use code tags, How to post!, Codeguru technical FAQs, C++ FAQ Lite, Stroustrup: C++ Style and Technique FAQ, Guru of the Week, Comeau C and C++ FAQs, Comeau C++ Templates FAQs, CUJ @ DDJ, Spam threshold
My Blogs : Learning C++ is fun | Abnegator's reflections
Open Threads : C++ Aha! Moments | Nature of work in C++?
-
July 27th, 2008, 11:29 PM
#6
Re: Program crash on exit?
 Originally Posted by exterminator
Another possible reason could be 2 globals or statics dependent on each other interfereing with their destruction while the program shutdown. It goes down to the problem egawtry. What if you run the program in debug mode and let it exit and see what cause the issue? Or put in some intelligent logging in the functions mentioned in the trace output.
"externinator", are you addressing me (egawtry) or vadan?
Anyway, that is a good suggestion. Put lots of TRACE statements in the code. Also put breakpoints at the start and end of the destructors to see which ones make it through.
-Erik
-
July 28th, 2008, 02:52 AM
#7
Re: Program crash on exit?
 Originally Posted by egawtry
"externinator", are you addressing me (egawtry) or vadan?
Anyway, that is a good suggestion. Put lots of TRACE statements in the code. Also put breakpoints at the start and end of the destructors to see which ones make it through.
-Erik
Sorry about that, Erik. My hand lost its sync with my mind. That is an incomplete sentence. Complete one would be: "It goes down to the problem egawtry already mentioned".
Can you help me with my homework assignment?, Before you post!, Use code tags, How to post!, Codeguru technical FAQs, C++ FAQ Lite, Stroustrup: C++ Style and Technique FAQ, Guru of the Week, Comeau C and C++ FAQs, Comeau C++ Templates FAQs, CUJ @ DDJ, Spam threshold
My Blogs : Learning C++ is fun | Abnegator's reflections
Open Threads : C++ Aha! Moments | Nature of work in C++?
-
July 28th, 2008, 08:43 AM
#8
Re: Program crash on exit?
what does the statement cuexit.on_exit(??) at 0xd02198b4 idnicate?
-
July 28th, 2008, 11:21 AM
#9
Re: Program crash on exit?
 Originally Posted by vadan
what does the statement cuexit.on_exit(??) at 0xd02198b4 idnicate?
I don't know what framework you are using, but what does "cu" mean to you? I would guess that it is some sort of cleanup routine for the "cuexit" class. Find that and see what it is doing.
-Erik
-
July 28th, 2008, 01:30 PM
#10
Re: Program crash on exit?
looks like CRT library. on_exit is called by the CRT library when your application
exits. Does any of your code call ::atexit and register a routine?
Are you using singletons or global objects which may call each other inside destructor calls. You can have the static destruction fiasco, similar to the static initialization fiasco.
Wakeup in the morning and kick the day in the teeth!! Or something like that.
"i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|