Skip to content

automaton: raise on Windows WAIT_FAILED - #5238

Merged
gpotter2 merged 5 commits into
secdev:masterfrom
polybassa:fix-windows-wait-failed
Nov 12, 2026
Merged

gpotter2 merged 5 commits into
secdev:masterfrom
polybassa:fix-windows-wait-failed

Conversation

@polybassa

Copy link
Copy Markdown
Contributor

On Windows, ctypes can return WAIT_FAILED as -1, so select_objects() may treat it as an input index and report an unreadable object as ready. Raise the Windows error for failed waits and close temporary Winsock events before propagating it.

AI-Assisted: yes (GPT-6)

ctypes may return WAIT_FAILED as -1, which select_objects() treats as an input index and can report the last object ready. Raise the Windows error and close temporary Winsock events on failed waits.

AI-Assisted: yes (GPT-6)
@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.17%. Comparing base (57dd077) to head (13837ed).
⚠️ Report is 40 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5238      +/-   ##
==========================================
- Coverage   80.55%   80.17%   -0.38%     
==========================================
  Files         375      375              
  Lines       98399    98727     +328     
==========================================
- Hits        79261    79156     -105     
- Misses      19138    19571     +433     
Files with missing lines Coverage Δ
scapy/automaton.py 81.64% <100.00%> (+0.15%) ⬆️

... and 57 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@polybassa

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

AI-Assisted: yes (OpenCode, GPT-6.1)
@gpotter2

Copy link
Copy Markdown
Member

I think you could implement this as a big try/finally that calls the for .. in created loop that's already at the bottom

Close temporary Winsock events in a finally block, including when input setup fails.

Review: secdev#5238 (comment)

AI-Assisted: yes (GPT-6)
@polybassa

Copy link
Copy Markdown
Contributor Author

I think you could implement this as a big try/finally that calls the for .. in created loop that's already at the bottom

@gpotter2 Done

Comment thread test/windows.uts Resolved
Comment thread test/windows.uts Resolved
@gpotter2
gpotter2 merged commit 1c69315 into secdev:master Nov 12, 2026
1 of 2 checks passed
@gpotter2

Copy link
Copy Markdown
Member

Thanks for finding and fixing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants