This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Namespace pollution from multiprocessing
Type: Stage: needs patch
Components: Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jnoller Nosy List: Rhamphoryncus, asksol, benjamin.peterson, christian.heimes, jnoller, loewis, roudkerk
Priority: low Keywords:

Created on 2008-06-12 19:57 by Rhamphoryncus, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg68078 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2008-06-12 19:57
All these in multiprocessing.h are lacking suitable py/_py/Py/_Py/PY/_PY
prefixes:

PyObject *mp_SetError(PyObject *Type, int num);
extern PyObject *pickle_dumps;
extern PyObject *pickle_loads;
extern PyObject *pickle_protocol;
extern PyObject *BufferTooShort;
extern PyTypeObject SemLockType;
extern PyTypeObject ConnectionType;
extern PyTypeObject PipeConnectionType;
extern HANDLE sigint_event;

Additionally, win32_functions.c exposes Win32Type and
create_win32_namespace.

semaphore.c has sem_timedwait_save.

multiprocessing.c has ProcessError.
msg68080 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-06-12 20:18
Is this really that much of an issue? multiprocessing lives in it's own
directory and isn't part of the Python public API.
msg68110 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2008-06-13 00:15
The directory is irrelevant.  C typically uses a flat namespace for
symbols.  If python loads this library it will conflict with any other
libraries using the same name.  This has happened numerous times in the
past, so there's no questioning the correct practises.
msg68131 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-06-13 07:21
Alternatively, I think the _multiprocessing module should be rewritten
to use a single C file only, and make all symbols except its init
function static.

I agree with Adam that the current code needs to be fixed, one way or
the other.
msg192661 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-07-08 15:32
Python 3.4 no longer exports symbols without a Py or _Py prefix:

$ nm -p build/lib.linux-x86_64-3.4-pydebug/_multiprocessing.cpython-34dm.so | sed -n "/ [TDB] /s/.* //p" | sort
__bss_start
_edata
_end
_fini
_init
PyInit__multiprocessing
_PyMp_SemLockType
_PyMp_SetError

Python 3.3 still does but I don't like to modify the ABI in a patch release.

$ nm -p build/lib.linux-x86_64-3.3-pydebug/_multiprocessing.cpython-33dm.so | sed -n "/ [TDB] /s/.* //p" | sort
__bss_start
BufferTooShort
_edata
_end
_fini
_init
mp_SetError
ProcessError
PyInit__multiprocessing
SemLockType
History
Date User Action Args
2022-04-11 14:56:35adminsetgithub: 47343
2013-07-08 15:32:48christian.heimessetstatus: open -> closed

nosy: + christian.heimes
messages: + msg192661

resolution: fixed
2010-08-31 11:01:57asksolsetnosy: + asksol

stage: needs patch
2009-01-22 19:14:37jnollersetpriority: low
2009-01-21 02:27:00jnollersettitle: Namespace polution from multiprocessing -> Namespace pollution from multiprocessing
2009-01-19 16:43:35jnollersetassignee: jnoller
2008-06-13 07:21:26loewissetnosy: + loewis
messages: + msg68131
2008-06-13 00:15:20Rhamphoryncussetmessages: + msg68110
2008-06-12 20:18:07benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg68080
2008-06-12 19:59:44jnollersetnosy: + roudkerk, jnoller
2008-06-12 19:57:39Rhamphoryncuscreate