Gerrit Voß wrote: > Hi, > > On Tue, 2009-08-18 at 20:59 +0200, Marcus Lindblom wrote: >> Carsten Neumann wrote: >>> Hello Marcus, >>> >>> Marcus Lindblom wrote: >>>> 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). >>>> [snip] >>>> 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) >>> hm, _sfVariables is of type SFUnrecChildShaderProgramVariablesPtr, i.e. >>> it is a SField that stores a pointer to a ShaderProgramVariables object. >>> Is the value stored in the field 0xcdcdcdcd or the pointed-to memory, i.e. >>> >>> is _sfVariables.getValue() == 0xcdcdcdcd >>> or is *reinterpret_cast<UInt32>(_sfVariables.getValue()) == 0xcdcdcdcd ? >> The first, i.e. the value there. In the crashing function, on top, the >> this ptr is 0xcdcdcdcd. > > but wouldn't that mean the already object behind m_parameters is not > valid. E.g. the initial > m_parameters(OSG::SimpleSHLVariableChunk::create()) > fails somehow. Though I could not reproduce it with the current head > 2043, at least with simple tests.
That's right. Inside the create() function, everything looks ok (i.e. the fc transit ptr is ok and so is everyhing in it, including _sfVariables, but when that returns and I store it in a RefPtr (or TransitPtr) it's contents turns into 0xcdcdcdcd according to the debugger. (I tested moving the code into the constructors body, to be able to debug it better, no difference there.) Very strange that something changes value just there. Hmm!! I suspect ABI incompatibility. Maybe I've wrongly set (or forgot to set) some CMake parameter when I rebuilt (as I had to clear the cache) or something. I'll look in to this. I suspect the _SCL_SECURE stuff, which I disabled by enabling OSG_DISABLE_SECURE_CXXX. *poke around* It seems as it's enabled in my app somehow, even though I have defines against it. Thanks for providing guidance. I'm a' gonna hunt it down proper. :) 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
