[Gtkradiant] [Bug 290] New: Crash on Flush & Reload of Textures *AFTER* loading q3dm*sample.map

gtkradiant@zerowing.idsoftware.com gtkradiant@zerowing.idsoftware.com
Tue, 08 Jan 2002 22:17:55 -0600


http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=290

           Summary: Crash on Flush & Reload of Textures *AFTER* loading
                    q3dm*sample.map
           Product: GtkRadiant
           Version: 1.2-nightly
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P1
         Component: editor
        AssignedTo: ttimo@idsoftware.com
        ReportedBy: eviltypeguy@qeradiant.com


Crash on Flush & Reload of Textures *AFTER* loading q3dm*sample.map,
here are all the relevant details i've been able to collect, and steps to 
reproduce:

1) Open a 1.2 Trunk CVS build of GtkRadiant
2) Load q3dm1sample.map
3) Select Textures -> Flush & Reload Shaders

Get a windows error box under WIN2K that says:
"The instruction at "0x05854453" referenced memory at "0x00000004c". The memory 
could not be "read".

Which of course I know is a not very helpful error :)

So here's the messages/trace from Visual Studio:
"Unhandled exception in q3radiant.exe (MD3MODEL.DLL): 0xC0000005: Access 
Violation."

The last statement to be executed (the one it died on) is:

CMD3Surface::Draw(int)
8) plugins/md3model/md3surface.cpp:113    g_QglTable.m_pfn_qglBindTexture
(GL_TEXTURE_2D, m_pShader->getTexture()->texture_number);

m_pShader *is* defined at this time, but texture_number is NULL.

The trace of statements back from this one goes like so:
CMD3Model::Draw(int)
7) plugins/md3model/md3surface.cpp:99 ((CMD3Surface*)m_children->pdata[i])->Draw
(state);

CEntityMiscModel::Draw(int)
6) plugins/md3model/miscmodel.cpp:78 m_model->pRender->Draw(state);

CamWnd::Cam_DrawBrush(brush_s *, int)
5) radiant/camwindow.cpp:789  break;

CamWnd::Cam_DrawBrushes(int)
4) radiant/camwindow.cpp:892 for(b = pList->next; b != pList; b=b->next)

CamWnd::DrawStuff(int)
3) radiant/camwindow.cpp:979  switch(m_Camera.draw_mode)

CamWnd::CamDraw()
2) radiant/camwindow.cpp:1228  qglEnableClientState(GL_VERTEX_ARRAY)

CamWnd::OnExpose()
1)  radiant/camwindow.cpp:1469  QE_CheckOpenGLForErrors ();

I realize that not all of these steps may be helpful, but they were included 
for completeness. I thought this might be a simple IncRef/DecRef missing crash 
but I matched up the map-module tree (which doesn't appear to have this crash) 
and every single IncRef/DecRef matched up as far as location and conditions 
from what I could tell. I don't honestly know enough about how memory 
allocation/shader stuff, etc. works to really fix this. I've spent a 
considerable amount of time trying though...sorry.



------- You are receiving this mail because: -------
Whoops!  I have no idea!