-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
Python 3.5.2 crashers (from PyPy) #73069
Comments
As discussed on python-dev, I am creating omnibus issues from the lists of crashers, of wrong-according-to-the-docs, and of strange-behavior-only issues that I found while developing Python 3.5.2 support for PyPy. These occur with CPython 3.5.2 but most of them are likely still here in trunk. This is the issue containing the crashers. |
os.scandir() returns an iterable object that should not be used |
(C2) os.scandir() direntry objects should not have stat() called from two |
(C3) _PyGen_yf() checks the opcode at [f_lasti + 1], which is the next |
|
import sys
def f():
try:
raise ValueError # line 5
except ValueError:
print(42) # line 7
def my_trace(*args):
print(args)
if args[1] == 'line':
f = args[0]
if f.f_lineno == 5:
f.f_lineno = 7
return my_trace
sys.settrace(my_trace)
f()
sys.settrace(None) |
old_mro = type->tp_mro;
...mro_invoke()... /* might cause reentrance */
type->tp_mro = new_mro;
...
Py_XDECREF(old_mro);
|
Victor for C4. |
C5 is fixed in 3.8 by bpo-17611. |
I thiink C6 was fixed in #66924. |
@brandtbucher - is there any chance that C3(at #73069 (comment)) is still relevant? |
It looks like c3 has been fixed by gh-111354, although I don't understand that code well enough to be 100% sure. Assuming so, and if my fixes for c1 & c2 are acceptable, once they are merged all the issues will have been fixed and this can be closed. |
Reproducers for c1 & c2: c1.pyimport os
import threading
N=8
ITERATIONS=1000
def scan(iter, barrier):
barrier.wait()
for entry in iter:
pass
for _ in range(ITERATIONS):
barrier = threading.Barrier(N)
iter = os.scandir()
threads = [threading.Thread(target=scan, args=(iter, barrier)) for _ in range(N)]
for t in threads:
t.start()
for t in threads:
t.join() c2.py# Shows leaks with --with-address-sanitizer on Linux, unsure how to verify on Windows
import os
import threading
N=8
ITERATIONS=100
def stat(entry, barrier):
barrier.wait()
entry.stat()
for _ in range(ITERATIONS):
barrier = threading.Barrier(N)
iter = os.scandir()
for entry in iter:
threads = [threading.Thread(target=stat, args=(entry, barrier)) for _ in range(N)]
for t in threads:
t.start()
for t in threads:
t.join() Note these reproduce the problem with N=2 and ITERATIONS=2 on my machine, but I bumped the numbers up to stress-test under TSAN. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: