
report at bugs
Jul 13, 2009, 10:11 AM
Post #1 of 3
(308 views)
Permalink
|
|
[issue6476] MSVCRT's spawnve/spawnvpe are not thread safe
|
|
New submission from Jose Fonseca <jose.r.fonseca [at] gmail>: MSVCRT's implementation of _spawnve, _spawnvpe, or any version that takes an environ as paramater is not thread-safe, because it stores a temporary environment string into a global variable. _spawnve, _spawnvpe, and friends call a function named _cenvarg which concatenate the environment strings into a global variable called _aenvptr, which gets free'd and zero'd after each invocation. This was causing random build failures in scons when parallel build (-j) was enabled. The sample application evidences this problem. It also includes a simple workaround in python, by acquiring a global lock around os.spawnve, and simulating P_WAIT with P_NOWAIT to avoid holding the global lock while the child process is running. I believe something along these lines should be done for CPython on Windows. ---------- components: Interpreter Core files: spawnve.py messages: 90495 nosy: jfonseca severity: normal status: open title: MSVCRT's spawnve/spawnvpe are not thread safe type: crash versions: Python 2.4, Python 2.5, Python 2.6 Added file: http://bugs.python.org/file14495/spawnve.py _______________________________________ Python tracker <report [at] bugs> <http://bugs.python.org/issue6476> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
|