-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Race condition in pydoc._start_server #116143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
itamaro
added a commit
to itamaro/cpython
that referenced
this issue
Feb 29, 2024
carljm
pushed a commit
that referenced
this issue
Mar 6, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 6, 2024
…116144) (cherry picked from commit 02ee475) Co-authored-by: Itamar Oren <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 6, 2024
…116144) (cherry picked from commit 02ee475) Co-authored-by: Itamar Oren <[email protected]>
This was referenced Mar 6, 2024
carljm
pushed a commit
that referenced
this issue
Mar 6, 2024
carljm
pushed a commit
that referenced
this issue
Mar 6, 2024
adorilson
pushed a commit
to adorilson/cpython
that referenced
this issue
Mar 25, 2024
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Bug description:
There's a race condition in
pydoc._start_server
- when_start_server()
returns, we should get an object with a validdocserver
attribute (set here). However, the function only checks that theserving
attribute is truthy before returning (here).The race is triggered if setting
serving
toTrue
here happens before setting thedocserver
attribute here -- we observed this happening frequently in the Cinder ASAN test suite (originally observed and fixed by @jbower).The race can be forced to happen by forcing a context switch after setting
self.serving = True
:and running the
test_pydoc.PydocServerTest.test_server
test, which would fail and hang:The race can be fixed by making sure the
docserver
attribute is also set before returning (PR incoming).CPython versions tested on:
3.8, 3.10, 3.12, CPython main branch
Operating systems tested on:
Linux, macOS
Linked PRs
The text was updated successfully, but these errors were encountered: