Skip to content

マネージャ起動時のポート接続、アクティベート失敗時に異常終了しないようにする#1031

Open
Nobu19800 wants to merge 8 commits intoOpenRTM:masterfrom
Nobu19800:bugs/corbartcutilexeception
Open

マネージャ起動時のポート接続、アクティベート失敗時に異常終了しないようにする#1031
Nobu19800 wants to merge 8 commits intoOpenRTM:masterfrom
Nobu19800:bugs/corbartcutilexeception

Conversation

@Nobu19800
Copy link
Copy Markdown

Identify the Bug

manager.components.preconnectmanager.components.preactivationで設定したポートの接続、アクティベートで例外が発生するとプロセスが異常終了する。

Description of the Change

CORBA_RTCUtilの関数はCORBAのメソッドで例外が発生しても例外処理をしないため、ManagerのCORBA_RTCUtilの関数を呼び出している箇所で例外処理するように変更した。

Verification

  • Did you succeed the build?
  • No warnings for the build?
  • Have you passed the unit tests?

@n-kawauchi n-kawauchi marked this pull request as ready for review September 8, 2024 14:52
Copy link
Copy Markdown

@n-kawauchi n-kawauchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最新masterへマージしたところコンフリクトしました。

>git merge bugs/corbartcutilexeception
Auto-merging CMakeLists.txt
Auto-merging etc/CMakeLists.txt
Auto-merging src/lib/rtm/CORBA_RTCUtil.cpp
Auto-merging src/lib/rtm/CORBA_RTCUtil.h
Auto-merging src/lib/rtm/InPortBase.cpp
Auto-merging src/lib/rtm/Manager.cpp
CONFLICT (content): Merge conflict in src/lib/rtm/Manager.cpp
Auto-merging src/lib/rtm/Manager.h
Auto-merging src/lib/rtm/ManagerServant.cpp
Auto-merging src/lib/rtm/NamingManager.cpp
CONFLICT (content): Merge conflict in src/lib/rtm/NamingManager.cpp
Auto-merging src/lib/rtm/OutPortBase.cpp
Automatic merge failed; fix conflicts and then commit the result.

@Nobu19800
Copy link
Copy Markdown
Author

コンフリクトを解消しました。

@n-kawauchi

Copy link
Copy Markdown

@n-kawauchi n-kawauchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ConsoleInとConsoleOutの接続で、追加された例外処理を「意図的に」発生させることはできず、正常動作と違うエラーメッセージを確認しました。
このPRソースをmasterブランチにマージし、debパッケージを生成・インストールしたUbuntu24.04環境での確認です。

  • ConsoleOutは下記内容のrtc.confを使用して起動
    corba.nameservers: localhost
    naming.formats: %h.host_cxt/%n.rtc
    logger.enable: YES
    logger.log_level: DEBUG
    manager.components.preactivation: ConsoleIn0, ConsoleOut0
    
  • ConsoleInは下記内容のrtc1.confを使用して起動
    corba.nameservers: localhost
    naming.formats: %h.host_cxt/%n.rtc
    logger.enable: YES
    logger.log_level: DEBUG
    manager.components.preconnect: ConsoleIn0.out?port=ConsoleOut0.in&interface_type=corba_cdr&dataflow_type=push&subscription_type=flush
    manager.components.preactivation: ConsoleIn0, ConsoleOut0
    
  • ConsoleOut -> ConsoleInの順番で起動し、RTSE上でポート間を接続
  • 下記方法では追加されたRTC_ERRORメッセージは確認できませんでした
    • 両RTCの接続・アクティブ化後、ConsoleOutをCtrl+Cで強制終了
    • manager.components.preconnectのパラメータを存在しない型にしてみた
      interface_type=invalid_type

@Nobu19800
Copy link
Copy Markdown
Author

問題を再現できるサンプルコンポーネントがないため、以下のRTCをビルドして使ってください。

  1. ポート接続エラー再現
> RTCActivationTestComp.exe
> ConsoleOutComp.exe -o "manager.components.preconnect:rtcname://localhost:2809/*/RTCActivationTest0.out?port=ConsoleOut0.in"
  1. アクティブ化エラー再現
> RTCActivationTestComp.exe  -o "exec_cxt.activation_timeout:10000"
> ConsoleOutComp.exe -o "rtcname://localhost:2809/*/RTCActivationTest0"

@n-kawauchi

@n-kawauchi
Copy link
Copy Markdown

@Nobu19800

動作確認前にWindows用CI環境でビルドエラーが発生しているので、その詳細をお知らせします。

  • AppVeyor
    • これはビルド設定がvs2013とvs2015 の2パターンと古いことが原因のようです。修正は後日とさせて下さい。
  • Azure Pipelines / OpenRTM.OpenRTM-aist (Analyze)
    • エラー詳細だけお知らせします。AIに対処方法は聞いてみましたが、こちらでは対応できませんので。
Analyze by Clangで下記エラーがでました。解決方法を教えて。

