Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiprocessing build fails on AIX - /dev/urandom (or equivalent) not found #50894

Closed
srid mannequin opened this issue Aug 4, 2009 · 9 comments
Closed

multiprocessing build fails on AIX - /dev/urandom (or equivalent) not found #50894

srid mannequin opened this issue Aug 4, 2009 · 9 comments
Labels
build The build process and cross-build extension-modules C modules in the Modules dir

Comments

@srid
Copy link
Mannequin

srid mannequin commented Aug 4, 2009

BPO 6645
Files
  • multiprocessing-urandom-fallback.patch: Patch that includes a fallback to the 'random' module if os.urandom() is not available.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2010-10-29.16:04:04.921>
    created_at = <Date 2009-08-04.19:27:31.113>
    labels = ['extension-modules', 'build']
    title = 'multiprocessing build fails on AIX - /dev/urandom (or equivalent) not found'
    updated_at = <Date 2010-10-29.16:04:04.919>
    user = 'https://bugs.python.org/srid'

    bugs.python.org fields:

    activity = <Date 2010-10-29.16:04:04.919>
    actor = 'jnoller'
    assignee = 'jnoller'
    closed = True
    closed_date = <Date 2010-10-29.16:04:04.921>
    closer = 'jnoller'
    components = ['Build', 'Extension Modules']
    creation = <Date 2009-08-04.19:27:31.113>
    creator = 'srid'
    dependencies = []
    files = ['15445']
    hgrepos = []
    issue_num = 6645
    keywords = ['patch']
    message_count = 9.0
    messages = ['91270', '91319', '91343', '95930', '101590', '105832', '119554', '119911', '119913']
    nosy_count = 3.0
    nosy_names = ['jnoller', 'srid', 'davidnarayan']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue6645'
    versions = ['Python 2.6', 'Python 3.1']

    @srid
    Copy link
    Mannequin Author

    srid mannequin commented Aug 4, 2009

    ./Modules/ld_so_aix cc_r -qlanglvl=ansi -bI:Modules/python.exp build/
    temp.aix-5.1-2.6/home/apy/rrun/build/activ
    epython-DEV/build/py2_6_2-aix-powerpc-apyee26-rrun/python/Modules/
    _multiprocessing/multiprocessing.o build/temp
    .aix-5.1-2.6/home/apy/rrun/build/activepython-DEV/build/py2_6_2-aix-
    powerpc-apyee26-rrun/python/Modules/_multip
    rocessing/socket_connection.o build/temp.aix-5.1-2.6/home/apy/rrun/
    build/activepython-DEV/build/py2_6_2-aix-pow
    erpc-apyee26-rrun/python/Modules/_multiprocessing/semaphore.o -o build/
    lib.aix-5.1-2.6/_multiprocessing.so
    *** WARNING: importing extension "_multiprocessing" failed with <type
    'exceptions.NotImplementedError'>: /dev/u
    random (or equivalent) not found

    @srid srid mannequin added build The build process and cross-build extension-modules C modules in the Modules dir labels Aug 4, 2009
    @jnoller
    Copy link
    Mannequin

    jnoller mannequin commented Aug 5, 2009

    Without access to an AIX machine, and even with it (I'm not an AIX guy by
    any stretch) it's going to be virtually impossible for me to fix this. A
    patch would be appreciated.

    @srid
    Copy link
    Mannequin Author

    srid mannequin commented Aug 6, 2009

    I suppose multiprocessing invokes os.random somewhere. And os.random
    fails on AIX for obvious reasons:

    >>> os.urandom(10)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/tmp/srid/ActivePythonEE-2.6.2.3-aix-powerpc64/i/lib/python2.6/
    os.py", line 755, in urandom
        raise NotImplementedError("/dev/urandom (or equivalent) not found")
    NotImplementedError: /dev/urandom (or equivalent) not found
    >>> 

    Why should multiprocessing require urandom at all? Can't it fallback
    to os.random, if os.urandom is unavailable?

    try:
    os.urandom(10)
    except NotImplementedError:
    urandom = os.urandom
    else:
    urandom = os.random

    @davidnarayan
    Copy link
    Mannequin

    davidnarayan mannequin commented Dec 3, 2009

    This is a patch that I have used on AIX. The idea for this patch came
    from uuid.py. This patch was created against Python 2.6.4.

    @srid
    Copy link
    Mannequin Author

    srid mannequin commented Mar 23, 2010

    This also breaks pydoc on AIX (Python 2.6.5).

    help> modules pydoc

    Here is a list of matching modules. Enter any module name to get more help.

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/qatest/APy/lib/python2.6/site.py", line 438, in __call__
        return pydoc.help(*args, **kwds)
      File "/home/qatest/APy/lib/python2.6/pydoc.py", line 1722, in __call__
        self.interact()
      File "/home/qatest/APy/lib/python2.6/pydoc.py", line 1740, in interact
        self.help(request)
      File "/home/qatest/APy/lib/python2.6/pydoc.py", line 1760, in help
        self.listmodules(split(request)[1])
      File "/home/qatest/APy/lib/python2.6/pydoc.py", line 1865, in listmodules
        apropos(key)
      File "/home/qatest/APy/lib/python2.6/pydoc.py", line 1965, in apropos
        ModuleScanner().run(callback, key)
      File "/home/qatest/APy/lib/python2.6/pydoc.py", line 1930, in run
        for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
      File "/home/qatest/APy/lib/python2.6/pkgutil.py", line 110, in walk_packages
        __import__(name)
      File "/home/qatest/APy/lib/python2.6/multiprocessing/__init__.py", line 63, in <module>
        from multiprocessing.process import Process, current_process, active_children
      File "/home/qatest/APy/lib/python2.6/multiprocessing/process.py", line 286, in <module>
        _current_process = _MainProcess()
      File "/home/qatest/APy/lib/python2.6/multiprocessing/process.py", line 283, in __init__
        self._authkey = AuthenticationString(os.urandom(32))
      File "/home/qatest/APy/lib/python2.6/os.py", line 756, in urandom
        raise NotImplementedError("/dev/urandom (or equivalent) not found")
    NotImplementedError: /dev/urandom (or equivalent) not found

    @srid
    Copy link
    Mannequin Author

    srid mannequin commented May 15, 2010

    Looks like this has been fixed, at least on Python trunk (2.7).

    @jnoller
    Copy link
    Mannequin

    jnoller mannequin commented Oct 25, 2010

    Sridhar can you confirm if this is still a problem on 3.2?

    @srid
    Copy link
    Mannequin Author

    srid mannequin commented Oct 29, 2010

    No, this is not an issue for me on Python 3.2 and AIX 5.1.

    @jnoller
    Copy link
    Mannequin

    jnoller mannequin commented Oct 29, 2010

    Closing per Sridhar

    @jnoller jnoller mannequin closed this as completed Oct 29, 2010
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants