Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition in creation of LockedTypeMap and registerAttributeTypes #98

Closed
mikearmstrong001 opened this issue May 1, 2014 · 1 comment
Labels
Bug A bug in the source code

Comments

@mikearmstrong001
Copy link

Mutex will only be initialized on first call, suggestion is to move the static Mutex outside of the function.

Mike


IlmImf/ImfAttribute.cpp

LockedTypeMap &
typeMap ()
{
// race condition
static Mutex criticalSection;
// end race condition
Lock lock (criticalSection);

static LockedTypeMap* typeMap = 0;

if (typeMap == 0)
typeMap = new LockedTypeMap ();

return *typeMap;

}

OpenEXR/IlmImf/ImfHeader.cpp

void
staticInitialize ()
{
// race condition
static Mutex criticalSection;
// end race condition
Lock lock (criticalSection);

static bool initialized = false;

if (!initialized)
{
@cary-ilm cary-ilm added the Bug A bug in the source code label Jun 13, 2019
@cary-ilm
Copy link
Member

Looking into the OpenEXR backlog.

This issues appears to be fixed by 00df2c7 in release v.2.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in the source code
Projects
None yet
Development

No branches or pull requests

2 participants