Skip to content

fix(benchmark): a pcap engine's loader OSError kills the whole environment on macOS and Windows #2129

Closed

Description

@JarryShaw

On macOS and Windows runners, the benchmark's 3.10 and 3.11 pcap_ct environments die before measuring anything. The cause is that examples/benchmark/benchmark.py's _unavailable doesn't recognise the loader errors pcap-ct raises there. Seen in the #2128 runner-comparison run, 40047570595.

The error per runner:

  • macOS: OSError: dlopen(libc.so.6 …). pcap-ct's libpcap loader looks for a Linux libc.
  • Windows: OSError: Cannot find npcap/wpcap.dll, because Chocolatey's Wireshark doesn't install Npcap.

Why it kills the environment:

  • _unavailable turns an OSError into an explained "not measured" reason only when its message contains libpcap.
  • These two messages don't, so preflight("pypcap") in the pcap_ct environment re-raises and the whole environment exits.
  • On 3.12+, the not-installable note answers the pypcap check before any import, so those environments survive.

Effects:

  • The 3.10/3.11 columns rest on half their samples.
  • The reason recorded for pcap_ct is "package is not installed" rather than the real loader error.

Fix: treat an OSError raised while importing or opening a pcap engine as unavailable, with its message as the reason, whatever the wording. The engine then becomes an explained row, and the environment carries on with the other engines. Add a test with each of the two messages.

Activity

  1. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 24, 2026
  2. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 24, 2026
  3. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 24, 2026
  4. added this to the PyPCAPKit v1.5 milestone on Oct 26, 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

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions