Skip to content

Yakut Mon fails to gracefully handle empty bitmask and sparse_list #118

@moiflo033

Description

@moiflo033

When a node publishes a empty bitmask or sparse list for the on the uavcan.node.port.List publishers and subscrivbers topic, Yakut fails to handle it correctly.

  uavcan_node_port_SubjectIDList_1_0_select_mask_(&port_list.publishers);

  uavcan_node_port_SubjectIDList_1_0_select_sparse_list_(&port_list.subscribers);

  size_t size = uavcan_node_port_List_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_;
  uint8_t buf[size];

  uavcan_node_port_List_1_0_serialize_(port_list, buf, &size);

OS: Ubuntu 24.04
Yakut Version: git release 3a22dd4
Installation method: pip3

Error:

pycyphal.util._broadcast: Unhandled exception in <bound method Avatar._on_trace of Avatar(node_id=42)>: 
Traceback (most recent call last):
  File "/home/opencyphal/.venv/lib/python3.12/site-packages/pycyphal/util/_broadcast.py", line 46, in delegate
    r: typing.Union[R, Exception] = fn(*args, **kwargs)
                                    ^^^^^^^^^^^^^^^^^^^
  File "/home/opencyphal/.venv/lib/python3.12/site-packages/yakut/cmd/monitor/_model.py", line 165, in _on_trace
    handler(float(ts.monotonic), obj)
  File "/home/opencyphal/.venv/lib/python3.12/site-packages/yakut/cmd/monitor/_model.py", line 102, in _on_port_list
    self._ports.pub = expand_subjects(obj.publishers)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/opencyphal/.venv/lib/python3.12/site-packages/yakut/cmd/monitor/_model.py", line 198, in expand_subjects
    assert False
           ^^^^^
AssertionError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions