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

Fix handling of SIGINT by router executable #99

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

Yadunund
Copy link
Member

Aim to address #78

According to the manual page(), system will return -1 on error.

However right now, killing the process via SIGINT (CTRL+C) returns with error code 2. Investigating...

[2024-01-23T14:48:43Z INFO  zenohd] Starting required plugin "rest"
[2024-01-23T14:48:43Z INFO  zenohd] Successfully started plugin rest from "/usr/lib/libzenoh_plugin_rest.so"
[2024-01-23T14:48:43Z INFO  zenohd] Finished loading plugins
^C
Thread 1 "zenohd" received signal SIGINT, Interrupt.
syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
38	../sysdeps/unix/sysv/linux/x86_64/syscall.S: No such file or directory.
(gdb) bt
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00005555557a6762 in parking::Inner::park ()
#2  0x0000555555696c43 in zenohd::main ()
#3  0x000055555561eaf3 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#4  0x00005555556b23a7 in main ()
(gdb) print $eax
$1 = -512

Copy link
Collaborator

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

When running this on rolling, I get:

^CFailed to run zenoh router: zenohd -c /home/clalancette/zenoh_ws/install/rmw_zenoh_cpp/share/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5
[ros2run]: Process exited with failure 2

With this PR in place, I get:

^CZenoh router exited abnormally with error code [2]

So it is overall an improvement.

I'll just point out that almost certainly we are going to have to rethink this completely when we start testing this on Windows.

@clalancette clalancette merged commit d49f976 into rolling Jan 23, 2024
5 checks passed
@delete-merged-branch delete-merged-branch bot deleted the yadu/fix_router_process_return branch January 23, 2024 15:52
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

Successfully merging this pull request may close these issues.

2 participants