[issue31119] Signal tripped flags need memory barriers

2017-08-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Backporting would be reasonable IMHO. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue31119] Signal tripped flags need memory barriers

2017-08-06 Thread STINNER Victor
STINNER Victor added the comment: Since it's described as a bug, should the change be backported to 3.6? I don't think that 2.7 has required tools to backport this change (C99, atomic types). -- ___ Python tracker

[issue31119] Signal tripped flags need memory barriers

2017-08-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've recently merged https://github.com/python/cpython/pull/2417 which might address this. If you know of a way of reproducing the (theoretical) issue outlined here, it would be nice to know if it's fixed on git master. -- nosy: +pitrou _

[issue31119] Signal tripped flags need memory barriers

2017-08-04 Thread Nathaniel Smith
Nathaniel Smith added the comment: @arigo: Technically we also need that the writes to memory are observed to happen-before the write() call on the wakeup fd, which is not something that Intel is going to make any guarantees about. But *probably* this is also safe because the kernel has to use

[issue31119] Signal tripped flags need memory barriers

2017-08-04 Thread Armin Rigo
Armin Rigo added the comment: For reference, no, it can't happen on x86 or x86-64. I've found that this simplified model actually works for reasoning about ordering at the hardware level: think about each core as a cache-less machine that always *reads* from the central RAM, but that has a de

[issue31119] Signal tripped flags need memory barriers

2017-08-04 Thread Nathaniel Smith
Nathaniel Smith added the comment: On further investigation (= a few hours staring at the ceiling last night), it looks like there's another explanation for my particular bug... which is good, because on further investigation (= a few hours squinting at google results) it looks like this proba

[issue31119] Signal tripped flags need memory barriers

2017-08-04 Thread Nathaniel Smith
New submission from Nathaniel Smith: Sometimes, CPython's signal handler (signalmodule.c:signal_handler) runs in a different thread from the main thread. On Unix this is rare but it does happen (esp. for SIGCHLD), and on Windows it happens 100% of the time. It turns out that there is a subtle