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

rcl_init segfaults on non ASCII command line arguments if LANG is not set #374

Closed
hidmic opened this issue Jan 18, 2019 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@hidmic
Copy link
Contributor

hidmic commented Jan 18, 2019

Bug report

Required Info:

  • Operating System:
    • Ubuntu 18.04 Bionic Beaver
  • Installation type:
    • Binaries and from source
  • Version or commit hash:

Steps to reproduce issue

  1. Unset the LANG environment variable if set.
unset LANG
  1. Start some node.
ros2 run demo_nodes_cpp talker
  1. Try to set a string parameter with non-ASCII value
ros2 param set /talker value 'Ragnarök'

Expected behavior

CLI should throw UnicodeEncodeError upon message conversion and serialization (inaccurate description, see below).

Actual behavior

CLI segfaults within rcl_init:

Program received signal SIGSEGV, Segmentation fault.                                                        [9/601]
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62
62      ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory.
(gdb) bt  
#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62
#1  0x00007ffff5ee3daa in rcl_init (argc=2, argv=0xab36d0, options=0x7fffffff2a00, context=0x7ffff7f5ddc8)
    at /home/michel/Workspaces/ros2_base_ws/src/ros2/rcl/rcl/src/rcl/init.c:97
#2  0x00007ffff67b75e9 in rclpy_init (_unused_self=0x7ffff7e2e458, args=0x7ffff7e25dc8)
    at /home/michel/Workspaces/ros2_base_ws/src/ros2/rclpy/rclpy/src/rclpy/_rclpy.c:529
...
#1  0x00007ffff5ee3daa in rcl_init (argc=2, argv=0xab36d0, options=0x7fffffff2a00, context=0x7ffff7f5ddc8)
    at /home/michel/Workspaces/ros2_base_ws/src/ros2/rcl/rcl/src/rcl/init.c:97
97            size_t argv_i_length = strlen(argv[i]);

Additional information

Above situation only arises when system locale settings are not properly configured as specified in the installation instructions. From that perspective, this may not be a bug, and fixing it not a fix but an enhancement to better deal with such conditions.

@hidmic hidmic added the enhancement New feature or request label Jan 18, 2019
@dirk-thomas
Copy link
Member

CLI should throw UnicodeEncodeError upon message conversion and serialization.

The problem is not happening in message conversation / serialization. The problem already happens while passing the command line arguments.

@hidmic hidmic added the in progress Actively being worked on (Kanban column) label Feb 8, 2019
@hidmic
Copy link
Contributor Author

hidmic commented Feb 11, 2019

Alright, small fixes are ready!

@tfoote tfoote removed the in progress Actively being worked on (Kanban column) label Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants