Backport various bugfixes to v3#2936
Open
julianoes wants to merge 8 commits into
Open
Conversation
Backports the following fixes from main to v3: - 10c1196 core: fix out-of-bounds read in MavlinkFtpServer::_data_as_string - 93a625b core: check ofstream (not ifstream) after seekp in FTP _work_write - 9235e52 core: fix FTP server deadlock joining burst thread while holding _mutex - 48b4987 core: make FTP server target ids atomic - cbac9c0 core: reject FTP burst offset past file size to avoid huge allocation - a565b66 fix: reject FTP responses with unexpected seq_number (#2850)
Backports the following fixes from main to v3: - bd632eb core: fix UAF when unregister_all_blocking misses _register_later_table (#2876) - 4fea94b core: avoid std::stoi terminate() when parsing metadata uri component id - 5c5eea8 core: check fopen result before using it in download_file_to_path - 1bfd363 core: fix out-of-bounds read on non-terminated PARAM_EXT_SET custom value - 2e1c78c core: guard against NULL getpwuid() in get_cache_directory - c97fa91 fix to properly remove the trailing null byte (#2899) - 46b3c9a core: reject trailing garbage when parsing port and baudrate - 6d68e3d core: check inet_ntop result in resolve_hostname_to_ip
Backports the following fixes from main to v3: - 62c60ac core: fix message matching in MavlinkRequestMessage::handle_any_message - 020777a core: fix deleting of callback on rapid requests of messages (#2894) - c863cdf core: cancel pending timeouts in MavlinkRequestMessage destructor - 89e663d core: lock _system_ids when inserting from the libmav receive path - fa747afe core: ignore duplicate/out-of-order mission items on the server - 8737229 core: reindex non-extended parameter view contiguously - 21cba79 core: enlarge libmav accumulation buffer to avoid dropping messages
Backports the following fixes from main to v3: - 845f382 core: send PARAM_ERROR for missing/wrong-type non-extended PARAM_SET - dfac8d4 param_server: allow updating an already-provided param after lockdown (#2916) - 673cecd core: notify param value changes on every used protocol (#2915) - 3e70e89 core: don't invoke param subscription callbacks under _all_params_mutex Note: main uses asio::post to defer the value-change broadcast/callbacks; on v3 this is re-expressed with the existing _work_queue and by invoking subscription callbacks after releasing _all_params_mutex.
Backports the following fixes from main to v3: - cffa8f6 core: fix erase-remove idiom in unregister_statustext_handler - 67d4631 core: synchronize statustext and param-changed handler lists - 6c643aa core: guard MavsdkImpl::_configuration with a dedicated mutex - 79534d2 core: capture callback watchdog fields by value to avoid data race Note: main's asio-executor confinement does not apply to v3; the underlying races are fixed here with dedicated std::mutex members instead.
Backports the following fixes from main to v3: - 546cd8e camera_server: fix deadlock between send_capture_status and send_tracking_status_with_interval (#2893) - c371785 Join sending_tracking_status thread before destruction (#2912) - 35686f1 mavlink_direct: fix setting target_component (#2919) - 1155116 fix: clear MavlinkDirect callbacks on deinit to avoid teardown race (#2869) - fd43ce5 log_streaming: fix backend teardown race - 85e7dc6 fix(mavlink_passthrough): export operator<< for Result with MAVSDK_PUBLIC (#2881)
Backport of dfc69b5 (#2927). process_heartbeat() stops setpoint streaming when the vehicle is not in offboard mode more than 3 seconds after the grace start. That timestamp was only written in start(), so before the first start() it was still epoch 0 and the guard always passed: any heartbeat between the first set_*() and start() reset the setpoint state, and start() then failed with NoSetpointSet. Frequent under lockstep SITL with a speed factor. Stamp the grace start whenever streaming transitions out of NotActive so the watchdog covers the gap between the first setpoint and start().
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backports ~35 bugfixes from
maintov3ahead of the next v3 patch release.Since
maindiverged fromv3(moved tocpp/src/, migrated core to asio, renamed headers to.hpp, switched to fmt-style logging), none of these cherry-picked mechanically — each was semantically ported to v3's layout (src/,.hheaders, threadpool/_work_queue,LogWarn() <<logging) and verified. asio-contract-only fixes were excluded because the underlying bug doesn't exist in v3's model.Builds clean; 290 unit tests + 83 system tests pass.
Fixes by area
FTP client/server
MavlinkFtpServer::_data_as_string(remotely triggerable)_mutexseq_number(fix: reject FTP responses with unexpected seq_number to prevent stale-packet corruption #2850)ofstream(notifstream) afterseekp; atomic FTP target idsParsing / safety
unregister_all_blockingmisses_register_later_table(core: fix UAF in unregister_all_blocking when registrations were deferred #2876)std::stoiterminate()on autopilot-supplied metadata URIfopenresult before use; OOB read on non-terminatedPARAM_EXT_SETgetpwuid()guard; trailing-NUL fix (core: fix Android cache directory path null byte handling #2899); port/baud trailing garbage;inet_ntopreturn checkRequest-message / mission / libmav
MavlinkRequestMessage::handle_any_message_system_idson the libmav receive path; ignore duplicate/out-of-order mission itemsParameter server
PARAM_ERRORfor missing/wrong-type non-extendedPARAM_SET_all_params_mutexCore races
unregister_statustext_handler; synchronize statustext/param-changed handler lists_configurationwith a dedicated mutex; capture watchdog fields by valuePlugins
target_componentfix (mavlink_direct: fix setting target_component #2919); clear callbacks on deinit (fix: eliminate TSAN races in MavlinkDirectImpl subscribe/deinit #2869)operator<<withMAVSDK_PUBLIC(fix(mavlink_passthrough): export operator<< for Result with MAVSDK_PUBLIC #2881)start()intermittently failing withNoSetpointSet, frequent under lockstep SITLDeliberately not backported
7081e0c10.Commits are grouped by area rather than one-per-PR; happy to reshape if preferred.
CI
windows-2025runner migrated from VS 2022 to VS 2026, breaking v3's Windows builds