Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node crashes without showing an error message #116

Open
ivanpauno opened this issue May 30, 2019 · 7 comments
Open

Node crashes without showing an error message #116

ivanpauno opened this issue May 30, 2019 · 7 comments

Comments

@ivanpauno
Copy link
Member

ivanpauno commented May 30, 2019

Bug report

Required Info:

Steps to reproduce issue

Follow https://github.com/ros2/sros2/blob/master/SROS2_Windows.md tutorial.
After having configuring the command prompt for using security (with or without Authentication), run any other example not related to talker/listener. e.g.:

ros2 run intra_process_demo cyclic_pipeline

Expected behavior

It should show a nice error.

Actual behavior

It's finished without saying nothing.

Additional information

Doing echo %errorlevel% returns -1.
I don't know if this is the known behavior of it's a bug.
If it's known, it would be nice to at least show an error message.

@ivanpauno ivanpauno changed the title Node crashes without showing error message Node crashes without showing an error message May 31, 2019
@mikaelarguedas
Copy link
Member

After having configuring the command prompt for use security (with or without Authentication), run any other example not related to talker/listener. e.g.:

Does this mean that the environment variable ROS_SECURITY_ENABLE is set to true and ROS_SECURITY_STRATEGY to Enforce in the command prompt used?

I don't know if this is the known behavior of it's a bug.
If it's known, it would be nice to at least show an error message.

