プロジェクト

全般

プロフィール

バグ #750

RTObject_impl::detach_context の不具合

匿名ユーザー がほぼ15年前に追加. 14年以上前に更新.

ステータス:
終了
優先度:
通常
担当者:
-
対象バージョン:
-
開始日:
2009/06/24
期日:
進捗率:

100%

予定工数:

説明

  • 現象:
    以下のような場合、id2のdetach_contextで落ちます。
    RTObjectMock* rto = new RTObjectMock(m_pORB, m_pPOA); // will be deleted automatically
    RTC::PeriodicExecutionContext* ec1 = new RTC::PeriodicExecutionContext(); // will be deleted automatically
    RTC::PeriodicExecutionContext* ec2 = new RTC::PeriodicExecutionContext(); // will be deleted automatically
    RTC::UniqueId id1 = rto->attach_context(ec1->_this());
    RTC::UniqueId id2 = rto->attach_context(ec2->_this());
    rto->detach_context(id1);
    rto->detach_context(id2);
  • 原因:
    detach_context()の最後で、CORBA_SeqUtil::erase(m_ecOther, index) で要素を消しています。
    eraseは要素を詰めるため、id がずれてしまい現象が発生します。

履歴

#1 n-ando14年以上前に更新

  • nilを代入
  • nil checkを追加

#2 匿名ユーザー が14年以上前に更新

  • 対策
    1. detach_context() で m_ecOther の erase やめて、nil を代入するように変更。
    2. finalize() で m_ecOther が全て nil の場合、m_ecOther を clear するように変更
    3. exit()、is_alive()、get_context() で m_ecOther の要素にアクセスする間に nil チェックを追加。
    4. ファンクタ ec_copy、ec_find、 deactivate_comps で 引数にアクセスする間に nil チェックを追加。

#3 匿名ユーザー が14年以上前に更新

  • ステータス新規 から 解決 に変更
  • 進捗率0 から 100 に変更

#4 n-ando14年以上前に更新

  • ステータス解決 から 終了 に変更

他の形式にエクスポート: Atom PDF