[28/298] Building CXX object src\lib\coil\CMakeFiles\coil_objlib.dir\common\coil\Properties.cpp.obj
FAILED: [code=1] src/lib/coil/CMakeFiles/coil_objlib.dir/common/coil/Properties.cpp.obj 
C:\Strawberry\c\bin\ccache.exe C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\Llvm\bin\clang-cl.exe  /nologo -TP -DLIBRARY_EXPORTS -DNOMINMAX -D_WIN32_WINNT=0x0603 -ID:\a\1\s\src\lib\coil\common -ID:\a\1\s\src\lib\coil\win32 /imsvc D:\a\1\s\build\src\lib -m64 -fdiagnostics-absolute-paths  /DWIN32 /D_WINDOWS /GR /EHsc /O2 /Ob2 /DNDEBUG -MD -Werror -Weverything -Wno-documentation -Wno-documentation-unknown-command -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-cast-qual -Wno-conversion -Wno-covered-switch-default -Wno-deprecated -Wno-disabled-macro-expansion -Wno-double-promotion -Wno-exit-time-destructors -Wno-format-nonliteral -Wno-global-constructors -Wno-header-hygiene -Wno-inconsistent-missing-destructor-override -Wno-missing-prototypes -Wno-missing-variable-declarations -Wno-old-style-cast -Wno-reserved-id-macro -Wno-shadow-field-in-constructor -Wno-shadow-field -Wno-shorten-64-to-32 -Wno-sign-compare -Wno-sign-conversion -Wno-switch-enum -Wno-tautological-unsigned-zero-compare -Wno-undefined-reinterpret-cast -Wno-unreachable-code-break -Wno-unreachable-code-return -Wno-unreachable-code -Wno-unused-local-typedef -Wno-unused-macros -Wno-weak-vtables /showIncludes /Fosrc\lib\coil\CMakeFiles\coil_objlib.dir\common\coil\Properties.cpp.obj /Fdsrc\lib\coil\CMakeFiles\coil_objlib.dir\ -c -- D:\a\1\s\src\lib\coil\common\coil\Properties.cpp
D:\a\1\s\src\lib\coil\common\coil\Properties.cpp(311,35): error: unsafe buffer access [-Werror,-Wunsafe-buffer-usage]
  311 |     for (size_t i = 0; i < num && defaults[i][0] != '\0' ; i += 2)
      |                                   ^~~~~~~~
D:\a\1\s\src\lib\coil\common\coil\Properties.cpp(313,39): error: unsafe buffer access [-Werror,-Wunsafe-buffer-usage]
  313 |         setDefault(eraseBothEndsBlank(defaults[i]),
      |                                       ^~~~~~~~
D:\a\1\s\src\lib\coil\common\coil\Properties.cpp(314,39): error: unsafe buffer access [-Werror,-Wunsafe-buffer-usage]
  314 |                    eraseBothEndsBlank(defaults[i + 1]));
      |                                       ^~~~~~~~
3 errors generated.
[29/298] Building CXX object src\lib\coil\CMakeFiles\coil_objlib.dir\common\coil\TimeMeasure.cpp.obj
[30/298] Building CXX object src\lib\coil\CMakeFiles\coil_objlib.dir\common\coil\Timer.cpp.obj
ninja: build stopped: subcommand failed.
##[error]Cmd.exe exited with code '1'.
Finishing: Analyze by Clang
  • Azure Pipelines / OpenRTM.OpenRTM-aist (Build vs2019)
    • エラー内容は「##[error]No image label found to route agent pool」です
    • windows-2019 イメージは廃止されて使用できなくなっているようです。後ほどazure-pipelines.ymlから外します。
  • Azure Pipelines / OpenRTM.OpenRTM-aist (Build vs2022)
    • これはROS2Transportでinstall_manifest.txtが見つからないというものでした。masterに修正は入っているのでビルドタイミングの問題でしょうか。
   122>PrepareForBuild:
         Creating directory "x64\Release\ROS2Transport_uninstall\".
         Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
         Creating directory "x64\Release\ROS2Transport_uninstall\ROS2Tran.EAE5C468.tlog\".
       InitializeBuildStatus:
         Creating "x64\Release\ROS2Transport_uninstall\ROS2Tran.EAE5C468.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
         Touching "x64\Release\ROS2Transport_uninstall\ROS2Tran.EAE5C468.tlog\unsuccessfulbuild".
       CustomBuild:
         CMake Error at ament_cmake_uninstall_target/ament_cmake_uninstall_target.cmake:34 (message):
           Cannot find install manifest: D:/a/1/s/build/install_manifest.txt
         
##[error]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): Error MSB8066: Custom build for 'D:\a\1\s\build\CMakeFiles\d42d43adc07d3d0fdc8aa12e19b486a2\ROS2Transport_uninstall.rule;D:\a\1\s\src\ext\transport\ROS2Transport\CMakeLists.txt' exited with code 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants