Csound Csound-dev Csound-tekno Search About

[Csnd-dev] Serious bug with csound_global_lock_

Date2016-03-12 11:36
FromMichael Gogins
Subject[Csnd-dev] Serious bug with csound_global_lock_
There is a serious bug with csound_global_lock_ on the msys64
platform. This object is initialized in the Csound shared library and
is used both in the Csound process and in plugin opcodes.

Actually there are two serious bugs. At least on the msys64 platform
and possibly on other Windows platforms, csound_global_lock_ is not
exported and imported and therefore is not shared, hence it cannot
fulfill its purpose. Also, on the msys64 platform and possibly on
other Windows platforms, this variable is not initialized in the
context of the plugins, causing Csound to crash when loading any
plugin that uses the global mutex.

As long as the loading of modules is single-threaded, removing this
lock from all modules probably is safe. I have done this for WIN32 but
left it in place for other platforms.

There is still a problem in the fluid opcodes, where the lock might be
used during a multi-threaded performance.

A real solution to this problem would involve making the global mutex
accessible only via the Csound API in csdl.h. That would work on all
platforms whereas the current code cannot and does not work on msys64
and possibly on other flavors of Windows.

Regards,
Mike


-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com