Bug 707382 - RFE: Make it possible to interrupt on signals
Summary: RFE: Make it possible to interrupt on signals
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: python-nss
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nathan Kinder
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-24 21:19 UTC by Miloslav Trmač
Modified: 2021-08-02 15:31 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-08-02 15:31:28 UTC
Type: ---


Attachments (Terms of Use)

Description Miloslav Trmač 2011-05-24 21:19:49 UTC
Version-Release number of selected component (if applicable):
python-nss-0.11-2.fc16.src.rpm
nspr-4.8.8-1.fc16.src.rpm

It is currently impossible to terminate a program blocked in python-nss by a signal and do a proper cleanups.


From the NSPR side, NSPR internally loops on -EINTR, ignoring the signal completely (assuming that the handler will do something), only checking the PR_Interrupt() flag on each -EINTR.

From the Python side, Python's signal handler only marks the signal as pending and does not run any Python code.

So, when a signal comes, the Python handler executes but does not affect the NSPR state, and NSPR just enters another iteration of the loop.


One possible solution would be to use Python's signal.set_wakeup_fd() (causing Python to write a byte to a specified pipe) and start a thread that only waits until data is available in that pipe and then sends PR_Interrupt() to the other threads, breaking the NSPR loop and allowing Python to handle the signal.

This would require exposing NSPR's PR_GetCurrentThread() and PR_Interrupt() through python-nss.  Do you think this makes sense?

Comment 2 Miro Hrončok 2021-08-02 15:31:28 UTC
Automation has figured out the package is retired in rawhide.

If you like it to be unretired, please open a ticket at https://pagure.io/releng/new_issue?template=package_unretirement


Note You need to log in before you can comment on or make changes to this bug.