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 module builds incorrectly when POSIX semaphores are disabled #65903

Closed
Arfrever mannequin opened this issue Jun 10, 2014 · 4 comments
Closed

_multiprocessing module builds incorrectly when POSIX semaphores are disabled #65903

Arfrever mannequin opened this issue Jun 10, 2014 · 4 comments
Labels
build The build process and cross-build easy extension-modules C modules in the Modules dir

Comments

@Arfrever
Copy link
Mannequin

Arfrever mannequin commented Jun 10, 2014

BPO 21704
Nosy @koobs
Files
  • freebsd-python34.log
  • 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 2014-07-29.14:38:12.596>
    created_at = <Date 2014-06-10.10:33:24.139>
    labels = ['extension-modules', 'easy', 'build']
    title = '_multiprocessing module builds incorrectly when POSIX semaphores are disabled'
    updated_at = <Date 2014-08-25.06:56:07.291>
    user = 'https://bugs.python.org/Arfrever'

    bugs.python.org fields:

    activity = <Date 2014-08-25.06:56:07.291>
    actor = 'koobs'
    assignee = 'sbt'
    closed = True
    closed_date = <Date 2014-07-29.14:38:12.596>
    closer = 'Arfrever'
    components = ['Extension Modules']
    creation = <Date 2014-06-10.10:33:24.139>
    creator = 'Arfrever'
    dependencies = []
    files = ['36464']
    hgrepos = []
    issue_num = 21704
    keywords = ['patch', 'easy']
    message_count = 4.0
    messages = ['220162', '224199', '224227', '225868']
    nosy_count = 5.0
    nosy_names = ['jnoller', 'Arfrever', 'python-dev', 'sbt', 'koobs']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue21704'
    versions = ['Python 3.4', 'Python 3.5']

    @Arfrever
    Copy link
    Mannequin Author

    Arfrever mannequin commented Jun 10, 2014

    When POSIX semaphores are disabled (e.g. by unmounting /dev/shm on a Linux system), then _multiprocessing module builds with undefined symbol _PyMp_sem_unlink:

    $ ./configure ...
    ...
    checking whether POSIX semaphores are enabled... no
    ...
    $ make
    ...
    building '_multiprocessing' extension
    creating build/temp.linux-x86_64-3.5/tmp/cpython/Modules/_multiprocessing
    x86_64-pc-linux-gnu-gcc -pthread -fPIC -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -march=core2 -O2 -fno-ident -pipe -ggdb3 -Wall -Wpointer-sign -IModules/_multiprocessing -I./Include -I. -IInclude -I/usr/local/include -I/tmp/cpython/Include -I/tmp/cpython -c /tmp/cpython/Modules/_multiprocessing/multiprocessing.c -o build/temp.linux-x86_64-3.5/tmp/cpython/Modules/_multiprocessing/multiprocessing.o
    x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--hash-style=gnu -Wl,--sort-common build/temp.linux-x86_64-3.5/tmp/cpython/Modules/_multiprocessing/multiprocessing.o -L. -L/usr/local/lib -lpython3.5m -o build/lib.linux-x86_64-3.5/_multiprocessing.cpython-35m.so
    *** WARNING: renaming "_multiprocessing" since importing it failed: build/lib.linux-x86_64-3.5/_multiprocessing.cpython-35m.so: undefined symbol: _PyMp_sem_unlink
    ...
    Following modules built successfully but were removed because they could not be imported:
    _multiprocessing

    This problem was introduced in Python 3.4. This problem is absent in older versions of Python.
    Potential fix:

    --- Modules/_multiprocessing/multiprocessing.c
    +++ Modules/_multiprocessing/multiprocessing.c
    @@ -129,5 +129,7 @@
         {"send", multiprocessing_send, METH_VARARGS, ""},
     #endif
    +#ifndef POSIX_SEMAPHORES_NOT_ENABLED
         {"sem_unlink", _PyMp_sem_unlink, METH_VARARGS, ""},
    +#endif
         {NULL}
     };

    @Arfrever Arfrever mannequin assigned sbt Jun 10, 2014
    @Arfrever Arfrever mannequin added extension-modules C modules in the Modules dir easy build The build process and cross-build labels Jun 10, 2014
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 28, 2014

    New changeset f618f6739200 by Richard Oudkerk in branch '3.4':
    Issue bpo-21704: Fix build error for _multiprocessing when semaphores
    http://hg.python.org/cpython/rev/f618f6739200

    New changeset a9637b29954d by Richard Oudkerk in branch 'default':
    Issue bpo-21704: Merge.
    http://hg.python.org/cpython/rev/a9637b29954d

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 29, 2014

    New changeset 1a00be3d79bc by Ezio Melotti in branch '3.4':
    bpo-21704: remove duplicate name in Misc/ACKS.
    http://hg.python.org/cpython/rev/1a00be3d79bc

    New changeset 723e0a7c4914 by Ezio Melotti in branch 'default':
    bpo-21704: merge with 3.4.
    http://hg.python.org/cpython/rev/723e0a7c4914

    @Arfrever Arfrever mannequin closed this as completed Jul 29, 2014
    @koobs
    Copy link

    koobs commented Aug 25, 2014

    For reference and breadcrumbs, this also occurs when:

    checking for sem_open... yes
    checking for sem_timedwait... yes
    checking for sem_getvalue... yes
    checking for sem_unlink... yes
    <snip>
    checking whether POSIX semaphores are enabled... no
    checking for broken sem_getvalue... yes
    <snip>
    *** WARNING: renaming "_multiprocessing" since importing it failed: build/lib.freebsd-8.4-RELEASE-i386-3.4/_multiprocessing.so: Undefined symbol "_PyMp_sem_unlink"

    This can occur on FreeBSD jails, among other things, when host & jail versions differ.

    Attaching full QA log from RedPorts on FreeBSD 8.4-RELEASE

    @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 easy extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant