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

[Foxy backport] Improve error message for malformed YAML files #815

Closed
s-hillerk opened this issue Sep 29, 2020 · 4 comments
Closed

[Foxy backport] Improve error message for malformed YAML files #815

s-hillerk opened this issue Sep 29, 2020 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@s-hillerk
Copy link

Bug report

Passing a malformed YAML parameter file crashes nodes without hinting at the cause. The symptoms are the same as #553:

free(): double free detected in tcache 2
Aborted (core dumped)

Required Info:

  • Operating System:
    • Ubuntu 20.04
  • Installation type:
    • ROS2 deb repo via apt
  • Version or commit hash:
    • ros-foxy-rcl 1.1.7-1focal.20200921.18150
  • DDS implementation:
    • default
  • Client library (if applicable):
    • (rclpy)

Steps to reproduce issue

echo malformed::: > /tmp/settings.yaml
ros2 run <any node> --ros-args --params-file /tmp/settings.yaml

Expected behavior

The user is informed that the YAML file is malformed.

Actual behavior

The program crashes. The user is puzzled and is not told the cause of the crash.

@clalancette
Copy link
Contributor

I think this is essentially a request to backport #556 to Foxy (since I confirmed that it is fixed on the latest). I'll add this to the Foxy board for a backport.

@clalancette clalancette changed the title Improve error message for malformed YAML files [Foxy backport] Improve error message for malformed YAML files Oct 5, 2020
@clalancette
Copy link
Contributor

Help doing this would be appreciated.

@clalancette clalancette added the help wanted Extra attention is needed label Oct 5, 2020
@jacobperron jacobperron added the bug Something isn't working label Oct 9, 2020
@jacobperron
Copy link
Member

With the latest release 1.1.8, we don't see a double free error, but instead:

[ERROR] [1602279724.674172361] [rcl]: Failed to parse global arguments

>>> [rcutils|error_handling.c:108] rcutils_set_error_state()
This error state is being overwritten:

  'Couldn't parse params file: '--params-file /tmp/settings.yaml'. Error: Cannot have a value before ros__parameters at line 1, at /tmp/binarydeb/ros-foxy-rcl-yaml-param-parser-1.1.8/src/parse.c:623, at /tmp/binarydeb/ros-foxy-rcl-1.1.8/src/rcl/arguments.c:391'

with this new error message:

  'context is zero-initialized, at /tmp/binarydeb/ros-foxy-rcl-1.1.8/src/rcl/context.c:51'

rcutils_reset_error() should be called after error handling to avoid this.
<<<
[ERROR] [1602279724.674250769] [rclcpp]: failed to finalize context: context is zero-initialized, at /tmp/binarydeb/ros-foxy-rcl-1.1.8/src/rcl/context.c:51
terminate called after throwing an instance of 'rclcpp::exceptions::RCLInvalidROSArgsError'
  what():  failed to initialize rcl: error not set

Which has a better error message, though we could probably improve things so that we avoid overwriting the error state.

@jacobperron
Copy link
Member

I'm going to close this since it looks like the error message has been improved since the latest release for Foxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants