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

signal.SIGCLD alias is not available on OSX #89414

Closed
tacaswell mannequin opened this issue Sep 20, 2021 · 2 comments
Closed

signal.SIGCLD alias is not available on OSX #89414

tacaswell mannequin opened this issue Sep 20, 2021 · 2 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir OS-mac stdlib Python modules in the Lib dir

Comments

@tacaswell
Copy link
Mannequin

tacaswell mannequin commented Sep 20, 2021

BPO 45251
Nosy @ronaldoussoren, @ned-deily, @tacaswell
Files
  • osx_signal_compat.patch
  • 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 = None
    created_at = <Date 2021-09-20.22:27:22.221>
    labels = ['OS-mac', '3.9', '3.10', '3.11', 'library', 'docs']
    title = 'signal.SIGCLD alias is not available on OSX'
    updated_at = <Date 2021-09-24.23:40:59.307>
    user = 'https://github.com/tacaswell'

    bugs.python.org fields:

    activity = <Date 2021-09-24.23:40:59.307>
    actor = 'terry.reedy'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation', 'Library (Lib)', 'macOS']
    creation = <Date 2021-09-20.22:27:22.221>
    creator = 'tcaswell'
    dependencies = []
    files = ['50290']
    hgrepos = []
    issue_num = 45251
    keywords = ['patch']
    message_count = 2.0
    messages = ['402280', '402292']
    nosy_count = 4.0
    nosy_names = ['ronaldoussoren', 'ned.deily', 'docs@python', 'tcaswell']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue45251'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    Linked PRs

    @tacaswell
    Copy link
    Mannequin Author

    tacaswell mannequin commented Sep 20, 2021

    The module attribute signal.SIGCLD (https://docs.python.org/3/library/signal.html#signal.SIGCLD) is an "archaic" (quoting from the GNU C Library source) alias for signal.SIGCHLD (https://docs.python.org/3/library/signal.html#signal.SIGCHLD). signal.SIGCHLD is documented as being available on unix, and signal.SIGCLD is documented as an alias of signal.SIGCHLD.

    However, it seems that clang does not define the SIGCLD back-compatibility name [1] so the SIGCLD alias is missing on OSX (all the way to at least 2.7) because the clang headers appear to not define the SIGCLD macro and hence the logic in modulesignal.c does not find it, and hence the rest of the tooling in signal.py does not find it.

    I am not sure if the correct fix is to document that SIGCLD in only available on linux (which I am not sure is completely correct, maybe "availability is platform dependent, but definitely not on darwin"?) or to add the macro if SIGCHLD is defined and SIGCLD is missing (see attached patch)

    [1] SIGCLD is not documented in https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/signal.3.html and not the signal.h that ships with xcode

    @tacaswell tacaswell mannequin added 3.7 (EOL) end of life 3.8 (EOL) end of life 3.10 only security fixes 3.11 only security fixes 3.9 only security fixes labels Sep 20, 2021
    @tacaswell tacaswell mannequin assigned docspython Sep 20, 2021
    @tacaswell tacaswell mannequin added stdlib Python modules in the Lib dir 3.7 (EOL) end of life docs Documentation in the Doc dir 3.8 (EOL) end of life 3.10 only security fixes 3.11 only security fixes 3.9 only security fixes labels Sep 20, 2021
    @tacaswell tacaswell mannequin assigned docspython Sep 20, 2021
    @tacaswell tacaswell mannequin added stdlib Python modules in the Lib dir docs Documentation in the Doc dir labels Sep 20, 2021
    @ronaldoussoren
    Copy link
    Contributor

    The documentation for the SIG* constants also mentions:

    ----
    SIG*
    All the signal numbers are defined symbolically. For example, the hangup signal is defined as signal.SIGHUP; the variable names are identical to the names used in C programs, as found in <signal.h>. The Unix man page for ‘signal()’ lists the existing signals (on some systems this is signal(2), on others the list is in signal(7)). Note that not all systems define the same set of signal names; only those names defined by the system are defined by this module.
    ----

    This is however mentioned halfway through the list of constants. I'm not sure why this is so, IMHO it would be clearer to move the fragment I quote to the start of the module constants section.

    We shouldn't define SIGCLD on platforms that don't have this name available in their libc headers, which includes macOS. If the fragment above were moved to the start of the section no further updates would be required (IMHO).

    @terryjreedy terryjreedy removed 3.7 (EOL) end of life 3.8 (EOL) end of life labels Sep 24, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    ronaldoussoren added a commit that referenced this issue Dec 30, 2023
    Document that SIGCLD is not available on macOS
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 30, 2023
    …nGH-113580)
    
    Document that SIGCLD is not available on macOS
    (cherry picked from commit f48a1bc)
    
    Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 30, 2023
    …nGH-113580)
    
    Document that SIGCLD is not available on macOS
    (cherry picked from commit f48a1bc)
    
    Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
    ronaldoussoren added a commit that referenced this issue Dec 30, 2023
    …13580) (#113585)
    
    gh-89414: Document that SIGCLD is not available on macOS (GH-113580)
    
    Document that SIGCLD is not available on macOS
    (cherry picked from commit f48a1bc)
    
    Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
    ronaldoussoren added a commit that referenced this issue Dec 30, 2023
    …13580) (#113586)
    
    gh-89414: Document that SIGCLD is not available on macOS (GH-113580)
    
    Document that SIGCLD is not available on macOS
    (cherry picked from commit f48a1bc)
    
    Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
    kulikjak pushed a commit to kulikjak/cpython that referenced this issue Jan 22, 2024
    aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
    Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir OS-mac stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants