mavlink / mavros

MAVLink to ROS gateway with proxy for Ground Control Station
Other
880 stars 990 forks source link

`mavros-uas-test` and `mavros-router-test` crash with segfault #1962

Open ugol-1 opened 3 months ago

ugol-1 commented 3 months ago

Issue details

The mavros-uas-test and mavros-router-test crash with segfault:

$ ./mavros-uas-test 
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from TestUAS
[ RUN      ] TestUAS.is_plugin_allowed
[       OK ] TestUAS.is_plugin_allowed (80 ms)
[ RUN      ] TestUAS.add_plugin__route_message__filter
[INFO] [1719428469.176465720] [test_mavros_uas]: Plugin test1 created
[INFO] [1719428469.176806019] [test_mavros_uas]: Plugin test1 initialized
[INFO] [1719428469.176837162] [test_mavros_uas]: Plugin test2 created
[INFO] [1719428469.176872680] [test_mavros_uas]: Plugin test2 initialized
[       OK ] TestUAS.add_plugin__route_message__filter (9 ms)
[----------] 2 tests from TestUAS (89 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (89 ms total)
[  PASSED  ] 2 tests.
cannot publish data, at ./src/rmw_publish.cpp:62 during '__function__'
Fail in delete datareader, at ./src/rmw_service.cpp:100 during '__function__'
Segmentation fault (core dumped)
$ ./mavros-router-test 
[==========] Running 8 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 8 tests from TestRouter
[ RUN      ] TestRouter.set_parameter
[INFO] [1719428485.651016375] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1719428485.651162936] [test_mavros_router]: Built-in MAVLink package version: 2024.6.6
[INFO] [1719428485.651185118] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all csAirLink cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1719428485.651199449] [test_mavros_router]: MAVROS Router started
[INFO] [1719428485.651366110] [test_mavros_router]: Requested to add endpoint: type: 0, url: tcp-l://:57601
[INFO] [1719428485.651612959] [test_mavros_router]: Endpoint link[1000] created
[INFO] [1719428485.654296130] [test_mavros_router]: link[1000] opened successfully
[INFO] [1719428485.654500741] [test_mavros_router]: Requested to add endpoint: type: 0, url: udp://:45001@
[INFO] [1719428485.654711772] [test_mavros_router]: Endpoint link[1001] created
[INFO] [1719428485.655540613] [test_mavros_router]: link[1001] opened successfully
[INFO] [1719428485.655729337] [test_mavros_router]: Requested to add endpoint: type: 1, url: tcp-l://:57602
[INFO] [1719428485.655807998] [test_mavros_router]: Endpoint link[1002] created
[INFO] [1719428485.656175340] [test_mavros_router]: link[1002] opened successfully
[INFO] [1719428485.656218928] [test_mavros_router]: Requested to add endpoint: type: 1, url: udp://:45002@
[INFO] [1719428485.656291102] [test_mavros_router]: Endpoint link[1003] created
[INFO] [1719428485.656624994] [test_mavros_router]: link[1003] opened successfully
[INFO] [1719428485.656768802] [test_mavros_router]: Requested to add endpoint: type: 2, url: /uas1
[INFO] [1719428485.656894897] [test_mavros_router]: Endpoint link[1004] created
[INFO] [1719428485.664535626] [test_mavros_router]: link[1004] opened successfully
[INFO] [1719428485.664597247] [test_mavros_router]: Requested to add endpoint: type: 2, url: /uas2
[INFO] [1719428485.664674323] [test_mavros_router]: Endpoint link[1005] created
[INFO] [1719428485.665377671] [test_mavros_router]: link[1005] opened successfully
[       OK ] TestRouter.set_parameter (63 ms)
[ RUN      ] TestRouter.route_fcu_broadcast
[INFO] [1719428485.674760417] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1719428485.674807241] [test_mavros_router]: Built-in MAVLink package version: 2024.6.6
[INFO] [1719428485.674818728] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all csAirLink cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1719428485.674828999] [test_mavros_router]: MAVROS Router started
[       OK ] TestRouter.route_fcu_broadcast (10 ms)
[ RUN      ] TestRouter.route_uas_broadcast
[INFO] [1719428485.684987419] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1719428485.685040600] [test_mavros_router]: Built-in MAVLink package version: 2024.6.6
[INFO] [1719428485.685055112] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all csAirLink cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1719428485.685068344] [test_mavros_router]: MAVROS Router started
[       OK ] TestRouter.route_uas_broadcast (10 ms)
[ RUN      ] TestRouter.route_gcs_broadcast
[INFO] [1719428485.696304490] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1719428485.696350340] [test_mavros_router]: Built-in MAVLink package version: 2024.6.6
[INFO] [1719428485.696360720] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all csAirLink cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1719428485.696370646] [test_mavros_router]: MAVROS Router started
[       OK ] TestRouter.route_gcs_broadcast (11 ms)
[ RUN      ] TestRouter.route_targeted_one_system
[INFO] [1719428485.708863996] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1719428485.708914491] [test_mavros_router]: Built-in MAVLink package version: 2024.6.6
[INFO] [1719428485.708927758] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all csAirLink cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1719428485.708937937] [test_mavros_router]: MAVROS Router started
[       OK ] TestRouter.route_targeted_one_system (13 ms)
[ RUN      ] TestRouter.route_targeted_two_system
[INFO] [1719428485.723882583] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1719428485.723951938] [test_mavros_router]: Built-in MAVLink package version: 2024.6.6
[INFO] [1719428485.723970066] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all csAirLink cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1719428485.723982355] [test_mavros_router]: MAVROS Router started
[       OK ] TestRouter.route_targeted_two_system (15 ms)
[ RUN      ] TestRouter.route_targeted_system_component
[INFO] [1719428485.740628327] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1719428485.740681252] [test_mavros_router]: Built-in MAVLink package version: 2024.6.6
[INFO] [1719428485.740695993] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all csAirLink cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1719428485.740707469] [test_mavros_router]: MAVROS Router started
[       OK ] TestRouter.route_targeted_system_component (17 ms)
[ RUN      ] TestRouter.endpoint_recv_message
[INFO] [1719428485.757738338] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1719428485.757788568] [test_mavros_router]: Built-in MAVLink package version: 2024.6.6
[INFO] [1719428485.757802369] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all csAirLink cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1719428485.757814519] [test_mavros_router]: MAVROS Router started
[INFO] [1719428485.757881099] [test_mavros_router]: Requested to add endpoint: type: 2, url: /uas1
[INFO] [1719428485.757969036] [test_mavros_router]: Endpoint link[1000] created
[INFO] [1719428485.759326673] [test_mavros_router]: link[1000] opened successfully
[INFO] [1719428485.759472842] [test_mavros_router]: link[1000] detected remote address 1.191
[WARN] [1719428485.759522063] [test_mavros_router]: Message dropped: msgid: 0, source: 1.191, target: 0.0
[       OK ] TestRouter.endpoint_recv_message (19 ms)
[----------] 8 tests from TestRouter (158 ms total)

[----------] Global test environment tear-down
[==========] 8 tests from 1 test suite ran. (158 ms total)
[  PASSED  ] 8 tests.
cannot publish data, at ./src/rmw_publish.cpp:62 during '__function__'
Fail in delete datareader, at ./src/rmw_service.cpp:100 during '__function__'
Segmentation fault (core dumped)

As the consequence, not all tests are run.

MAVROS version and platform

Mavros: built from ros2 branch b0da849a06eb1a215b9205b92b8cf39c6d7cf88f ROS: Iron Ubuntu: 22.04.4 LTS

Autopilot type and version

N/A

duguguang commented 2 months ago

mavros-uas-test crashed:

$ ./mavros-uas-test 
[==========] Running 2 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 2 tests from TestUAS
[ RUN      ] TestUAS.is_plugin_allowed

[  INFO ] /home/nokov/ros2_ws/src/mavros/mavros/test/test_uas.cpp:186:: This is a debug message.
Segmentation fault (core dumped)

but mavros-router-test run ok :

$ ./mavros-router-test 
[==========] Running 8 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 8 tests from TestRouter
[ RUN      ] TestRouter.set_parameter
[INFO] [1722616080.985188189] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1722616080.985323238] [test_mavros_router]: Built-in MAVLink package version: 2022.12.30
[INFO] [1722616080.985359046] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1722616080.985367170] [test_mavros_router]: MAVROS Router started
[INFO] [1722616080.985424571] [test_mavros_router]: Requested to add endpoint: type: 0, url: tcp-l://:57601
[INFO] [1722616080.985488074] [test_mavros_router]: Endpoint link[1000] created
[INFO] [1722616080.985822668] [test_mavros_router]: link[1000] opened successfully
[INFO] [1722616080.985865284] [test_mavros_router]: Requested to add endpoint: type: 0, url: udp://:45001@
[INFO] [1722616080.985886701] [test_mavros_router]: Endpoint link[1001] created
[INFO] [1722616080.986001964] [test_mavros_router]: link[1001] opened successfully
[INFO] [1722616080.986067761] [test_mavros_router]: Requested to add endpoint: type: 1, url: tcp-l://:57602
[INFO] [1722616080.986112760] [test_mavros_router]: Endpoint link[1002] created
[INFO] [1722616080.986206495] [test_mavros_router]: link[1002] opened successfully
[INFO] [1722616080.986242478] [test_mavros_router]: Requested to add endpoint: type: 1, url: udp://:45002@
[INFO] [1722616080.986262832] [test_mavros_router]: Endpoint link[1003] created
[INFO] [1722616080.986349755] [test_mavros_router]: link[1003] opened successfully
[INFO] [1722616080.986401253] [test_mavros_router]: Requested to add endpoint: type: 2, url: /uas1
[INFO] [1722616080.986445048] [test_mavros_router]: Endpoint link[1004] created
[INFO] [1722616080.987085122] [test_mavros_router]: link[1004] opened successfully
[INFO] [1722616080.987123821] [test_mavros_router]: Requested to add endpoint: type: 2, url: /uas2
[INFO] [1722616080.987147148] [test_mavros_router]: Endpoint link[1005] created
[INFO] [1722616080.987440401] [test_mavros_router]: link[1005] opened successfully
[       OK ] TestRouter.set_parameter (24 ms)
[ RUN      ] TestRouter.route_fcu_broadcast
[INFO] [1722616080.992750966] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1722616080.992834360] [test_mavros_router]: Built-in MAVLink package version: 2022.12.30
[INFO] [1722616080.992876816] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1722616080.992911054] [test_mavros_router]: MAVROS Router started
[       OK ] TestRouter.route_fcu_broadcast (6 ms)
[ RUN      ] TestRouter.route_uas_broadcast
[INFO] [1722616080.998944156] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1722616080.999011413] [test_mavros_router]: Built-in MAVLink package version: 2022.12.30
[INFO] [1722616080.999020807] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1722616080.999059470] [test_mavros_router]: MAVROS Router started
[       OK ] TestRouter.route_uas_broadcast (12 ms)
[ RUN      ] TestRouter.route_gcs_broadcast
[INFO] [1722616081.014533725] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1722616081.014608956] [test_mavros_router]: Built-in MAVLink package version: 2022.12.30
[INFO] [1722616081.014641857] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1722616081.014649219] [test_mavros_router]: MAVROS Router started
[       OK ] TestRouter.route_gcs_broadcast (9 ms)
[ RUN      ] TestRouter.route_targeted_one_system
[INFO] [1722616081.019745357] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1722616081.019902130] [test_mavros_router]: Built-in MAVLink package version: 2022.12.30
[INFO] [1722616081.019937393] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1722616081.019944773] [test_mavros_router]: MAVROS Router started
[       OK ] TestRouter.route_targeted_one_system (15 ms)
[ RUN      ] TestRouter.route_targeted_two_system
[INFO] [1722616081.038746231] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1722616081.038822943] [test_mavros_router]: Built-in MAVLink package version: 2022.12.30
[INFO] [1722616081.038856038] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1722616081.038863244] [test_mavros_router]: MAVROS Router started
[       OK ] TestRouter.route_targeted_two_system (15 ms)
[ RUN      ] TestRouter.route_targeted_system_component
[INFO] [1722616081.066073661] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1722616081.066160447] [test_mavros_router]: Built-in MAVLink package version: 2022.12.30
[INFO] [1722616081.066191985] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1722616081.066441871] [test_mavros_router]: MAVROS Router started
[       OK ] TestRouter.route_targeted_system_component (22 ms)
[ RUN      ] TestRouter.endpoint_recv_message
[INFO] [1722616081.089289225] [test_mavros_router]: Built-in SIMD instructions: SSE, SSE2
[INFO] [1722616081.089355846] [test_mavros_router]: Built-in MAVLink package version: 2022.12.30
[INFO] [1722616081.089402084] [test_mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[INFO] [1722616081.089409698] [test_mavros_router]: MAVROS Router started
[INFO] [1722616081.089434110] [test_mavros_router]: Requested to add endpoint: type: 2, url: /uas1
[INFO] [1722616081.089462218] [test_mavros_router]: Endpoint link[1000] created
[INFO] [1722616081.090269973] [test_mavros_router]: link[1000] opened successfully
[INFO] [1722616081.090357972] [test_mavros_router]: link[1000] detected remote address 1.191
[WARN] [1722616081.090403196] [test_mavros_router]: Message dropped: msgid: 0, source: 1.191, target: 0.0
[       OK ] TestRouter.endpoint_recv_message (28 ms)
[----------] 8 tests from TestRouter (132 ms total)

[----------] Global test environment tear-down
[==========] 8 tests from 1 test case ran. (132 ms total)
[  PASSED  ] 8 tests.

MAVROS version and platform

Mavros: built from ros2 branch ROS: foxy Ubuntu: 20.04 LTS

Is there new progress?