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

API function PySignal_SetWakeupFd is not exported and unusable #89364

Open
cy mannequin opened this issue Sep 15, 2021 · 2 comments
Open

API function PySignal_SetWakeupFd is not exported and unusable #89364

cy mannequin opened this issue Sep 15, 2021 · 2 comments
Labels
3.9 only security fixes topic-C-API type-bug An unexpected behavior, bug, or error

Comments

@cy
Copy link
Mannequin

cy mannequin commented Sep 15, 2021

BPO 45201
Nosy @vstinner

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-15.06:03:15.175>
labels = ['expert-C-API', 'type-bug', '3.9']
title = 'API function PySignal_SetWakeupFd is not exported and unusable'
updated_at = <Date 2021-09-29.08:18:20.534>
user = 'https://bugs.python.org/cy'

bugs.python.org fields:

activity = <Date 2021-09-29.08:18:20.534>
actor = 'vstinner'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['C API']
creation = <Date 2021-09-15.06:03:15.175>
creator = 'cy'
dependencies = []
files = []
hgrepos = []
issue_num = 45201
keywords = []
message_count = 2.0
messages = ['401810', '402828']
nosy_count = 2.0
nosy_names = ['vstinner', 'cy']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue45201'
versions = ['Python 3.9']

@cy
Copy link
Mannequin Author

cy mannequin commented Sep 15, 2021

I want to wait on curl_multi_wait which messes up python's signal handling since libcurl doesn't know to exit the polling loop on signal. I created a pipe that curl could read from when python registered a signal, and PySignal_SetWakeupFd would write to the pipe, thus letting curl leave its polling loop, letting my C module return an exception condition.

Except PySignal_SetWakeupFd cannot be used.

In Modules/signalmodule.c, it says:

    int
    PySignal_SetWakeupFd(int fd)

when it should say:

    PyAPI_FUNC(int)
    PySignal_SetWakeupFd(int fd)

This probably isn't a problem for most, since gcc has visiblity=public by default, but I guess Gentoo's process for building python sets -fvisibility=hidden, so I can't access it, and all Microsoft users should have no access to PySignal_SetWakeupFd, since Microsoft does have hidden visibility by default.

@cy cy mannequin added 3.9 only security fixes topic-C-API type-bug An unexpected behavior, bug, or error labels Sep 15, 2021
@vstinner
Copy link
Member

See also bpo-45316: [C API] Functions not exported with PyAPI_FUNC().

@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
3.9 only security fixes topic-C-API type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant