Sure, I should have it ready tomorrow.

Max

On Mon, Mar 26, 2012 at 2:07 AM, Wang Rui <[email protected]> wrote:

> Hi Max,
>
> I believe your changes is necessary and hope they could be applied to the
> OSG trunk to avoid any thread-safe problems of the osgt/osgb formats. Maybe
> you could directly submit the modified source files instead of the diffs.
>
> Wang Rui
>
>
> 2012/3/26 Max Bandazian <[email protected]>
>
>> Hi,
>>
>> I've been experiencing regular segmentation faults on Linux when using
>> the database pager heavily, and it looks to me like it's caused by a
>> particular pattern of non-threadsafe code. The PROPERTY macro defined in
>> DataTypes writes into a statically allocated std::string each time it's
>> used, and since the InputStream winds up calling that macro from multiple
>> threads with no locking mechanism, it eventually gets into a simultaneous
>> writing scenario, overruns the string's buffer, and corrupts memory.
>>
>> I see that there's some code in the InputStream commented out with a #if
>> 0, which used a stack-allocated osgDB::ObjectProperty object instead of the
>> static from PROPERTY. I'd suggest as a fix returning to that pattern, and
>> removing the PROPERTY macro entirely since there's no reasonable way to
>> make it threadsafe (at least not that I can think of). I've applied that
>> change locally to my build of OpenSceneGraph, and the segfaults have
>> stopped. If this is a change you want to integrate, I can send a zip of the
>> diffs (against the 3.0.1 release), or just zip up the patched files.
>>
>> Thanks,
>> Max Bandazian
>>
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>>
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>
>>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to