It is expected behavior that a node without credential fails to be created if the prompt is configured to use SROS2.
It should print an error though, something similar to (error message copied from https://ci.ros2.org/view/nightly/job/nightly_win_deb/1271/consoleFull#console-section-771):

'SECURITY ERROR: directory garbage\publisher does not exist. Lookup strategy: MATCH_EXACT, at C:\J\workspace\nightly_win_deb\ws\src\ros2\rcl\rcl\src\rcl\security_directory.c:256'

Does ros2 run demo_nodes_cpp talker work?
Does ros2 run demo_nodes_cpp talker __node:=not_talker fail? If yes does it fail with or without an error message?

@ivanpauno
Copy link
Member Author

Does this mean that the environment variable ROS_SECURITY_ENABLE is set to true and ROS_SECURITY_STRATEGY to Enforce in the command prompt used?

Yes.

It is expected behavior that a node without credential fails to be created if the prompt is configured to use SROS2.
It should print an error though, something similar to (error message copied from https://ci.ros2.org/view/nightly/job/nightly_win_deb/1271/consoleFull#console-section-771):

'SECURITY ERROR: directory garbage\publisher does not exist. Lookup strategy: MATCH_EXACT, at C:\J\workspace\nightly_win_deb\ws\src\ros2\rcl\rcl\src\rcl\security_directory.c:256'

That error message didn't appear.

Does ros2 run demo_nodes_cpp talker work?
Does ros2 run demo_nodes_cpp talker __node:=not_talker fail? If yes does it fail with or without an error message?

Yes, that one failed with an error message.

I will try to reproduce this error in linux too, to check if it happens or not.

@ivanpauno
Copy link
Member Author

I will try to reproduce this error in linux too, to check if it happens or not.

Can't reproduce it on Linux, I see the error message you're mentioning in that case.

On Windows, I only see that error message when doing a remapping on talker or listener demos. But when running any other executable (intra_process_demo cyclic_pipeline, demo_nodes_cpp add_two_ints_server, demo_nodes_cpp parameter_blackboard), it crashes without printing an error message.

@mikaelarguedas
Copy link
Member

On Windows, I only see that error message when doing a remapping on talker or listener demos. But when running any other executable (intra_process_demo cyclic_pipeline, demo_nodes_cpp add_two_ints_server, demo_nodes_cpp parameter_blackboard), it crashes without printing an error message.

hmmm that is odd, and definitely not expected behavior. I don't have the ability to test on Windows at the moment.

Maybe you will get more hints of where it's crashing by enabling more logging? e.g. if you run

ros2 run demo_nodes_py talker_qos __log_level:=debug

Bypassing Python and running you executable directly may also help getting more information
e.g. install\lib\demo_nodes_cpp\add_two_ints_server

Is it also crashing if you set ROS_SECURITY_STRATEGY to permissive? (expected behavior is no crash)

@ruffsl
Copy link
Member

ruffsl commented Jun 5, 2019

Expected behavior
It should show a nice error.

I guess you clarified to @mikaelarguedas that you did set ROS_SECURITY_ENABLE=true for all nodes, include the not related/provisioned example node; though as an FYI if you enable ROS_SECURITY_ENABLE for the talker/listener, but not for the non-related node, then you may not necessarily encounter any reported errors. Even warnings when security settings are mismatched may be dependent upon the DDS vendor logging behavior or discovery security setting in the secure dds governance file.

when doing a remapping on talker or listener demos

What do you mean by remapping? If you remap/change the ros2 topic/service names, you'd need to update the DDS topic permission accordingly.

@ivanpauno
Copy link
Member Author

ivanpauno commented Jun 5, 2019

@ruffsl I did exactly the same steps in windows and linux, and the behavior is different.
I will detail them here:

In a new terminal/command-prompt:

  • Followed Generating a keystore, keys and certificates subsection of the tutorial of the corresponding OS.
  • Followed Define the SROS2 environment variables subsection of the tutorial of the corresponding OS.
  • Run ros2 run demo_nodes_py talker. I see a message saying that security key was found (or sth similar), and I see the publisher starts working. Then cntrl+c it.
  • Run ros2 run demo_nodes_py talker __node:=not_talker. I see the error message, as described in the tutorial (both on windows and linux).
  • Run ros2 run intra_process_demo cyclic_pipeline or any of the other executables I mentioned above. I see an error message on linux, but on Windows it just crushes without showing an error message.

All the ros2 run commands described above where executed in the same terminal/command-prompt, with the same env variables.
In both cases I'm using FastRTPS.

@mikaelarguedas I will later try to reproduce that cases and answer.

Even warnings when security settings are mismatched may be dependent upon the DDS vendor logging behavior or discovery security setting in the secure dds governance file.

I used the same settings, both on Windows and Linux.

What do you mean by remapping? If you remap/change the ros2 topic/service names, you'd need to update the DDS topic permission accordingly.

I meant remapping the node name, as the example above (ros2 run demo_nodes_py talker __node:=not_talker).

@ivanpauno
Copy link
Member Author

Maybe you will get more hints of where it's crashing by enabling more logging? e.g. if you run

ros2 run demo_nodes_py talker_qos __log_level:=debug

Running ros2 run demo_nodes_cpp parameter_blackboard __log_level:=debug results in:

[DEBUG] [rclcpp]: signal handler installed
[DEBUG] [rclcpp]: deferred_signal_handler(): waiting for SIGINT or uninstall
[DEBUG] [rcl]: Initializing node 'parameter_blackboard' in namespace ''
[DEBUG] [rcl]: Using domain ID of '0'
[DEBUG] [rcl]: Using security: true

And then it crashes.

Bypassing Python and running you executable directly may also help getting more information
e.g. install\lib\demo_nodes_cpp\add_two_ints_server

I ran add_two_ints_client.exe example using devenv /DebugExe
This is the exception being thrown:

Unhandled exception at 0x00007FFA182D9129 in add_two_ints_client.exe: Microsoft C++ exception: rclcpp::exceptions::RCLError at memory location 0x0000009CC74F98C0.

Is it also crashing if you set ROS_SECURITY_STRATEGY to permissive? (expected behavior is no crash)

No, it doesn't crash.


Extra note: I realized that the wrong behavior is only with cpp executables. I see the expected error with python executables. For example, demo_nodes_py add_two_ints_service output:

Traceback (most recent call last):
  File "c:\dev\fat-archive-ros2\lib\demo_nodes_py\add_two_ints_server-script.py", line 11, in <module>
    load_entry_point('demo-nodes-py==0.7.1', 'console_scripts', 'add_two_ints_server')()
  File "c:\dev\fat-archive-ros2\Lib\site-packages\demo_nodes_py\services\add_two_ints_server.py", line 37, in main
    node = AddTwoIntsServer()
  File "c:\dev\fat-archive-ros2\Lib\site-packages\demo_nodes_py\services\add_two_ints_server.py", line 24, in __init__
    super().__init__('add_two_ints_server')
  File "c:\dev\fat-archive-ros2\Lib\site-packages\rclpy\node.py", line 152, in __init__
    node_name, namespace, self._context.handle, cli_args, use_global_arguments))
RuntimeError: Unknown error creating node: SECURITY ERROR: directory c:\dev\fat-archive-ros2\sros2_demo/demo_keys\add_two_ints_server does not exist. Lookup strategy: MATCH_EXACT, at C:\J\workspace\packaging_windows\ws\src\ros2\rcl\rcl\src\rcl\security_directory.c:256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants