This repository was archived by the owner on May 31, 2025. It is now read-only.
Noetic: Fix XMLRPC endless loop#2185
Merged
sloretz merged 5 commits intonoetic-develfrom Sep 21, 2021
Merged
Conversation
It claims to be "well-formed", but the closing tag was wrong. Fix that here. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
This includes parseTag, findTag, nextTagIs, and getNextTag. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
sloretz
approved these changes
Sep 21, 2021
mjcarroll
approved these changes
Sep 21, 2021
|
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/new-packages-for-noetic-2021-09-27/22447/1 |
garyservin
pushed a commit
to locusrobotics/ros_comm
that referenced
this pull request
Apr 7, 2025
* Fix oversize string test. It claims to be "well-formed", but the closing tag was wrong. Fix that here. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add defensive checks for offset being NULL. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add unit tests for XML tag utility functions. This includes parseTag, findTag, nextTagIs, and getNextTag. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add implementation of nextTagData. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Switch structFromXml to using nextTagData. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
AadityaRavindran
pushed a commit
to locusrobotics/ros_comm
that referenced
this pull request
Apr 16, 2025
* Fix oversize string test. It claims to be "well-formed", but the closing tag was wrong. Fix that here. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add defensive checks for offset being NULL. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add unit tests for XML tag utility functions. This includes parseTag, findTag, nextTagIs, and getNextTag. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add implementation of nextTagData. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Switch structFromXml to using nextTagData. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> (cherry picked from commit 41a956c)
AadityaRavindran
added a commit
to locusrobotics/ros_comm
that referenced
this pull request
Apr 16, 2025
* Fix memory leak in rosgraph for kernel < 4.16 and Python 3 (ros#2165) (cherry picked from commit c7c5bcb) * Fix ros#2123: Do not raise exception if socket is busy in TCPROSTransport (ros#2131) Make behavior consistent with the C++ implementation. Co-authored-by: 229143434@qq.com <zxcvbnm123-*@> (cherry picked from commit b3f8e3c) * [xmlrpcpp] Fix build when gtest is not available (ros#2177) When gtest is not available, the target test_socket is not created by catkin_add_gtest (it provides a warning that gtest was not found and does not add the test). Trying to set the target properties then leads to a configuration error. Making this block conditional on the existence of the target fixes the configuration error. (cherry picked from commit 98545f8) * Do not set self.transport unless persistent in ServiceProxy (ros#2171) Co-authored-by: Kevin Chang <kevin.chang@aeolusdev.com> (cherry picked from commit c977e1e) * Fix warning related to Boost bind placeholders declared in global namespace. (ros#2169) * clients/roscpp/include/ros: publisher.h: Fix warning related to Boost bind placeholders declared in global namespace. This commit fixes the following: Warning: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com> * clients/roscpp/include/ros: node_handle.h: Fix warning related to Boost bind placeholders declared in global namespace. This commit fixes the following: Warning: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com> (cherry picked from commit 3294299) * [rospy] add current_real docstring in timer.py (ros#2178) * add current_reald doc in timer.py * fix docstring in timer.py Co-authored-by: Jacob Perron <jacob@openrobotics.org> Co-authored-by: Jacob Perron <jacob@openrobotics.org> (cherry picked from commit 11ebadc) * Noetic: Fix XMLRPC endless loop (ros#2185) * Fix oversize string test. It claims to be "well-formed", but the closing tag was wrong. Fix that here. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add defensive checks for offset being NULL. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add unit tests for XML tag utility functions. This includes parseTag, findTag, nextTagIs, and getNextTag. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add implementation of nextTagData. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Switch structFromXml to using nextTagData. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> (cherry picked from commit 41a956c) * Revert "Fix warning related to Boost bind placeholders declared in global namespace. (ros#2169)" (ros#2187) This reverts commit 3294299. (cherry picked from commit b9bd85d) * keep the persistent connection only if rosmaster supports http1.1 (ros#2208) * keep the persistent connection only if rosmaster supports http1.1 Signed-off-by: Chen Lihui <lihui.chen@sony.com> * Revert "keep the persistent connection only if rosmaster supports http1.1" This reverts commit 2cb7602. Signed-off-by: Chen Lihui <lihui.chen@sony.com> * fix without breaking ABI Signed-off-by: Chen Lihui <lihui.chen@sony.com> * Update comment Co-authored-by: Jacob Perron <jacob@openrobotics.org> * Fix $(dirname) resolution in include tags (ros#2173) * roslaunch: Extend $(dirname) test * roslaunch include: Resolve substitution args w.r.t. parent's context to ensure that $(dirname) resolves to parent's dir * Correct missed boost::placeholders::_7 (ros#2242) * Add a workaround for a race condition while closing the socket (ros#2212) (ros#2233) Co-authored-by: Daniele Calisi <calisi@magazino.eu> * rosbag reindex bugfix - seek to truncated position after broken chunk (ros#2286) The truncate operation left the current `f.tell()` read head at the pre-truncated position, so the chunk infos that are written on closing the file started writing at this pre-truncated position, leaving dangling broken chunk data in between the last good chunk and the first file-end chunkinfo. Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com> * Set TCP_NODELAY. (ros#2293) (cherry picked from commit f03fd33) * Add missing include (ros#2248) (cherry picked from commit 5edee4e) * Move @jacobperron from maintainer to author (ros#2302) Signed-off-by: Shane Loretz <sloretz@osrfoundation.org> Signed-off-by: Shane Loretz <sloretz@osrfoundation.org> (cherry picked from commit 99a1ce0) * Fix determining supported kernel version for HTTP 1.1 (ros#2202) Signed-off-by: Martin Pecka <peckama2@fel.cvut.cz> (cherry picked from commit 047716c) * --noarr and --nostr option in rosservice call (ros#2307) (cherry picked from commit 1a1564e) * [topic_tools/mux] add wait_publisher_initialization option in mux (ros#2305) * [topic_tools] add wait_publisher_initialization option in mux * add wait_publisher_second param (cherry picked from commit 13dc820) * Fix error "s is not defined" (reopening ros#2320 again) (ros#2328) * Fix error "s is not defined" (reopening Refs ros#2320 again) * Update clients/rospy/src/rospy/topics.py with suggestion Co-authored-by: Martin Pecka <peci1@seznam.cz> --------- Co-authored-by: Martin Pecka <peci1@seznam.cz> (cherry picked from commit 030e132) * Added init_options::NoSimTime to forcefully disable subscribing to /clock (ros#2342) * Added init_options::NoSimTime to forcefully disable subscribing to /clock. * Fix enum value * Added test for init_options::NoSimTime * Fixed test (cherry picked from commit b1ef2ee) * Fixed ROSCONSOLE_FORMAT with microseconds (ros#2370) (cherry picked from commit aef16f0) * Fixed uninitialized Time usage in rosservice call (ros#2369) (cherry picked from commit de95e28) * [windows] Remove python2 specific hack (ros#2364) This PR ros#1872 made windows act differently than linux because of a specific python 2 delay doing unnecessary DNS checks for localhost. The underlying code in python is different for python3 so the hack is no longer necessary. Given that, its better to reunify the codebase (cherry picked from commit cf0f276) * Fix segfault with default-constructed rosbag::ChunkedFile::swap (ros#2363) Closes ros#2362. (cherry picked from commit 3ad1409) * Fix rostest target names when build dir is inside source dir (ros#2361) It's a common approach to build cmake projects in a `build` folder in the project root. It's just that `rosbuild`/`catkin` does not do it, so the changed name never mattered. When you try the target name includes another `build_` string and there is *exactly one* package in the whole ecosystem that relies on this not happening: https://github.com/ros/ros_comm/blob/845f74602c7464e08ef5ac6fd9e26c97d0fe42c9/test/test_rosbag/bag_migration_tests/CMakeLists.txt#L87-L103 (cherry picked from commit 336b29a) * apply patch to fix build with boost 1.83.0 (ros#2354) (cherry picked from commit 0b0076d) * Update: #include <boost/bind.hpp> -> <boost/bind/bind.hpp> for boost 1.73 (ros#2348) * Update: #include <boost/bind.hpp> -> <boost/bind/bind.hpp> for boost 1.73 Since boost 1.73, i.e. on Ubuntu 22.04, the old header issues a deprecation warning: ``` /usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’ ``` While the new header <boost/bind/bind.hpp> is available for a long time (on 18.04 already) and the source has been updated to use boost::placeholders in ros#2023, the header was not yet updated. * For backwards compatibility: pull placeholders into global namespace (cherry picked from commit 076ea3f) * add --min-space option to the python cli of rosbag record (ros#2298) (cherry picked from commit 1b1e7da) * Fix EINTR handling in XmlRpcDispatch::work (ros#2278) * Fix EINTR handling in XmlRpcDispatch::work * Document the XmlRpcDispatch::work behavior we receiving EINTR (cherry picked from commit 3337133) * Expose is_shutdown_requested in rospy namespace. (ros#2267) Just like the C++ `ros::isShuttingDown()`, this can be useful in certain cases where shutdown needs to be checked before all shutdown handlers finished. The difference to `is_shutdown()` is already clearly described in the docstring of `is_shutdown_requested()`. (cherry picked from commit c27175c) * rosnode: allow rosrun & roslaunch to find script (ros#2262) By installing the script in the "package bin destination" as well as letting setup.py install it in the global 'bin' directory. This is similar to what rosservice et al., which do work with roslaunch and rosrun. Signed-off-by: gavanderhoorn <g.a.vanderhoorn@tudelft.nl> (cherry picked from commit 31ddca1) * rosbag_main.py: fix calling uncallable signal handler object (ros#2235) (ros#2236) Co-authored-by: Yannik Nager <yannik@sunflower-labs.com> (cherry picked from commit ce22d1c) * Fix printing XmlRpcValue with GTest (ros#2224) * Fix printing XmlRpcValue with GTest * Added tests for XmlRpc::PrintTo() * Make PrintTo inline (cherry picked from commit 13e4bd0) * check if ignore_unset_args is set in xmlloader (ros#2217) (cherry picked from commit 8917094) * Address DeprecationWarning (ros#2191) (cherry picked from commit d7ddd80) * fix typo t_start -> self.t_start (ros#2183) fix typo local t_start is not defined here, need to use self.t_start (cherry picked from commit eb8bb69) * Exposed record snapshot feature for command line. (ros#2254) (cherry picked from commit ecbb123) * rostest: add subscribetest (ros#2184) * rostest: add subscribetest This PR adds `subscribetest` node to check if the specified topics are subscribed. The usage is almost the same as `publishtest`: ``` <test test-name="subscribetest_test" pkg="rostest" type="subscribetest" time-limit="7.0" retry="3"> <rosparam> topics: - name: /chatter timeout: 2. - name: /subscribed_topic timeout: 2. negative: true </rosparam> </test> ``` * install nodes/subscribetest (cherry picked from commit 5067f44) --------- Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com> Co-authored-by: Alexis Schad <a@mandelbro.com> Co-authored-by: 金梦磊 <229143434@qq.com> Co-authored-by: Wolfgang Merkt <wxmerkt@users.noreply.github.com> Co-authored-by: Kevin Chang <kevinshchang@gmail.com> Co-authored-by: Elvis Dowson <elvis.dowson@gmail.com> Co-authored-by: Shingo Kitagawa <knorth55@users.noreply.github.com> Co-authored-by: Chris Lalancette <clalancette@openrobotics.org> Co-authored-by: Jacob Perron <jacob@openrobotics.org> Co-authored-by: Chen Lihui <lihui.chen@sony.com> Co-authored-by: Robert Haschke <rhaschke@users.noreply.github.com> Co-authored-by: Lucas Walter <wsacul@gmail.com> Co-authored-by: madmage <daniele.calisi@gmail.com> Co-authored-by: Daniele Calisi <calisi@magazino.eu> Co-authored-by: Emerson Knapp <537409+emersonknapp@users.noreply.github.com> Co-authored-by: Rik Baehnemann <brik@ethz.ch> Co-authored-by: Jochen Sprickerhof <git@jochen.sprickerhof.de> Co-authored-by: Shane Loretz <sloretz@osrfoundation.org> Co-authored-by: Martin Pecka <peckama2@fel.cvut.cz> Co-authored-by: vineet131 <vineet131@users.noreply.github.com> Co-authored-by: Griffin Tabor <tabor473@gmail.com> Co-authored-by: Hugal31 <hugo.laloge@gmail.com> Co-authored-by: Michael Görner <me@v4hn.de> Co-authored-by: daizhirui <daizhirui@hotmail.com> Co-authored-by: Zijun Xu <30411902+Jeffxzj@users.noreply.github.com> Co-authored-by: Michael Grupp <grupp@magazino.eu> Co-authored-by: G.A. vd. Hoorn <g.a.vanderhoorn@tudelft.nl> Co-authored-by: Yannik Nager <yannik.nager@gmail.com> Co-authored-by: Guglielmo Gemignani <2789215+g-gemignani@users.noreply.github.com> Co-authored-by: Kei Okada <k-okada@jsk.t.u-tokyo.ac.jp> Co-authored-by: Blake Anderson <blakeanderson@utexas.edu>
AadityaRavindran
added a commit
to locusrobotics/ros_comm
that referenced
this pull request
Apr 16, 2025
* Run tests in Jenkins * removed manual jenkinsfile * Sync with upstream (#44) * Fix memory leak in rosgraph for kernel < 4.16 and Python 3 (ros#2165) (cherry picked from commit c7c5bcb) * Fix ros#2123: Do not raise exception if socket is busy in TCPROSTransport (ros#2131) Make behavior consistent with the C++ implementation. Co-authored-by: 229143434@qq.com <zxcvbnm123-*@> (cherry picked from commit b3f8e3c) * [xmlrpcpp] Fix build when gtest is not available (ros#2177) When gtest is not available, the target test_socket is not created by catkin_add_gtest (it provides a warning that gtest was not found and does not add the test). Trying to set the target properties then leads to a configuration error. Making this block conditional on the existence of the target fixes the configuration error. (cherry picked from commit 98545f8) * Do not set self.transport unless persistent in ServiceProxy (ros#2171) Co-authored-by: Kevin Chang <kevin.chang@aeolusdev.com> (cherry picked from commit c977e1e) * Fix warning related to Boost bind placeholders declared in global namespace. (ros#2169) * clients/roscpp/include/ros: publisher.h: Fix warning related to Boost bind placeholders declared in global namespace. This commit fixes the following: Warning: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com> * clients/roscpp/include/ros: node_handle.h: Fix warning related to Boost bind placeholders declared in global namespace. This commit fixes the following: Warning: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com> (cherry picked from commit 3294299) * [rospy] add current_real docstring in timer.py (ros#2178) * add current_reald doc in timer.py * fix docstring in timer.py Co-authored-by: Jacob Perron <jacob@openrobotics.org> Co-authored-by: Jacob Perron <jacob@openrobotics.org> (cherry picked from commit 11ebadc) * Noetic: Fix XMLRPC endless loop (ros#2185) * Fix oversize string test. It claims to be "well-formed", but the closing tag was wrong. Fix that here. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add defensive checks for offset being NULL. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add unit tests for XML tag utility functions. This includes parseTag, findTag, nextTagIs, and getNextTag. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add implementation of nextTagData. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Switch structFromXml to using nextTagData. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> (cherry picked from commit 41a956c) * Revert "Fix warning related to Boost bind placeholders declared in global namespace. (ros#2169)" (ros#2187) This reverts commit 3294299. (cherry picked from commit b9bd85d) * keep the persistent connection only if rosmaster supports http1.1 (ros#2208) * keep the persistent connection only if rosmaster supports http1.1 Signed-off-by: Chen Lihui <lihui.chen@sony.com> * Revert "keep the persistent connection only if rosmaster supports http1.1" This reverts commit 2cb7602. Signed-off-by: Chen Lihui <lihui.chen@sony.com> * fix without breaking ABI Signed-off-by: Chen Lihui <lihui.chen@sony.com> * Update comment Co-authored-by: Jacob Perron <jacob@openrobotics.org> * Fix $(dirname) resolution in include tags (ros#2173) * roslaunch: Extend $(dirname) test * roslaunch include: Resolve substitution args w.r.t. parent's context to ensure that $(dirname) resolves to parent's dir * Correct missed boost::placeholders::_7 (ros#2242) * Add a workaround for a race condition while closing the socket (ros#2212) (ros#2233) Co-authored-by: Daniele Calisi <calisi@magazino.eu> * rosbag reindex bugfix - seek to truncated position after broken chunk (ros#2286) The truncate operation left the current `f.tell()` read head at the pre-truncated position, so the chunk infos that are written on closing the file started writing at this pre-truncated position, leaving dangling broken chunk data in between the last good chunk and the first file-end chunkinfo. Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com> * Set TCP_NODELAY. (ros#2293) (cherry picked from commit f03fd33) * Add missing include (ros#2248) (cherry picked from commit 5edee4e) * Move @jacobperron from maintainer to author (ros#2302) Signed-off-by: Shane Loretz <sloretz@osrfoundation.org> Signed-off-by: Shane Loretz <sloretz@osrfoundation.org> (cherry picked from commit 99a1ce0) * Fix determining supported kernel version for HTTP 1.1 (ros#2202) Signed-off-by: Martin Pecka <peckama2@fel.cvut.cz> (cherry picked from commit 047716c) * --noarr and --nostr option in rosservice call (ros#2307) (cherry picked from commit 1a1564e) * [topic_tools/mux] add wait_publisher_initialization option in mux (ros#2305) * [topic_tools] add wait_publisher_initialization option in mux * add wait_publisher_second param (cherry picked from commit 13dc820) * Fix error "s is not defined" (reopening ros#2320 again) (ros#2328) * Fix error "s is not defined" (reopening Refs ros#2320 again) * Update clients/rospy/src/rospy/topics.py with suggestion Co-authored-by: Martin Pecka <peci1@seznam.cz> --------- Co-authored-by: Martin Pecka <peci1@seznam.cz> (cherry picked from commit 030e132) * Added init_options::NoSimTime to forcefully disable subscribing to /clock (ros#2342) * Added init_options::NoSimTime to forcefully disable subscribing to /clock. * Fix enum value * Added test for init_options::NoSimTime * Fixed test (cherry picked from commit b1ef2ee) * Fixed ROSCONSOLE_FORMAT with microseconds (ros#2370) (cherry picked from commit aef16f0) * Fixed uninitialized Time usage in rosservice call (ros#2369) (cherry picked from commit de95e28) * [windows] Remove python2 specific hack (ros#2364) This PR ros#1872 made windows act differently than linux because of a specific python 2 delay doing unnecessary DNS checks for localhost. The underlying code in python is different for python3 so the hack is no longer necessary. Given that, its better to reunify the codebase (cherry picked from commit cf0f276) * Fix segfault with default-constructed rosbag::ChunkedFile::swap (ros#2363) Closes ros#2362. (cherry picked from commit 3ad1409) * Fix rostest target names when build dir is inside source dir (ros#2361) It's a common approach to build cmake projects in a `build` folder in the project root. It's just that `rosbuild`/`catkin` does not do it, so the changed name never mattered. When you try the target name includes another `build_` string and there is *exactly one* package in the whole ecosystem that relies on this not happening: https://github.com/ros/ros_comm/blob/845f74602c7464e08ef5ac6fd9e26c97d0fe42c9/test/test_rosbag/bag_migration_tests/CMakeLists.txt#L87-L103 (cherry picked from commit 336b29a) * apply patch to fix build with boost 1.83.0 (ros#2354) (cherry picked from commit 0b0076d) * Update: #include <boost/bind.hpp> -> <boost/bind/bind.hpp> for boost 1.73 (ros#2348) * Update: #include <boost/bind.hpp> -> <boost/bind/bind.hpp> for boost 1.73 Since boost 1.73, i.e. on Ubuntu 22.04, the old header issues a deprecation warning: ``` /usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’ ``` While the new header <boost/bind/bind.hpp> is available for a long time (on 18.04 already) and the source has been updated to use boost::placeholders in ros#2023, the header was not yet updated. * For backwards compatibility: pull placeholders into global namespace (cherry picked from commit 076ea3f) * add --min-space option to the python cli of rosbag record (ros#2298) (cherry picked from commit 1b1e7da) * Fix EINTR handling in XmlRpcDispatch::work (ros#2278) * Fix EINTR handling in XmlRpcDispatch::work * Document the XmlRpcDispatch::work behavior we receiving EINTR (cherry picked from commit 3337133) * Expose is_shutdown_requested in rospy namespace. (ros#2267) Just like the C++ `ros::isShuttingDown()`, this can be useful in certain cases where shutdown needs to be checked before all shutdown handlers finished. The difference to `is_shutdown()` is already clearly described in the docstring of `is_shutdown_requested()`. (cherry picked from commit c27175c) * rosnode: allow rosrun & roslaunch to find script (ros#2262) By installing the script in the "package bin destination" as well as letting setup.py install it in the global 'bin' directory. This is similar to what rosservice et al., which do work with roslaunch and rosrun. Signed-off-by: gavanderhoorn <g.a.vanderhoorn@tudelft.nl> (cherry picked from commit 31ddca1) * rosbag_main.py: fix calling uncallable signal handler object (ros#2235) (ros#2236) Co-authored-by: Yannik Nager <yannik@sunflower-labs.com> (cherry picked from commit ce22d1c) * Fix printing XmlRpcValue with GTest (ros#2224) * Fix printing XmlRpcValue with GTest * Added tests for XmlRpc::PrintTo() * Make PrintTo inline (cherry picked from commit 13e4bd0) * check if ignore_unset_args is set in xmlloader (ros#2217) (cherry picked from commit 8917094) * Address DeprecationWarning (ros#2191) (cherry picked from commit d7ddd80) * fix typo t_start -> self.t_start (ros#2183) fix typo local t_start is not defined here, need to use self.t_start (cherry picked from commit eb8bb69) * Exposed record snapshot feature for command line. (ros#2254) (cherry picked from commit ecbb123) * rostest: add subscribetest (ros#2184) * rostest: add subscribetest This PR adds `subscribetest` node to check if the specified topics are subscribed. The usage is almost the same as `publishtest`: ``` <test test-name="subscribetest_test" pkg="rostest" type="subscribetest" time-limit="7.0" retry="3"> <rosparam> topics: - name: /chatter timeout: 2. - name: /subscribed_topic timeout: 2. negative: true </rosparam> </test> ``` * install nodes/subscribetest (cherry picked from commit 5067f44) --------- Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com> Co-authored-by: Alexis Schad <a@mandelbro.com> Co-authored-by: 金梦磊 <229143434@qq.com> Co-authored-by: Wolfgang Merkt <wxmerkt@users.noreply.github.com> Co-authored-by: Kevin Chang <kevinshchang@gmail.com> Co-authored-by: Elvis Dowson <elvis.dowson@gmail.com> Co-authored-by: Shingo Kitagawa <knorth55@users.noreply.github.com> Co-authored-by: Chris Lalancette <clalancette@openrobotics.org> Co-authored-by: Jacob Perron <jacob@openrobotics.org> Co-authored-by: Chen Lihui <lihui.chen@sony.com> Co-authored-by: Robert Haschke <rhaschke@users.noreply.github.com> Co-authored-by: Lucas Walter <wsacul@gmail.com> Co-authored-by: madmage <daniele.calisi@gmail.com> Co-authored-by: Daniele Calisi <calisi@magazino.eu> Co-authored-by: Emerson Knapp <537409+emersonknapp@users.noreply.github.com> Co-authored-by: Rik Baehnemann <brik@ethz.ch> Co-authored-by: Jochen Sprickerhof <git@jochen.sprickerhof.de> Co-authored-by: Shane Loretz <sloretz@osrfoundation.org> Co-authored-by: Martin Pecka <peckama2@fel.cvut.cz> Co-authored-by: vineet131 <vineet131@users.noreply.github.com> Co-authored-by: Griffin Tabor <tabor473@gmail.com> Co-authored-by: Hugal31 <hugo.laloge@gmail.com> Co-authored-by: Michael Görner <me@v4hn.de> Co-authored-by: daizhirui <daizhirui@hotmail.com> Co-authored-by: Zijun Xu <30411902+Jeffxzj@users.noreply.github.com> Co-authored-by: Michael Grupp <grupp@magazino.eu> Co-authored-by: G.A. vd. Hoorn <g.a.vanderhoorn@tudelft.nl> Co-authored-by: Yannik Nager <yannik.nager@gmail.com> Co-authored-by: Guglielmo Gemignani <2789215+g-gemignani@users.noreply.github.com> Co-authored-by: Kei Okada <k-okada@jsk.t.u-tokyo.ac.jp> Co-authored-by: Blake Anderson <blakeanderson@utexas.edu> --------- Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com> Co-authored-by: Alexis Schad <a@mandelbro.com> Co-authored-by: 金梦磊 <229143434@qq.com> Co-authored-by: Wolfgang Merkt <wxmerkt@users.noreply.github.com> Co-authored-by: Kevin Chang <kevinshchang@gmail.com> Co-authored-by: Elvis Dowson <elvis.dowson@gmail.com> Co-authored-by: Shingo Kitagawa <knorth55@users.noreply.github.com> Co-authored-by: Chris Lalancette <clalancette@openrobotics.org> Co-authored-by: Jacob Perron <jacob@openrobotics.org> Co-authored-by: Chen Lihui <lihui.chen@sony.com> Co-authored-by: Robert Haschke <rhaschke@users.noreply.github.com> Co-authored-by: Lucas Walter <wsacul@gmail.com> Co-authored-by: madmage <daniele.calisi@gmail.com> Co-authored-by: Daniele Calisi <calisi@magazino.eu> Co-authored-by: Emerson Knapp <537409+emersonknapp@users.noreply.github.com> Co-authored-by: Rik Baehnemann <brik@ethz.ch> Co-authored-by: Jochen Sprickerhof <git@jochen.sprickerhof.de> Co-authored-by: Shane Loretz <sloretz@osrfoundation.org> Co-authored-by: Martin Pecka <peckama2@fel.cvut.cz> Co-authored-by: vineet131 <vineet131@users.noreply.github.com> Co-authored-by: Griffin Tabor <tabor473@gmail.com> Co-authored-by: Hugal31 <hugo.laloge@gmail.com> Co-authored-by: Michael Görner <me@v4hn.de> Co-authored-by: daizhirui <daizhirui@hotmail.com> Co-authored-by: Zijun Xu <30411902+Jeffxzj@users.noreply.github.com> Co-authored-by: Michael Grupp <grupp@magazino.eu> Co-authored-by: G.A. vd. Hoorn <g.a.vanderhoorn@tudelft.nl> Co-authored-by: Yannik Nager <yannik.nager@gmail.com> Co-authored-by: Guglielmo Gemignani <2789215+g-gemignani@users.noreply.github.com> Co-authored-by: Kei Okada <k-okada@jsk.t.u-tokyo.ac.jp> Co-authored-by: Blake Anderson <blakeanderson@utexas.edu>
AadityaRavindran
pushed a commit
to locusrobotics/ros_comm
that referenced
this pull request
Apr 16, 2025
* Fix oversize string test. It claims to be "well-formed", but the closing tag was wrong. Fix that here. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add defensive checks for offset being NULL. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add unit tests for XML tag utility functions. This includes parseTag, findTag, nextTagIs, and getNextTag. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Add implementation of nextTagData. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Switch structFromXml to using nextTagData. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> (cherry picked from commit 41a956c)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We've recently had a report of an endless loop in ros_comm. The short of it is that the hand-written XML parser in the XMLRPC portion of ros_comm can get stuck in a (seemingly) infinite loop when certain XMLRPC calls are delivered.
Looking in detail at the XML parser, it actually accepts a lot of pieces of XML that it really shouldn't. While we could go in and heavily tighten what it accepts, that risks breaking legitimate users of the XMLRPC functionality in the stable ROS distributions.
Instead, this PR just fixes one of the issues, which is enough to fix this particular endless loop. To understand how it fixes it requires a bit of understanding of XMLRPC and how the XML parser works.
XMLRPC allows for "structures", which are heterogeneous collections of name -> value pairs. Each field of the structure should have a
<name>tag, along with a<value>tag. That is, the XML should be structured something like:However,
<name>tag parsing is done in an extremely simplistic way. In particular, it starts at a particular offset within the string, and then goes searching throughout the rest of the string for any substring matching<name>. This means that when given XML that looks like:the parser finds the
<name>tag, even though it is in a completely bogus part of the XML. Combining this with some of the other recursive parsing (since arrays can be embedded in structs can be embedded in arrays etc.) means that we can confuse the parser and end up in the endless loop.What this PR does is to introduce a new parsing function, called
nextTagData. Ignoring whitespace, this function expects that the very next XML tag is the specified one (<name>in this case). If that isn't the case, it ends up failing, which is enough to break the loop and cause parsing to completely fail.In terms of backwards compatibility, so far I haven't been able to come up with too much that this should affect (other than the attack, of course). But the parsing here is pretty hairy, so I may be missing something.
Besides the fix, this PR also adds in quite a few unit tests for the XMLRPC parsing functionality. This was done in an effort to both characterize the current state of the parser, and to ensure that the fix did not break existing functionality.
If you'd like to test any of this out yourself, I found the most targeted way to do this is to:
$ source /opt/ros/noetic/setup.bash
$ git clone https://github.com/ros/ros_comm -b clalancette/fix-xmlrpc
$ mkdir -p ros_comm/utilities/xmlrpcpp/build
$ cd ros_comm/utilities/xmlrpcpp/build
$ cmake ..
$ make
$ make tests
$ LD_LIBRARY_PATH=./devel/lib CTEST_OUTPUT_ON_FAILURE=1 ctest