[New-bugs-announce] [issue41670] Windows and Linux execute the same code differently

Ned Batchelder report at bugs.python.org
Sun Aug 30 18:49:31 EDT 2020

New submission from Ned Batchelder <ned at nedbatchelder.com>:

Coverage.py bug reports https://github.com/nedbat/coveragepy/issues/1022 and https://github.com/nedbat/coveragepy/issues/959 demonstrate the same Python code, with the same disassembly, executing differently.

In https://discuss.python.org/t/same-python-version-different-optimizations-on-different-os/5098, Ammar Askar said:

> For any core developer who wants to look into this, based on my preliminary research this seems to be related to opcode prediction and computed GOTOS.
> If you put #define USE_COMPUTED_GOTOS 0 above https://github.com/python/cpython/blob/master/Python/ceval.c#L1033 then this issue is re-creatable on Linux/Mac.
> It seems to be an issue relating to how f_lasti is updated.

components: Interpreter Core
keywords: 3.8regression
messages: 376135
nosy: nedbat
priority: normal
severity: normal
status: open
title: Windows and Linux execute the same code differently
type: behavior
versions: Python 3.8, Python 3.9

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list