This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add signal.SIGSTKFLT constant (Linux)
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gdr@garethrees.org, thesamesam, vstinner
Priority: normal Keywords: patch

Created on 2021-10-28 10:31 by gdr@garethrees.org, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29266 merged gdr@garethrees.org, 2021-10-28 10:45
Messages (4)
msg405174 - (view) Author: Gareth Rees (gdr@garethrees.org) * (Python triager) Date: 2021-10-28 10:31
BACKGROUND

On Linux, "man 7 signal" includes SIGSTKFLT in its table of "various other signals":

    Signal     Value   Action  Comment
    ───────────────────────────────────────────────────────────────
    SIGSTKFLT  -,16,-   Term   Stack fault on coprocessor (unused)

Here "-,16,-" means that the signal is defined with the value 16 on x86 and ARM but not on Alpha, SPARC or MIPS. I believe that the intention was to use SIGSTKFLT for stack faults on the x87 math coprocessor, but this was either removed or never implemented, so that the signal is defined in /usr/include/signal.h but not used by the Linux kernel.


USE CASE

SIGSTKFLT is one of a handful of signals that are not used by the kernel, so that user-space programs are free to use it for their own purposes, for example for inter-thread or inter-process pre-emptive communication.

Accordingly, it would be nice if the name SIGSTKFLT were available in the Python signal module on the platforms where the signal is available, for use and reporting in these cases.
msg406460 - (view) Author: Gareth Rees (gdr@garethrees.org) * (Python triager) Date: 2021-11-17 09:42
Tagging vstinner as you have touched Modules/signalmodule.c a few times in the last year. What do you think?
msg408467 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-12-13 17:23
New changeset a62be77266b1beadd42d4952186332bc0847b7d6 by Gareth Rees in branch 'main':
bpo-45643: Add signal.SIGSTKFLT on platforms where this is defined (GH-29266)
https://github.com/python/cpython/commit/a62be77266b1beadd42d4952186332bc0847b7d6
msg408468 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-12-13 17:25
I merged your PR, thanks!

I'm curious how people use this signal :-)
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89806
2021-12-13 17:25:08vstinnersetmessages: + msg408468
2021-12-13 17:24:43vstinnersetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
title: SIGSTKFLT is missing from the signals module on Linux -> Add signal.SIGSTKFLT constant (Linux)
2021-12-13 17:23:07vstinnersetmessages: + msg408467
2021-11-17 09:42:52gdr@garethrees.orgsetnosy: + vstinner
messages: + msg406460
2021-10-29 16:13:07thesamesamsetnosy: + thesamesam
2021-10-28 10:45:25gdr@garethrees.orgsetkeywords: + patch
stage: patch review
pull_requests: + pull_request27529
2021-10-28 10:31:03gdr@garethrees.orgcreate