Skip to content

MAVLink STATUSTEXT chunking mishandles ID zero and exact 50-byte boundaries #29251

Open

Description

@DonLakeFlyer

Bug description

The PX4 MAVLink STATUSTEXT sender can produce chunked messages that do not follow the MAVLink STATUSTEXT chunking contract. The relevant code is src/modules/mavlink/streams/STATUSTEXT.hpp.

The MAVLink definition says id == 0 means the message is a single chunk, and a NUL anywhere in the 50-byte text field marks the last chunk.

Problems

  1. The first status text uses ID zero. _id is initialized to zero, and the sender assigns msg.id = _id++. If the first published status text is longer than 50 bytes, every chunk has ID zero. A receiver following the spec therefore treats each chunk as an independent message rather than assembling them. The same issue recurs when the 16-bit ID wraps to zero.

  2. An exact multiple of 50 bytes has no terminating chunk. The sender copies full 50-byte chunks. When the final remainder is exactly 50 bytes, it sends that full chunk and breaks because text_size <= max_chunk_size; it does not send a following NUL-terminated chunk. Receivers cannot tell that the sequence is complete and may eventually time out or report a missing chunk. For example, a 100-byte message is sent as chunks 0 and 1, both full-width, with no NUL in either chunk.

Expected behavior

  • Chunked messages use a nonzero id for every chunk, including across ID wraparound.
  • The final chunk contains a NUL in the text field. For a message whose length is an exact multiple of 50 bytes, send an empty NUL-terminated chunk after the full chunks (or otherwise ensure the last transmitted chunk contains a NUL without dropping message bytes).

How to reproduce

Exercise the STATUSTEXT sender with a message longer than 50 bytes as the first status text, and with text lengths of exactly 50, 100, or 150 bytes. Inspect id, chunk_seq, and the raw 50-byte text field in the transmitted packets.

I checked this against the MAVLink STATUSTEXT definition in the PX4 tree and the local PX4 sender implementation.

Activity

  1. added
    status:needs-triageAuto-assigned to new issues and removed after maintainers review it and assign the specific label.
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:needs-triageAuto-assigned to new issues and removed after maintainers review it and assign the specific label.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions