CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009
    Posts
    6

    Identifying threads in VS .NET 2003

    Hi all,

    I'm converting a Linux program to a Windows program using Visual Studio .NET 2003. The code was written using pthread.

    I have a "First-chance exception at 0x100084c8 in project.exe: 0xC0000005: Access violation reading location 0x000001dc" error that is causing my program to crash, and all but one thread "has exited with code 0 (0x0)." The one thread (0xfe4) exited with code -1073741819 (0xc0000005). I read that if threads exited with code 0, then everything is fine. I'm guessing the one thread that did not caused the error, especially the same code 0xC0000005 showed up.

    As there are groups of threads doing different tasks, I wish to track down the thread that did not exit correctly, so as to debug the program. Is there a way to identify which thread it is, like using the (0xfe4) value?

    Thank you.

    Regards,
    Rayne

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    Re: Identifying threads in VS .NET 2003

    Open Debug - Exceptions window, expand Win32 Exceptions, and check "Access violation". Run the program under debugger, and it breaks on first-time exception when it is thrown.
    Regarding "post-mortem" thread detection, I don't think it is possible in native C++. You can print to TRACE thread ID and thread name in the beginning of every thread, if this is necessary. But some threads are started outside of your code, so this is not 100% solution.

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