Skip to content

board show/list crash on Python 3.14 when a depends_on is deeply nested, and show a damaged depends_on as none #310

Open

Description

@memtomem

What happens

board._load_list renders a stored depends_on (and inputs/outputs) for every board read (Board.get, Board.list, board show, board list, the dashboard, the gateway board_* tools):

def _load_list(raw: str) -> list[str]:
    try:
        v = json.loads(raw)
    except (ValueError, TypeError, RecursionError):
        return []
    return [str(x) for x in v] if isinstance(v, list) else []

Two problems, both on damaged rows only (reaching them needs a direct board.db edit):

  1. Crash on Python 3.14. On 3.12, json.loads of a 100000-deep [[[…]]] raises RecursionError, which is caught. On 3.14 it returns the nested list, and str(x) then overflows outside the try:

    Python json.loads _load_list
    3.12 RecursionError (caught → []) []
    3.14.4 returns the list RecursionError: Stack overflow (used 16352 kB) while getting the repr of an object

    The error is not a BoardError, so readers that degrade on BoardError (the gateway, the TUI's limited mode) do not catch it. CI's ubuntu 3.14 job hit this through Board.get in a test for the dispatch fix (fix: skip a damaged board dependency and bound user-repo git and preflight output #309).

  2. A damaged depends_on is shown as no dependencies. [] for unreadable input means board show says the item has no dependencies, while next_runnable (since fix: skip a damaged board dependency and bound user-repo git and preflight output #309) treats the same row as unsatisfied and skips it with a warning. The item then looks dispatchable and never runs, and the display gives no hint why.

Possible fix

Have one parser decide what a dependency list is (board._parse_deps from #309 accepts only a JSON list of strings, and is safe on 3.14 because it never reprs the elements), and let the display say "unreadable" instead of rendering nothing. inputs/outputs share _load_list and need the same 3.14 guard.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions