1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

Thread hangs after wglMakeCurrent(NULL, NULL); or some other OpenGlcommands

Discussion in 'Nvidia' started by Equilibrium, Aug 4, 2009.

  1. Equilibrium

    Equilibrium Guest

    Hi All,

    Using 9600 GT driver 6.14.11.8120
    WinXP

    During running our application the Thread that is responsible for
    drawing get "Freezed"
    Code of rendering

    Code:
    if(m_pGLContext)
    {
    BOOL bRes = m_pGLContext->MakeCurrent();
    if(bRes)
    {
    const BSTAT eRet = m_pGLContext->Render(); // Some OpenGL calls
    CDC* pDC = GetDC();
    m_pGLContext->Swap();
    ReleaseDC(pDC);
    } else
    {
    m_pGLContext->ReleaseCurrent();
    return;
    }
    
    m_pGLContext->ReleaseCurrent();
    }
    

    where MakeCurrent() and ReleaseCurrent () stands for:

    Code:
    
    BOOL COGLContext::MakeCurrent()
    {
    #ifdef _DEBUG
    const DWORD dwThread = GetCurrentThreadId();
    UI_ASSERT_AND_LOG(m_cOwner.IsCurrent(), "Sharing a context between
    threads is a bad idea!");
    #endif
    const HGLRC hGLRC = wglGetCurrentContext();
    if(hGLRC != m_hGLContext)
    {
    const BOOL bRet = wglMakeCurrent(m_hDC, m_hGLContext);
    if(!bRet)
    {
    const DWORD dwError = GetLastError();
    return FALSE;
    }
    }
    
    return TRUE;
    }
    
    void COGLContext::ReleaseCurrent()
    {
    wglMakeCurrent(NULL, NULL);
    }
    
    
    after a while , most of the times in Release build the Drawing thread
    is freezed.
    Last code statement is wglMakeCurrent(NULL, NULL);

    It seems that the thread is stuck in the Video adapter dll......

    here is the call stack

    Code:
    
    nvoglnt.dll!6977f56a()
    nvoglnt.dll!6977fae7()
    nvoglnt.dll!697812fd()
    gdi32.dll!77f1c55e()
    gdi32.dll!77f1c55e()
    ntdll.dll!7c912c06()
    ntdll.dll!7c910098()
    ntdll.dll!7c910021()
    ntdll.dll!7c91003d()
    kernel32.dll!7c812c2a()
    kernel32.dll!7c812c3d()
    nvoglnt.dll!69765661()
    nvoglnt.dll!6956ddcb()
    nvoglnt.dll!6975b956()
    gdi32.dll!77f1b271()
    gdi32.dll!77f1b297()
    ntdll.dll!7c91003d()
    nvoglnt.dll!6957c415()
    gdi32.dll!77f1b821()
    gdi32.dll!77f1b7da()
    gdi32.dll!77f16e1d()
    gdi32.dll!77f16f0a()
    gdi32.dll!77f16e71()
    nvoglnt.dll!698e792c()
    gdi32.dll!77f1c573()
    gdi32.dll!77f1c553()
    gdi32.dll!77f1c55e()
    nvoglnt.dll!698e5d5a()
    nvoglnt.dll!69780bd8()
    nvoglnt.dll!6978142f()
    nvoglnt.dll!6977e7b5()
    nvoglnt.dll!6977ed49()
    nvoglnt.dll!6977f464()
    nvoglnt.dll!6977fae7()
    nvoglnt.dll!697812fd()
    nvoglnt.dll!6978130f()
    nvoglnt.dll!69781316()
    gdi32.dll!77f1b271()
    nvoglnt.dll!6973eee3()
    nvoglnt.dll!69763005()
    nvoglnt.dll!69765ab6()
    nvoglnt.dll!69743f92()
    nvoglnt.dll!6973b81c()
    nvoglnt.dll!69743f9c()
    nvoglnt.dll!6979f5f2()
    nvoglnt.dll!69794ddc()
    nvoglnt.dll!695916b9()
    nvoglnt.dll!6957c13d()
    nvoglnt.dll!695917dd()
    nvoglnt.dll!6959196d()
    nvoglnt.dll!695757f1()
    nvoglnt.dll!6975f84c()
    nvoglnt.dll!6975f942()
    nvoglnt.dll!6975fa34()
    nvoglnt.dll!695c8c9a()
    opengl32.dll!5ed19bef()
    user32.dll!7e4184ba()
    user32.dll!7e4186be()
    UIFramework.dll!COGLContext::ReleaseCurrent()  Line 1268	C++[QUOTE]
    UIFramework.dll!CBVRView::_Render(const int bFromUIThread=0)  Line 194 + 0xb	C++[/QUOTE]
    Views.dll!CBaseTacticalView::_Render(const int bFromUIThread=0)
    Line 2475 + 0xd	C++
    UIFramework.dll!CBVRView::Render(const int bFromUIThread=0)  Line
    157	C++
    UIFramework.dll!CViewsManager::UpdateViews()  Line 394 + 0x9	C++
    UIFramework.dll!CDisplayUpdater::_Update(const int
    iCounter=15660641)  Line 54	C++
    UIFramework.dll!CQuotaDisplayUpdaterThread::Update()  Line 54	C++
    UIFramework.dll!CQuotaUpdaterThread::Run()  Line 106	C++
    MFC71.DLL!7c1b1a13()
    MSVCR71.DLL!7c36b381()
    gdi32.dll!77f176ab()
    MSVCR71.DLL!7c3638e2()
    kernel32.dll!7c80b713()
    gdi32.dll!77f176ab()
    
    

    Please assist.

    Regard
    Eq.
     
    Equilibrium, Aug 4, 2009
    #1
    1. Advertisements

  2. Equilibrium

    deimos Guest

    Not too many systems programmers 'round these parts. Can't remember a
    time when there was either... </oldcoot>

    You'll stand a better chance with NV developer relations or MSDN honestly.
     
    deimos, Aug 5, 2009
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.