Skip to content

main is red: two pcapng crawlers emit a self-recursive _missing_ body, causing RecursionError #866

Description

@JarryShaw

main is red at e58618bdf: 12 tests fail across three files — tests/const/test_const_enum_lookup.py, tests/const/test_const_enum_no_mint.py and tests/protocols/misc/test_pcapng_unit.py (7 of the 12) — surfacing as five Python 3.10–3.14 legs plus Gate and Required checks passed. One defect, all RecursionError.

tests/const/test_const_enum_lookup.py:216: AssertionError
  pcapkit.const.pcapng.secrets_type.SecretsType(0) unexpectedly raised
  RecursionError('maximum recursion depth exceeded')

Reproduced on 946b84e83 with the tree asserted; the cycle is three frames:

const/pcapng/secrets_type.py:42  _missing_        |  return cls(value)
aenum/_enum.py:1810              __call__         |  return cls.__new__(cls, value)
aenum/_enum.py:2266              __new__          |  result = cls._missing_value_(value)
aenum/_enum.py:2319              _missing_value_  |  return cls._missing_(value)   -> repeat

Root cause. pcapkit/vendor/pcapng/record_type.py and pcapkit/vendor/pcapng/secrets_type.py render a two-line _missing_ body whose first line does not return:

miss = [
    "cls._unregistered_member(value, 'Unassigned')",
    'return cls(value)'
]

That was harmless while the first line was extend_enum(...), which registers the member so the following cls(value) found it. #861 replaced it with _unregistered_member, which deliberately does not register — so cls(value) misses again and re-enters _missing_.

Why it was latent. #861 corrected the two generated files and not the two crawlers, so #861's own CI and 70fa92010 were genuinely green (59 ok / 0 fail). e58618bdf regenerated from the stale crawlers and reintroduced it. #861's cross-review verified byte-identical regeneration for 5 sampled crawlers out of 82; these two were not sampled.

Scope is exactly 2 of 103 registries — the other 101 carry return cls._unregistered_member(...). Fix and a crawler-layer guard in the PR that follows.

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

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)constRegenerated IANA or vendor constant tables; members keep their numeric valuesfixPull requests that fix a defect (fix: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions