René's URL Explorer Experiment


Title: Off-by-one error in _winapi.WaitForMultipleObjects · Issue #94242 · python/cpython · GitHub

Open Graph Title: Off-by-one error in _winapi.WaitForMultipleObjects · Issue #94242 · python/cpython

X Title: Off-by-one error in _winapi.WaitForMultipleObjects · Issue #94242 · python/cpython

Description: Bug report _winapi_WaitForMultipleObjects_impl in _winapi.c creates an array of MAXIMUM_WAIT_OBJECTS handles but then arbitrarily enforces a cap of MAXIMUM_WAIT_OBJECTS - 1 handles. This is incorrect. WaitForMultipleObjects is clearly do...

Open Graph Description: Bug report _winapi_WaitForMultipleObjects_impl in _winapi.c creates an array of MAXIMUM_WAIT_OBJECTS handles but then arbitrarily enforces a cap of MAXIMUM_WAIT_OBJECTS - 1 handles. This is incorre...

X Description: Bug report _winapi_WaitForMultipleObjects_impl in _winapi.c creates an array of MAXIMUM_WAIT_OBJECTS handles but then arbitrarily enforces a cap of MAXIMUM_WAIT_OBJECTS - 1 handles. This is incorre...

Opengraph URL: https://github.com/python/cpython/issues/94242

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Off-by-one error in _winapi.WaitForMultipleObjects","articleBody":"**Bug report**\r\n\r\n_winapi_WaitForMultipleObjects_impl in _winapi.c creates an array of MAXIMUM_WAIT_OBJECTS handles but then arbitrarily enforces a cap of MAXIMUM_WAIT_OBJECTS - 1 handles. This is incorrect. WaitForMultipleObjects is clearly documented as being able to handle MAXIMUM_WAIT_OBJECTS (64) handles. This simple C++ sample code demonstrates this:\r\n\r\n#include \u003cstdio.h>\r\n#include \u003cwindows.h>\r\n\r\n#include \u003cvector>\r\n\r\nint main(int argc, char* argv[]) {\r\n  for (DWORD count = 60; count \u003c 66; ++count) {\r\n    printf(\"About to wait on %d handles.\\n\", count);\r\n    std::vector\u003cHANDLE> handles(count);\r\n    for (int i = 0; i \u003c count; ++i)\r\n      handles[i] = CreateEventW(nullptr, FALSE, TRUE, nullptr);\r\n    DWORD wait_result = WaitForMultipleObjects(count, handles.data(), TRUE, INFINITE);\r\n    if (wait_result == WAIT_OBJECT_0)\r\n      printf(\"  Wait satisfied by object 0.\\n\");\r\n    else if (wait_result == WAIT_FAILED)\r\n      printf(\"  Wait failed.\\n\");\r\n    else\r\n      printf(\"  Result was %lu.\\n\", wait_result);\r\n    for (int i = 0; i \u003c count; ++i)\r\n      CloseHandle(handles[i]);\r\n  }\r\n}\r\n\r\nThis error also shows up here:\r\nhttps://github.com/python/cpython/commit/39889864c09741909da4ec489459d0197ea8f1fc#diff-eb5cd13d65d2f215d8dc0d95eb1a1341ff69b226ac56ec6099e39582edecc8cfR219\r\nand here:\r\nhttps://github.com/python/cpython/commit/39889864c09741909da4ec489459d0197ea8f1fc#diff-84a955ea642d41d9f164e9f94499d8eb33c357ec7f4362a341951f6f67ab21a1R117\r\n\r\nNote that this is in addition to the off-by-one error that was tracked by this issue:\r\nhttps://github.com/python/cpython/issues/84444\r\n\r\nThat is, there used to be an off-by-two error (maximum of 60 processes could be waited on) and now there is an off-by-one error (maximum of 61 processes can be waited on). In Python 3.8.10 the limit is still 60, but in Python 3.9 the limit is (as far as I can tell) 61. It should be 62.\r\n\r\n**Your environment**\r\n\r\nPython 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32\r\nWindows 10\r\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-135537\n* gh-156905\n* gh-156906\n* gh-156907\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/randomascii","@type":"Person","name":"randomascii"},"datePublished":"2022-06-24T20:15:58Z","url":"https://github.com/python/cpython/issues/94242"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a1a138de-dab7-ec73-6be8-0d5446226cc3
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id87FC:2679E9:321E30C:42EB09B:6B01F762
html-safe-nonce2aed5f9981b24e5e26a857658c8373d9357ef69240c416008be134b55c57be80
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0ZDOjI2NzlFOTozMjFFMzBDOjQyRUIwOUI6NkIwMUY3NjIiLCJ2aXNpdG9yX2lkIjoiNTk5MzgxMTMxNTAyODc4NDk5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6ee5cb8d03e4a85d99ff40e30d15077fd47b8d3044f22167170b73c76fd8ad09
hovercard-subject-tagissue:1284148109
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/94242/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3af9980438ac8b1e940d2ac1c61070ac4964e16b2c4b4656cf566d26abe95f0a/python/cpython/issues/94242
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3af9980438ac8b1e940d2ac1c61070ac4964e16b2c4b4656cf566d26abe95f0a/python/cpython/issues/94242
og:image:altBug report _winapi_WaitForMultipleObjects_impl in _winapi.c creates an array of MAXIMUM_WAIT_OBJECTS handles but then arbitrarily enforces a cap of MAXIMUM_WAIT_OBJECTS - 1 handles. This is incorre...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerandomascii
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/94242#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F94242
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F94242
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/94242
Reloadhttps://github.com/python/cpython/issues/94242
Reloadhttps://github.com/python/cpython/issues/94242
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/94242
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/94242
Off-by-one error in _winapi.WaitForMultipleObjectshttps://github.com/python/cpython/issues/94242#top
3.10 (EOL)end of lifehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.10%20(EOL)%22
3.11only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.11%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
OS-windowshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-windows%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/randomascii
randomasciihttps://github.com/randomascii
on Jun 24, 2022https://github.com/python/cpython/issues/94242#issue-1284148109
3988986#diff-eb5cd13d65d2f215d8dc0d95eb1a1341ff69b226ac56ec6099e39582edecc8cfR219https://github.com/python/cpython/commit/39889864c09741909da4ec489459d0197ea8f1fc#diff-eb5cd13d65d2f215d8dc0d95eb1a1341ff69b226ac56ec6099e39582edecc8cfR219
3988986#diff-84a955ea642d41d9f164e9f94499d8eb33c357ec7f4362a341951f6f67ab21a1R117https://github.com/python/cpython/commit/39889864c09741909da4ec489459d0197ea8f1fc#diff-84a955ea642d41d9f164e9f94499d8eb33c357ec7f4362a341951f6f67ab21a1R117
#84444https://github.com/python/cpython/issues/84444
gh-94242: Clarify comments for _MAX_WINDOWS_WORKERS in concurrent.futures.process #135537https://github.com/python/cpython/pull/135537
[3.15] gh-94242: Clarify comments for _MAX_WINDOWS_WORKERS in concurrent.futures.process (GH-135537) #156905https://github.com/python/cpython/pull/156905
[3.14] gh-94242: Clarify comments for _MAX_WINDOWS_WORKERS in concurrent.futures.process (GH-135537) #156906https://github.com/python/cpython/pull/156906
[3.13] gh-94242: Clarify comments for _MAX_WINDOWS_WORKERS in concurrent.futures.process (GH-135537) #156907https://github.com/python/cpython/pull/156907
randomasciihttps://github.com/randomascii
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Jun 24, 2022https://github.com/python/cpython/issues/94242#event-6876596595
https://github.com/eryksun
eryksunhttps://github.com/eryksun
on Jun 24, 2022https://github.com/python/cpython/issues/94242#issuecomment-1165989548
https://github.com/randomascii
randomasciihttps://github.com/randomascii
on Jun 24, 2022https://github.com/python/cpython/issues/94242#issuecomment-1165991377
eryksunhttps://github.com/eryksun
OS-windowshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-windows%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
3.11only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.11%22
3.10 (EOL)end of lifehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.10%20(EOL)%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
on Jun 26, 2022https://github.com/python/cpython/issues/94242#event-6879621143
https://github.com/eryksun
eryksunhttps://github.com/eryksun
on Jun 26, 2022https://github.com/python/cpython/issues/94242#issuecomment-1166388571
Lib/concurrent/futures/process.pyhttps://github.com/python/cpython/blob/v3.11.0b3/Lib/concurrent/futures/process.py#L110-L114
randomasciihttps://github.com/randomascii
on Jun 26, 2022https://github.com/python/cpython/issues/94242#event-6879785249
Correct calculation of _MAX_WINDOWS_WORKERShttps://github.com/randomascii/cpython/commit/bea3a34cbe37a131febae34394a41458078f1a82
bea3a34https://github.com/randomascii/cpython/commit/bea3a34cbe37a131febae34394a41458078f1a82
https://github.com/randomascii
randomasciihttps://github.com/randomascii
on Jun 26, 2022https://github.com/python/cpython/issues/94242#issuecomment-1166419643
Lib/concurrent/futures/process.pyhttps://github.com/python/cpython/blob/v3.11.0b3/Lib/concurrent/futures/process.py#L110-L114
chris-eiblhttps://github.com/chris-eibl
on Sep 3, 2026https://github.com/python/cpython/issues/94242#event-30504174967
gh-94242: Clarify comments for _MAX_WINDOWS_WORKERS in concurrent.fut…https://github.com/python/cpython/commit/c8ea8676d931a3b42a428123070628f9ba8390db
gh-94242https://github.com/python/cpython/issues/94242
c8ea867https://github.com/python/cpython/commit/c8ea8676d931a3b42a428123070628f9ba8390db
[3.14] gh-94242: Clarify comments for _MAX_WINDOWS_WORKERS in concurr…https://github.com/python/cpython/commit/74c1e1ec9539680206571097b92c099d0693dbdc
gh-94242https://github.com/python/cpython/issues/94242
74c1e1ehttps://github.com/python/cpython/commit/74c1e1ec9539680206571097b92c099d0693dbdc
[3.13] gh-94242: Clarify comments for _MAX_WINDOWS_WORKERS in concurr…https://github.com/python/cpython/commit/e4238e6b785d59ba711bf00d77319abe900ec519
gh-94242https://github.com/python/cpython/issues/94242
e4238e6https://github.com/python/cpython/commit/e4238e6b785d59ba711bf00d77319abe900ec519
hugovkhttps://github.com/hugovk
on Sep 5, 2026https://github.com/python/cpython/issues/94242#event-30608450866
[3.15] gh-94242: Clarify comments for _MAX_WINDOWS_WORKERS in concurr…https://github.com/python/cpython/commit/38d54f6dc5dbb8722a4b2edce8236747ef3a99b1
gh-94242https://github.com/python/cpython/issues/94242
38d54f6https://github.com/python/cpython/commit/38d54f6dc5dbb8722a4b2edce8236747ef3a99b1
hugovkhttps://github.com/hugovk
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 5, 2026https://github.com/python/cpython/issues/94242#event-30608457012
clin1234https://github.com/clin1234
on Sep 12, 2026https://github.com/python/cpython/issues/94242#event-31023916510
pythongh-94242: Clarify comments for _MAX_WINDOWS_WORKERS in concurre…https://github.com/clin1234/cpython/commit/d5c1b0e5bcb38b6d4b4d792d23c8c04441a32fc7
pythongh-94242https://github.com/python/cpython/issues/94242
d5c1b0ehttps://github.com/clin1234/cpython/commit/d5c1b0e5bcb38b6d4b4d792d23c8c04441a32fc7
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/94242
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/94242
3.10 (EOL)end of lifehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.10%20(EOL)%22
3.11only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.11%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
OS-windowshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-windows%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.