[omniORB] Potential crash in omniORB logger

Peter Klotz Peter.Klotz at ith-icoserve.com
Tue Feb 17 11:34:41 GMT 2015


omniORB uses this pattern when logging (see logIOstream.cc):

    if (logfunc())
      logfunc()(pd_buf);

logfunc() returns a reference to a statically stored function pointer. If a custom log function is set using setLogFunction() and later reset to the initial null pointer there is a race condition involved. The first evaluation of logfunc() can return a non-null pointer whereas the second evaluation returns a null pointer. So the second call crashes the application. We have seen this happening in internal tests.

The attached patch fixes this problem by performing only one evaluation per logging operation. So either the custom log function is seen and used or the null pointer is seen and omniORB's default logging behavior is used.

Regards, Peter.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omniORB-4.2.0-LogFunction.patch
Type: application/octet-stream
Size: 1157 bytes
Desc: omniORB-4.2.0-LogFunction.patch
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20150217/d5ed454a/attachment.obj>


More information about the omniORB-list mailing list