pombreda / alembic

Automatically exported from code.google.com/p/alembic
Other
0 stars 0 forks source link

Renderman procedural can abort with a memory error (SEGV on linux) #246

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Syoyo Fujita emailed the discussion list with a helpful patch to the renderman 
procedural.

------------------

From    Syoyo Fujita syoyofujita@gmail.com 

I confirmed that I got same thing in our renderer(lucille).

The problem is here.

//-*****************************************************************************
void ParamListBuilder::add( const std::string & declaration, RtPointer value,
                           ArraySamplePtr sampleToRetain )
{
   m_declarations.push_back( declaration );

   m_outputDeclarations.push_back(
       const_cast<char *>( m_declarations.back().c_str() ) );
...

I think this is too bad. A pointer stored in m_outputDeclararions will
point invalid address when the internal memory layout of
m_declarations changes(e.g. by push_back() operation)

This situation might be also happen in Linux or Mac(more specifically
to say, it depends on std::vector implementation).

....

http://code.google.com/p/alembic/issues/detail?id=241

I've confirmed that the patch is good.

Original issue reported on code.google.com by ble...@gmail.com on 28 Oct 2011 at 11:28

GoogleCodeExporter commented 9 years ago
SIgh, I missed issue #241. My Bad. THis is a duplicate.

Original comment by ble...@gmail.com on 28 Oct 2011 at 11:51