Comments (6)
@colesbury @swtaarrs @corona10
from cpython.
@swtaarrs, I don't think you need to annotate PyMutex
. I think it's more likely something like sem_clockwait
not being supported by TSan.
from cpython.
Oh, I missed that. I'm curious if annotations for PyMutex
fix this, but it looks to me like a data race:
T1: Writes pending->calls_to_do
(nonatomic, but holding pending->mutex
);
T2: Reads pending->calls_to_do
(atomic, but not holding pending->mutex
);
Either T1 needs an atomic write or T2 needs to hold pending->mutex
.
from cpython.
(heh, I saw your comment pop up as I clicked to post mine. sounds like we agree!)
TSAN still doesn't like the nonatomic increment even with PyMutex
annotated (I verified that the annotations are working, since the error message now says that it holds the relevant PyMutex
during the bad write).
I'm going back to my initial thought was that this is a real data race. We shouldn't be mixing nonatomic writes with atomic reads, even if it works out in practice. Changing the increment and decrement of pending->calls_to_do
to atomic gets rid of the error, and I wouldn't expect it to be a performance issue.
from cpython.
It looks like the root of the issue here is that tsan doesn't know about PyMutex
, which is used to protect the data member being mutated here. I believe I've found the set of function calls used to annotate mutex implementations, so I'll work on adding those to PyMutex
.
from cpython.
@colesbury That's already in main. Any other ideas? The annotations look pretty straightforward so I'll give them a try.
from cpython.
Related Issues (20)
- Zip extract fails for zips created with Windows HOT 4
- Function version numbers do not obey necessary invariants HOT 5
- Define the interface of a CodeLike object HOT 1
- Python 3.13a5 fails to build on AIX HOT 2
- Sync with importlib_metadata for Python 3.13 HOT 1
- Python <=3.9 segmentation fault in code snippet HOT 4
- Adding read/readline() after write appends to EOF, not to the position
- C OrderedDict's `od_fast_nodes` allocation might be 50% larger than necessary? HOT 1
- Changed behavior of singledispatch in Python 3.12 HOT 3
- `collections.deque` freelist blocks could be chained together HOT 2
- New warnings: ``'function': conversion from 'uintptr_t' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]`` HOT 1
- Decimal.to_integral_exact() does not raise if rounding occurs HOT 2
- Major slowdown on large listcomp HOT 5
- `urllib.parse.parse_qs` behaves differenly in Python 3.9.2 compared to Python 3.9.1 HOT 6
- Subclass of `typing.Any` cannot be instantiated with arguments
- Add `isdevdrive` to `posixpath`
- pystats: Improve with JIT builds HOT 1
- pystats: #116206 (Incremental GC implementation) broke pystats build
- glob tests miss `mypipe` HOT 1
- A warning message caused by unused variable in non-debug mode HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpython.