GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — Negative indexing in free-threading can access data that never lived at that index · Issue #130744 · python/cpython Closed as not planned Closed as not planned Copy link Labels interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug description:The place that negative indices for lists are offset currently in the free-threaded build can cause data to be returned that never actually resided at that offset (negatively speaking) if the list is modified during the access (either before or after the modification). Is this an issue? Line 3581 in 5326c27
Reproducer (it will happen eventually): import re import threading def ins1(b, l): b.wait() l.insert(0, 'potato') def get_secret(b, l): b.wait() assert l[-1] != 'super secret password' def check(funcs, *args): barrier = threading.Barrier(len(funcs)) thrds = [] for func in funcs: thrd = threading.Thread(target=func, args=(barrier, *args)) thrds.append(thrd) thrd.start() for thrd in thrds: thrd.join() if __name__ == "__main__": while True: check([ins1] + [get_secret] * 10, ['super secret password', 'tomato']) Output: CPython versions tested on:3.14 Operating systems tested on:Linux Activity
MetadataMetadataAssigneesLabelsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions | ||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |