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]ros2 topic echo/hz causes segment fault. #49

Open
ZhenshengLee opened this issue Jul 9, 2021 · 5 comments
Open

[Foxy]ros2 topic echo/hz causes segment fault. #49

ZhenshengLee opened this issue Jul 9, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@ZhenshengLee
Copy link
Contributor

ZhenshengLee commented Jul 9, 2021

Env

  • Ubuntu 20.04.02 LTS
  • GCC 9.3.0
  • ros2 foxy
  • lgsvl 2020.06

Observed

zs@zs-3630:~$ ros2 topic echo /tf
2021-07-06 10:39:44.892 [ Debug ]: Application registered management segment 0x7fe178bad000 with size 60126248 to id 1
2021-07-06 10:39:44.893 [ Debug ]: Application registered payload data segment 0x7fe16fcd0000 with size 149264720 to id 2
Segmentation fault (core dumped)

Expected

ros2 topic echo /tf run without error

Comment

the following commands also cause segfault.

  • ros2 topic hz /tf
  • ros2 topic hz /tf_static
  • ros2 topic hz /rslidar_points

lgsvl may not be needed to reproduce the behavior.

Originally posted by @ZhenshengLee in #42 (comment)

@ZhenshengLee ZhenshengLee changed the title ros2 topic echo /tf causes segment fault. ros2 topic echo/hz causes segment fault. Jul 9, 2021
@ZhenshengLee ZhenshengLee changed the title ros2 topic echo/hz causes segment fault. ros2 topic echo/hz causes segment fault. Jul 9, 2021
@mossmaurice mossmaurice added the bug Something isn't working label Jul 9, 2021
@christophebedard
Copy link
Member

@ZhenshengLee were you able to check whether this works? https://answers.ros.org/question/384441/how-to-debug-rmw-segfaults-launched-by-ros2cli-like-ros2-topic-echo/?answer=384845#post-id-384845

@mossmaurice
Copy link
Collaborator

@ZhenshengLee Can you double check if this problem in your setup is fixed or persists after #70 has been merged? Thanks!

@ZhenshengLee ZhenshengLee changed the title ros2 topic echo/hz causes segment fault. [Foxy]ros2 topic echo/hz causes segment fault. Jan 5, 2022
@ZhenshengLee
Copy link
Contributor Author

@mossmaurice

@ZhenshengLee Can you double check if this problem in your setup is fixed or persists after #70 has been merged? Thanks!

I am happy to do so, but #70 is for #57 and #69 , especially in galactic branch.
Seeing your changes in

} else if (ts.first == TypeSupportLanguage::C) {

There is nothing wrong in the foxy branch of this function, see

This issue was created when ros2 topic echo /chatter work but ros2 topic echo /tf makes segfault.

I will give it a test in foxy branch with @christophebedard method, but it will not be a double-check.

@ZhenshengLee
Copy link
Contributor Author

@mossmaurice

Edit:

A fast way to reproduce this bug it to

ros2 launch velodyne_description example.launch.py
ros2 topic echo /tf_static

And you will see

Log level set to: [Warning]
Segmentation fault (core dumped)

@ZhenshengLee
Copy link
Contributor Author

@christophebedard your method works on vscode! Thank you very much.

the launch file in vscode is like the following.

{
            "name": "zs: gdbrun ros2",
            "type": "cppdbg",
            "request": "launch",
            "program": "/usr/bin/python3",
            "args": [
                "/opt/ros/foxy/bin/ros2",
                "topic",
                "echo",
                "/tf_static"
            ],
            "stopAtEntry": false,
            "cwd": "${workspaceRoot}",
            "environment": [
                {
                    "name": "RMW_IMPLEMENTATION",
                    // "value": "rmw_fastrtps_cpp"
                    // "value": "rmw_ecal_proto_cpp"
                    "value": "rmw_iceoryx_cpp"
                }
            ],
            "externalConsole": false,
            // "preLaunchTask": "source_ros2_ws",
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        },

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

No branches or pull requests

3 participants