CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 21

Thread: debugging doubt

  1. #1
    Join Date
    Aug 2005
    Posts
    8

    debugging doubt

    when i was debugging my application statement by statement, suddenly it went to 'run' state and in the debug window i see "the thread <hex no> has exited with code 0". it happend couple of times.....

    can anybody say why does this happens?

    Thanx in advance,

  2. #2
    Join Date
    Aug 2003
    Posts
    79

    Re: debugging doubt

    Create a simplified app with some previous code and see if it happen again. If it is yes, you can post the simplified app and let guru help you to figure out the problem.
    There is one absolute truth that there is no such thing as absolute truth.

  3. #3
    Join Date
    Feb 2002
    Posts
    4,640

    Re: debugging doubt

    I'm just guessing, but are you using multiple threads? As you step, the debugger will let other threads in your application run. Perhaps one (or more) of them have finished running. IIRC, the debugger only debugs one thread at a time. I could be mistaken, though (it's been a while since I debugged multiple threads at once).

    Viggy

  4. #4
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: debugging doubt

    Its as simple as the message, the thread of ID (shown by hex value) exited with return code(shown), this is one the thread which was started by your application under debugger.
    Regards,
    Ramkrishna Pawar

  5. #5
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Re: debugging doubt

    This Means Some Error is There in your Code. it's near to crash. it can be or can't be. So better Check you Files once again and try to Find What's wrong you had done in your code.and this is not simple like a message.
    Thanx

  6. #6
    Join Date
    Jan 2002
    Location
    Houston, TX
    Posts
    1,421

    Re: debugging doubt

    Quote Originally Posted by humptydumpty
    This Means Some Error is There in your Code. it's near to crash. it can be or can't be. So better Check you Files once again and try to Find What's wrong you had done in your code.and this is not simple like a message.
    Thanx
    Just because a thread ends with exit code 0 (as the OP states) does not indicate any error in your code.

    When a thread ends, an exit code is posted - usually a 0 exit code means the thread ended without error. A non-zero code i normally used to indicate some error or other condition from the thread.

    As for why your program just starts running when you press the single-step, it would be nearly impossible to tell without seeing the code or a sample (simple) application that reproduces the result.

    It could also be a thread that your code didn't start explicitly, but perhaps something else did. For example, our antivirus software hooks into just about everything, and I frequently see messages about its threads ending.

    Hope that helps.
    Be sure to rate those who help!
    -------------------------------------------------------------
    Karl - WK5M
    PP-ASEL-IA (N43CS)
    PGP Key: 0xDB02E193
    PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

  7. #7
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: debugging doubt

    Quote Originally Posted by humptydumpty
    This Means Some Error is There in your Code. it's near to crash. it can be or can't be. So better Check you Files once again and try to Find What's wrong you had done in your code.and this is not simple like a message.
    Thanx
    I dont think this is any good idea.
    Last edited by Krishnaa; August 23rd, 2006 at 09:35 AM.
    Regards,
    Ramkrishna Pawar

  8. #8
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Re: debugging doubt

    Yes i know. Krishna it's depend some time dues to this i got Mislaneous bugs in my Program.sometime it's also related with Memory leek Also.
    Now, let's see Garbage Collection in action in a simple MFC Dialog Box application. Run your program in Debug mode and start debugging. If I am using garbage collection, here is the output from the output window:
    Code:
    	Loaded 'C:.DLL', no matching symbolic information found.
    	Loaded 'C:.DLL', no matching symbolic information found.
    	The thread 0x744 has exited with code 0 (0x0).
    	The program 'D:.exe' has exited with code 0 (0x0).
    There is no memory leak. Now, if I am neither doing garbage collection, nor I am manually deleting the object, here is the output:
    Code:
    	Loaded 'C:.DLL', no matching symbolic information found.
    	Loaded 'C:.DLL', no matching symbolic information found.
    	Detected memory leaks!
    	Dumping objects ->
    	{65} normal block at 0x002F2C80, 16 bytes long.
    	Data: < ,/ > 00 00 00 00 80 2C 2F 00 CD CD CD CD CD CD CD CD 
    	Object dump complete.
    	The thread 0x50C has exited with code 0 (0x0).
    	The program 'D:.exe' has exited with code 0 (0x0).
    You can see the memory dumps. There is memory leak of 16 bytes.

    Thanx
    Last edited by humptydumpty; August 23rd, 2006 at 07:48 AM.

  9. #9
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: debugging doubt

    Quote Originally Posted by humptydumpty
    This Means Some Error is There in your Code. it's near to crash. it can be or can't be. So better Check you Files once again and try to Find What's wrong you had done in your code.and this is not simple like a message.
    Is that a joke?
    Ha, ha!
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  10. #10
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: debugging doubt

    Quote Originally Posted by humptydumpty
    Yes i know. Krishna it's depend some time dues to this i got Mislaneous bugs in my Program.sometime it's also related with Memory leek Also.
    Now, let's see Garbage Collection in action in a simple MFC Dialog Box application. Run your program in Debug mode and start debugging. If I am using garbage collection, here is the output from the output window:
    Code:
    	Loaded 'C:.DLL', no matching symbolic information found.
    	Loaded 'C:.DLL', no matching symbolic information found.
    	The thread 0x744 has exited with code 0 (0x0).
    	The program 'D:.exe' has exited with code 0 (0x0).
    There is no memory leak. Now, if I am neither doing garbage collection, nor I am manually deleting the object, here is the output:
    Code:
    	Loaded 'C:.DLL', no matching symbolic information found.
    	Loaded 'C:.DLL', no matching symbolic information found.
    	Detected memory leaks!
    	Dumping objects ->
    	{65} normal block at 0x002F2C80, 16 bytes long.
    	Data: < ,/ > 00 00 00 00 80 2C 2F 00 CD CD CD CD CD CD CD CD 
    	Object dump complete.
    	The thread 0x50C has exited with code 0 (0x0).
    	The program 'D:.exe' has exited with code 0 (0x0).
    You can see the memory dumps. There is memory leak of 16 bytes.

    Thanx
    What does this have to do with the topic?

  11. #11
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: debugging doubt

    Quote Originally Posted by humptydumpty
    Yes i know. Krishna it's depend some time dues to this i got Mislaneous bugs in my Program.sometime it's also related with Memory leek Also.
    Now, let's see Garbage Collection in action in a simple MFC Dialog Box application. Run your program in Debug mode and start debugging. If I am using garbage collection, here is the output from the output window:
    Code:
    	Loaded 'C:.DLL', no matching symbolic information found.
    	Loaded 'C:.DLL', no matching symbolic information found.
    	The thread 0x744 has exited with code 0 (0x0).
    	The program 'D:.exe' has exited with code 0 (0x0).
    There is no memory leak. Now, if I am neither doing garbage collection, nor I am manually deleting the object, here is the output:
    Code:
    	Loaded 'C:.DLL', no matching symbolic information found.
    	Loaded 'C:.DLL', no matching symbolic information found.
    	Detected memory leaks!
    	Dumping objects ->
    	{65} normal block at 0x002F2C80, 16 bytes long.
    	Data: < ,/ > 00 00 00 00 80 2C 2F 00 CD CD CD CD CD CD CD CD 
    	Object dump complete.
    	The thread 0x50C has exited with code 0 (0x0).
    	The program 'D:.exe' has exited with code 0 (0x0).
    You can see the memory dumps. There is memory leak of 16 bytes.

    Thanx
    Are you trying to say, if VC++ output windows shows "The thread 0x*** has exited with code *." then it might be related to memory leaks ? thats not true, it never is. That message is only meant to tell debugging user that thread exited, thats it, nothing more.
    Regards,
    Ramkrishna Pawar

  12. #12
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Re: debugging doubt

    Quote Originally Posted by ovidiucucu
    Is that a joke?
    Ha, ha!
    Yes Ovi it can be a Memory leak Fine
    here is a Link Just go witht his.
    may be you Will Found Someuseful infor here. And One More thing i am pretty Sure it can be

    http://www.codeproject.com/cpp/autom...c_using_sp.asp
    Thanx

  13. #13
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: debugging doubt

    Quote Originally Posted by humptydumpty
    Yes Ovi it can be a Memory leak Fine
    here is a Link Just go witht his.
    may be you Will Found Someuseful infor here. And One More thing i am pretty Sure it can be

    http://www.codeproject.com/cpp/autom...c_using_sp.asp
    Thanx
    Now if this is not a joke, then this is a serious problem with your reasoning, I mean no offence but I think you are talking meaningless.
    Regards,
    Ramkrishna Pawar

  14. #14
    Join Date
    Aug 2005
    Posts
    8

    Re: debugging doubt

    even in assignment statement it happens and when i stop and debug again it doesn't happens in the same statement....
    at random places the thread exits and goes to run mode....
    our application is single threaded.

  15. #15
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Re: debugging doubt

    Did u Checked The Link
    and this too
    http://www.codeguru.com/forum/archiv.../t-271183.html

    Last edited by humptydumpty; August 24th, 2006 at 01:18 AM.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured