Closed iuhilnehc-ynos closed 8 months ago
(TODO: why?)
big TODO though 😅 i will take a look.
This is definitely not the final solution as Foxy
works well with the spawn_daemon
.
@fujitatomoya Sorry, I need to turn it into a draft.
Mark: It's related to https://github.com/ros2/ros2cli/pull/652.
@hidmic by any chance, do you have any idea why https://github.com/ros2/ros2cli/pull/652 leads to https://github.com/ros2/ros2cli/issues/851?
@fujitatomoya hmm, whatever it is, it is not obvious. Perhaps something funky about processes started to gather autocompletion options? A backtrace at the time of blocking would help.
Let me share my understanding,
ros2 topic echo /<tab>
in the bash, the bash will fork a child bash
to do the complete
```shell
(gdb) bt
#0 __libc_fork () at ./posix/fork.c:41
#1 0x00005602d660c6c4 in make_child (command=command@entry=0x0, flags=4) at jobs.c:2175
#2 0x00005602d6619e29 in command_substitute (
string=string@entry=0x5602d84aca10 "IFS=\"$IFS\"", ' '
bash
continue to fork to execute /usr/bin/python3 /home/chenlh/Projects/ROS2/ros2-master/install/bin/ros2
to call the TopicNameCompleter
```shell
(gdb) bt
#0 0x00007f4d764ea45a in __GI___wait4 (pid=pid@entry=-1, stat_loc=stat_loc@entry=0x7ffe56c1b560, options=options@entry=0, usage=usage@entry=0x0)
at ../sysdeps/unix/sysv/linux/wait4.c:30
#1 0x00007f4d764ea41b in __GI___waitpid (pid=pid@entry=-1, stat_loc=stat_loc@entry=0x7ffe56c1b560, options=options@entry=0) at ./posix/waitpid.c:38
#2 0x00005602d660b6ca in waitchld (block=block@entry=1, wpid=
TopicNameCompleter
will call the spawn_daemon
```shell
(gdb) bt
#0 0x00007fe55b71b7ed in __GI___select (nfds=nfds@entry=0, readfds=readfds@entry=0x0, writefds=writefds@entry=0x0, exceptfds=exceptfds@entry=0x0,
timeout=timeout@entry=0x7ffcb21d6600) at ../sysdeps/unix/sysv/linux/select.c:69
#1 0x0000560fb71b6766 in pysleep (secs=
to fix https://github.com/ros2/ros2cli/issues/851
Please refer to the https://github.com/ros2/ros2cli/pull/852#issuecomment-1716847919