Skip to content

multiprocessing package incompatible with PyObjC #57767

Closed

Description

@mrmekon
mannequin
BPO 13558
Nosy @ronaldoussoren, @ned-deily
Superseder
  • bpo-8713: multiprocessing needs option to eschew fork() under Linux
  • Files
  • threadtest3.py: Example of multiprocessing failing with PyObjC
  • 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 = 'https://github.com/ronaldoussoren'
    closed_at = <Date 2012-01-04.03:34:27.530>
    created_at = <Date 2011-12-08.20:26:13.579>
    labels = ['OS-mac', 'type-bug']
    title = 'multiprocessing package incompatible with PyObjC'
    updated_at = <Date 2012-01-04.03:34:27.528>
    user = 'https://bugs.python.org/mrmekon'

    bugs.python.org fields:

    activity = <Date 2012-01-04.03:34:27.528>
    actor = 'ned.deily'
    assignee = 'ronaldoussoren'
    closed = True
    closed_date = <Date 2012-01-04.03:34:27.530>
    closer = 'ned.deily'
    components = ['macOS']
    creation = <Date 2011-12-08.20:26:13.579>
    creator = 'mrmekon'
    dependencies = []
    files = ['23884']
    hgrepos = []
    issue_num = 13558
    keywords = []
    message_count = 3.0
    messages = ['149051', '149053', '150580']
    nosy_count = 3.0
    nosy_names = ['ronaldoussoren', 'ned.deily', 'mrmekon']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '8713'
    type = 'behavior'
    url = 'https://bugs.python.org/issue13558'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    Activity

    1. mrmekon commented on Dec 8, 2011

      mrmekonmannequin
      MannequinAuthor

      The multiprocessing package appears to spawn a new process by calling only fork(). Apple's CoreFoundation libraries (and possibly more, I do not know the full extent) *require* new processes to be spawned with the full fork()+exec*() combo.

      When using PyObjC to access native Mac libraries, Python's multithreading library is not usable. The error thrown is:

      ------------------------
      The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
      Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.
      ------------------------

      Test code: https://gist.github.com/1448398

    2. ned-deily commented on Dec 8, 2011

      @ned-deily
      Member

      (Reference original discussion in pyobjc-dev mailing list archived here: http://comments.gmane.org/gmane.comp.python.pyobjc.devel/5965)

    3. ned-deily commented on Jan 4, 2012

      @ned-deily
      Member

      bpo-8713 proposes adding the option of using processes for multiprocessing rather than bare forks. Let's consolidate this issue with that one.

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Labels

    OS-mactype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions