Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 591823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:40:31+00:00 2026-05-13T15:40:31+00:00

Using Visual Studio 2005, the debugger tells me that a deadlock has occurred just

  • 0

Using Visual Studio 2005, the debugger tells me that a deadlock has occurred just after startup of the app I’m writing – I’m well in to WinMain() at this point. The callstack shows that we are in a critical section, while calling AFX_MANAGE_STATE2 (for the 666th time, spookily enough) from within an MFC DLL. This has just started happening: the code worked fine yesterday. Weirdly, rolling back the code, rebooting the PC and rebuilding still yields the deadlock.

When everything grinds to a halt, I hit pause on the debugger and this message (eventually) appears:


Microsoft Visual Studio

The process appears to be deadlocked (or is not running any user-mode code). All threads have been stopped.

OK

The call stack looks like this:

ntdll.dll!_KiFastSystemCallRet@0()  
ntdll.dll!_ZwWaitForSingleObject@12()  + 0xc bytes  
ntdll.dll!_RtlpWaitForCriticalSection@4()  + 0x8c bytes 
ntdll.dll!_RtlEnterCriticalSection@4()  + 0x46 bytes    
mfc80ud.dll!CThreadSlotData::GetThreadValue(int nSlot=1)  Line 247  C++
mfc80ud.dll!CThreadLocalObject::GetData(CNoTrackObject * (void)* pfnCreateObject=0x7832e030)  Line 419 + 0x11 bytes C++
mfc80ud.dll!CThreadLocal<_AFX_THREAD_STATE>::GetData()  Line 177 + 0xd bytes    C++
mfc80ud.dll!AFX_MAINTAIN_STATE2::AFX_MAINTAIN_STATE2(AFX_MODULE_STATE * pNewState=0x029a80d8)  Line 57 + 0xa bytes  C++
EmpireConsole.UnityDebug.dll!WIN_CON::SPOOL::BUFFER::overflow(unsigned short c=65)  Line 979 + 0x13 bytes   C++
Empire.UnityDebug.exe!UTILITYLIB::UniCharStreamBuf::sputc(CA::UniChar ch={...})  Line 113 + 0x68 bytes  C++
Empire.UnityDebug.exe!UTILITYLIB::operator<<(UTILITYLIB::UniCharOStream & ucos={...}, const char * val=0x0888019c)  Line 868 + 0x2f bytes   C++
Empire.UnityDebug.exe!EMPIRE::ENVIRONMENT::auto_analyse()  Line 319 + 0x2b bytes    C++
Empire.UnityDebug.exe!EMPIRE::EMPIRE_APP_MODULE::run_vars(CA::UniString CmdLine={UniString [...] ...)  Line 2531    C++
Empire.UnityDebug.exe!`anonymous namespace'::winmain_inner(HINSTANCE__ * hInstance=0x08440000, HINSTANCE__ * __formal=0x00000000, wchar_t * lpCmdLine=0x00020a92)  Line 1981    C++
Empire.UnityDebug.exe!wWinMain(HINSTANCE__ * hInstance=0x08440000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020a92, int __formal=1)  Line 4808 + 0x11 bytes  C++
Empire.UnityDebug.exe!__tmainCRTStartup()  Line 589 + 0x35 bytes    C
Empire.UnityDebug.exe!wWinMainCRTStartup()  Line 414    C
kernel32.dll!_BaseProcessStart@4()  + 0x23 bytes    

The threads tab looks like this:

1008|wWinMainCRTStartup|CThreadSlotData::GetThreadValue|Normal|0

Occasionally, this also appears in the thread tab:

1596|_MixerCallbackThread@4|_KiFastSystemCallRet@0|Time Critical|0

but in general, only one thread is active.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:40:31+00:00Added an answer on May 13, 2026 at 3:40 pm

    I discovered that another member of my team had called TerminateThread rather than CloseHandle in a function a few instructions earlier. Fixing that fixed the problem. I shall look in to WINDBG though. Thread problems do crop up now that we’re living in a multi-core world.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone got EclipseLink MOXy (I'm using eclipselink 2.1.0) to work with Java 5?
I am using a 3rd-party rotator object, which is providing a smooth, random rotation
If I write a python script using only python standard libraries, using Python 2.6
I am attempting to pull some information from my tnsnames file using regex. I
I'm trying to build a C++ extension for python using swig. I've followed the
I have a script that appends some rows to a table. One of the
This is beyond both making sense and my control. That being said here is
We manage a site for a medical charity. They have a number of links
Let say I have the following desire, to simplify the IConvertible's to allow me
I know its probably possible, but is it practical and doable to try and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.