Hello,

I am using mico-2.3.11--patch-61 on Fedora-Core 3 (gcc 3.4.2).

I have created some value classes using DefaultValueRefCountBase class, because 
some IDL interfaces declare value type. However, my
program crashes at remove_ref () of DefaultValueRefCountBase, when I am 
executing my overload test programs (like 100,000 operation
calls).

This crash may be cause by race condition in DefaultValueRefCountBase 
_remove_ref method.

  void _remove_ref () {
    if (_deref()) {
      delete this;
    }
    else if (!_destructing && _count_refs () == -1) {
      // orphaned circular graph
      _add_ref ();
      _release_members ();
      delete this;
    }
  }

When first thread is executing _count_refs method, second thread can execute 
“delete this” operation after _deref, and then first
thread crashes.

It seems SimpleValueRefCountBase does not have this problem, but I want to use 
DefaultValueRefCountBase because it is CORBA
standard.

I am not sure how to fix this problem, is it possible to change the method to 
thread safe?

Best regards,
--
Hideo KINAMI

_______________________________________________
Mico-devel mailing list
[email protected]
http://www.mico.org/mailman/listinfo/mico-devel

Reply via email to