Skip to contentSkip to conversation

signal(7) fixes

PATCH In review Dev Jain 3 participants 7 messages Jun 11, 2024 – Jun 17, 2024 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore

Dev Jain

author
#0 lore raw

v2 cover signal(7) fixes

This is a follow-up to the following, or any subsequent versions of it:
https://lore.kernel.org/all/[email protected]/

This patchset brings distinction between the set of blocked signals stored in uc_sigmask, and the actual set of blocked signals. Also, fix a wrong mention of sigprocmask(), and replace it with sigaction().

Changes in v2:
- Make the description clear and concise
- Use semantic newlines

Dev Jain (2):
signal.7: Clearly describe ucontext kernel dump to userspace signal.7: Fix wrong mention of sigprocmask

 man/man7/signal.7 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/2 signal.7: Clearly describe ucontext kernel dump to userspace

The set of blocked signals is updated from struct sigaction after the kernel dumps ucontext. Mention this to avoid misunderstanding.

---
 man/man7/signal.7 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
man/man7/signal.7 +7 -1
index 4ba5306c8..7d22a7cfe 100644
@@ -282,7 +282,13 @@ the thread's alternate signal stack settings.
 .B SA_SIGINFO
 flag, then the above information is accessible via the
 .I ucontext_t
-object that is pointed to by the third argument of the signal handler.)
+object that is pointed to by the third argument of the signal handler.
+This object reflects the state at which the signal is delivered, rather
+than in the handler;
+for example, the mask of blocked signals stored in this object will not
+contain the mask of new signals blocked through
+.BR sigaction(2)).
+
 .IP (1.4)
 Any signals specified in
 .I act\->sa_mask
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v2 1/2] signal.7: Clearly describe ucontext kernel dump to userspace

Quoted 4 lines · Dev Jain

The set of blocked signals is updated from struct sigaction after the kernel dumps ucontext. Mention this to avoid misunderstanding.

Hi Dev,

I've applied this patch, with some minor tweaks:
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=9e1f221b2099ee2c936ce4d6562a61e1e253af47>

Have a lovely day!
Alex

Quoted 27 lines
---
 man/man7/signal.7 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
man/man7/signal.7 +7 -1
index 4ba5306c8..7d22a7cfe 100644
@@ -282,7 +282,13 @@ the thread's alternate signal stack settings.
 .B SA_SIGINFO
 flag, then the above information is accessible via the
 .I ucontext_t
-object that is pointed to by the third argument of the signal handler.)
+object that is pointed to by the third argument of the signal handler.
+This object reflects the state at which the signal is delivered, rather
+than in the handler;
+for example, the mask of blocked signals stored in this object will not
+contain the mask of new signals blocked through
+.BR sigaction(2)).
+
 .IP (1.4)
 Any signals specified in
 .I act\->sa_mask
Signature · 1 line
2.34.1
Signature · 1 line
<https://www.alejandro-colomar.es/>
#3 lore raw

Re: [PATCH v2 1/2] signal.7: Clearly describe ucontext kernel dump to userspace

Quoted 10 lines · Alejandro Colomar
Quoted 4 lines · Dev Jain

The set of blocked signals is updated from struct sigaction after the kernel dumps ucontext. Mention this to avoid misunderstanding.

Hi Dev,

I've applied this patch, with some minor tweaks:
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=9e1f221b2099ee2c936ce4d6562a61e1e253af47>

Whoops; I found another issue, and amended:
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=b8136d84eb3b9b1db0dd6f54f47c1c104682f44f>

Quoted 34 lines

Have a lovely day!
Alex

Quoted 27 lines
---
 man/man7/signal.7 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
man/man7/signal.7 +7 -1
index 4ba5306c8..7d22a7cfe 100644
@@ -282,7 +282,13 @@ the thread's alternate signal stack settings.
 .B SA_SIGINFO
 flag, then the above information is accessible via the
 .I ucontext_t
-object that is pointed to by the third argument of the signal handler.)
+object that is pointed to by the third argument of the signal handler.
+This object reflects the state at which the signal is delivered, rather
+than in the handler;
+for example, the mask of blocked signals stored in this object will not
+contain the mask of new signals blocked through
+.BR sigaction(2)).
+
 .IP (1.4)
 Any signals specified in
 .I act\->sa_mask
Signature · 1 line
2.34.1
Signature · 1 line
<https://www.alejandro-colomar.es/>
Signature · 1 line
<https://www.alejandro-colomar.es/>
author
#4 lore raw

PATCH v2 2/2 signal.7: Fix wrong mention of sigprocmask

In reply to Dev Jain

The handler is registered with sigaction(), not sigprocmask(). Even if the purpose of writing sigprocmask() here was to mention blocked signals, the statement currently concerns the "addition" of blocked signals; signals blocked through sigprocmask() would already be present in the thread context of blocked signals.

Fixes e7a5700 (getcontext.3, signal.7: tfix)
---
 man/man7/signal.7 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man/man7/signal.7 +1 -1
index 7d22a7cfe..57eab7847 100644
@@ -293,7 +293,7 @@ contain the mask of new signals blocked through
 Any signals specified in
 .I act\->sa_mask
 when registering the handler with
-.BR sigprocmask (2)
+.BR sigaction (2)
 are added to the thread's signal mask.
 The signal being delivered is also
 added to the signal mask, unless
Signature · 1 line
2.34.1
Reviewed-by on v2 2/2
#5 lore raw

Re: [PATCH v2 2/2] signal.7: Fix wrong mention of sigprocmask

Quoted 5 lines · Dev Jain

The handler is registered with sigaction(), not sigprocmask(). Even if the purpose of writing sigprocmask() here was to mention blocked signals, the statement currently concerns the "addition" of blocked signals; signals blocked through sigprocmask() would already be present in the thread context of blocked signals.

#6 lore raw

Re: [PATCH v2 2/2] signal.7: Fix wrong mention of sigprocmask

Hi Dev, Mark,

Quoted 8 lines · Mark Brown
Quoted 5 lines · Dev Jain

The handler is registered with sigaction(), not sigprocmask(). Even if the purpose of writing sigprocmask() here was to mention blocked signals, the statement currently concerns the "addition" of blocked signals; signals blocked through sigprocmask() would already be present in the thread context of blocked signals.

Thanks for the patch and the review! I've applied the patch. It will be included in the man-pages-6.9.1 release later today.

Have a lovely day!
Alex

Signature · 1 line
<https://www.alejandro-colomar.es/>