Hi,

I just compiled r2042 and something has broken, as I got a crash when 
trying to call addUniformVariable() on a SimpleSHLVariableChunk. This 
has worked before (r1874).

I can't really find anything wrong with my code (which worked before), 
but you never know. Here it goes:

OSGDicomVolume::OSGDicomVolume() :
     m_shader_mode(SM_FLUORO_SIM),
     m_16bit_size_threshold(450e6),
     m_material(ChunkMaterial::create()),
     m_parameters(OSG::SimpleSHLVariableChunk::create())
{
     m_parameters->addUniformVariable("volume", 0);  <---  crash

m_parameters is a SimpleSHLVariableChunkRefPtr.

Here's how the callstack looks:

OSGSystemD.dll!OSG::ShaderProgramVariables::addUniformVariable(const 
char * name=0x5019718c, int value=0, 
OSG::MField<int,0,std::allocator<int> > * pVarLoc=0x047c34fc, 
OSG::MField<int,0,std::allocator<int> > * pProcVarLoc=0x00000000)  Line 
361 + 0x13 bytes        C++

OrzDicomD.dll!OSG::SimpleSHLVariableChunk::addUniformVariable<int>(const 
char * name=0x5019718c, const int & value=0)  Line 95   C++

OrzDicomD.dll!orz::OSGDicomVolume::OSGDicomVolume()  Line 29    C++

The culprit for the crash is the _sfVariables member in 
SimpleSHLVariableChunk which is 0xcdcdcdcd, i.e. newly allocated memory 
that hasn't been written to yet. 
(http://www.nobugs.org/developer/win32/debug_crt_heap.html)

Looking closer in the debugger, almost all of the object pointed to by 
the m_parameters has the same pattern.

Any ideas?

Cheers,
/Marcus


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to