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.

Author neologix
Recipients loewis, neologix, vstinner
Date 2011-09-17.07:20:11
SpamBayes Score 5.7744877e-08
Marked as misclassified No
Message-id <1316244012.97.0.109004277803.issue12999@psf.upfronthosting.co.za>
In-reply-to
Content
While testing issue #12981, I stumbled on a problem on OpenIndiana buildbot:
"""
test test_multiprocessing crashed -- Traceback (most recent call last):
  File "/export/home/buildbot/64bits/custom.cea-indiana-amd64/build/Lib/test/regrtest.py", line 1133, in runtest_inner
    the_package = __import__(abstest, globals(), locals(), [])
  File "/export/home/buildbot/64bits/custom.cea-indiana-amd64/build/Lib/test/test_multiprocessing.py", line 38, in <module>
    from multiprocessing import util, reduction
  File "/export/home/buildbot/64bits/custom.cea-indiana-amd64/build/Lib/importlib/_bootstrap.py", line 437, in load_module
    return self._load_module(fullname)
  File "/export/home/buildbot/64bits/custom.cea-indiana-amd64/build/Lib/importlib/_bootstrap.py", line 141, in decorated
    return fxn(self, module, *args, **kwargs)
  File "/export/home/buildbot/64bits/custom.cea-indiana-amd64/build/Lib/importlib/_bootstrap.py", line 342, in _load_module
    exec(code_object, module.__dict__)
  File "/export/home/buildbot/64bits/custom.cea-indiana-amd64/build/Lib/multiprocessing/reduction.py", line 57, in <module>
    raise ImportError('pickling of connections not supported')
ImportError: pickling of connections not supported
"""

Which means that socket.CMSG_LEN isn't defined.
Now, you might wonder how this can work in the C version of multiprocessing.(sendfd|recvfd), which needs CMSG_LEN().
Here's how:
"""
#ifdef __sun
 /* The control message API is only available on Solaris      
    if XPG 4.2 or later is requested. */      
 #define _XOPEN_SOURCE 500     
 #endif
"""

And indeed:
http://fxr.watson.org/fxr/source/common/sys/socket.h?v=OPENSOLARIS#L478
"""
#if defined(_XPG4_2)
/*
 * The cmsg headers (and macros dealing with them) were made available as
 * part of UNIX95 and hence need to be protected with a _XPG4_2 define.
 */
"""

The problem is that socketmodule uses pyconfig.h defines, and _XOPEN_SOURCE isn't defined on Solaris:
http://hg.python.org/cpython/rev/7c947768b435

(it was added explicitely to Modules/_multiprocessing/multiprocessing.h for sendmsg by http://hg.python.org/cpython/rev/419901e65dd2).
So, _XOPEN_SOURCE is needed on Solaris to build socket_sendmsg and friends.
I'm not sure about the best way to proceed, since Martin certainly had good reasons to remove _XOPEN_SOURCE definition entirely on Solaris.
Should we define it only at the top of socketmodule?
History
Date User Action Args
2011-09-17 07:20:13neologixsetrecipients: + neologix, loewis, vstinner
2011-09-17 07:20:12neologixsetmessageid: <1316244012.97.0.109004277803.issue12999@psf.upfronthosting.co.za>
2011-09-17 07:20:12neologixlinkissue12999 messages
2011-09-17 07:20:11neologixcreate