Skip to content

BUG - overflow in subtraction when computing missing packets #3436

Description

@tmplummer

Description of the issue

Looking at some SWAPI logs, I saw the following:

/usr/local/lib/python3.12/site-packages/imap_processing/utils.py:474: RuntimeWarning: overflow encountered in scalar subtract
(src_seq_ctr[idx + 1] - src_seq_ctr[idx] - 1) % counter_max
2026-08-09 12:36:06 - WARNING:imap_processing.utils:Found [2] gap(s) in source sequence counter for APID 1188 at [(10221, 4933), (4974, 4999)] (11119 total missing packets)

Steps to reproduce the issue

No response

Expected vs Actual behavior

No response

Code Snippet (If applicable)

Code

Additional notes, affected areas, and suggested fixes

Suggested fix is to cast the src_seq_ctr to a 32 bit integer before doing the subtraction.

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

    bugSomething isn't working

    Type

    Projects

    • Status
      Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions