public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] abort: clarify consequences of calling abort
@ 2023-07-10 13:59 Tomáš Golembiovský
  2023-07-10 15:21 ` G. Branden Robinson
  0 siblings, 1 reply; 5+ messages in thread
From: Tomáš Golembiovský @ 2023-07-10 13:59 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man, Tomáš Golembiovský

Clarify that atexit/on_exit are not called because those are called only
on normal process termination (as documented on their respective manual
pages).

Clarify the status reported by wait*() functions. The requirement comes
from POSIX specification.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
---
 man3/abort.3 | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/man3/abort.3 b/man3/abort.3
index c63eace5e..2454e186d 100644
--- a/man3/abort.3
+++ b/man3/abort.3
@@ -47,6 +47,17 @@ function will still terminate the process.
 It does this by restoring the default disposition for
 .B SIGABRT
 and then raising the signal for a second time.
+.PP
+As with other cases of abnormal termination the functions registered with
+.BR atexit "(3) and " on_exit (3)
+are not called.
+The status made available to
+.BR wait "(2), " waitid "(2), or " waitpid (2)
+by
+.BR abort ()
+shall be that of a process terminated by the
+.BR SIGABRT
+signal.
 .SH RETURN VALUE
 The
 .BR abort ()
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] abort: clarify consequences of calling abort
  2023-07-10 13:59 [PATCH v2] abort: clarify consequences of calling abort Tomáš Golembiovský
@ 2023-07-10 15:21 ` G. Branden Robinson
  2023-07-12  8:11   ` Tomáš Golembiovský
  2023-07-12 10:45   ` Stefan Puiu
  0 siblings, 2 replies; 5+ messages in thread
From: G. Branden Robinson @ 2023-07-10 15:21 UTC (permalink / raw)
  To: Tomáš Golembiovský; +Cc: Alejandro Colomar, linux-man

[-- Attachment #1: Type: text/plain, Size: 879 bytes --]

Hi Tomáš,

At 2023-07-10T15:59:28+0200, Tomáš Golembiovský wrote:
[...]
> Clarify the status reported by wait*() functions. The requirement
> comes from POSIX specification.
[...]
> +The status made available to
> +.BR wait "(2), " waitid "(2), or " waitpid (2)
> +by
> +.BR abort ()
> +shall be that of a process terminated by the
> +.BR SIGABRT
> +signal.
[...]

I believe Alex's preference in the Linux man-pages project is to
document what is actually implemented, not to repeat normative language
(paraphrased or not) from the POSIX standard.

So glibc should be tested to verify the behavior it actually exhibits,
and the language above then updated to describe that, noting any
deviation from POSIX's prescription.

The same can, optionally, be done for other libcs like musl.

Alex, please correct me if I'm mistaken.

Regards,
Branden

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] abort: clarify consequences of calling abort
  2023-07-10 15:21 ` G. Branden Robinson
@ 2023-07-12  8:11   ` Tomáš Golembiovský
  2023-07-12 10:45   ` Stefan Puiu
  1 sibling, 0 replies; 5+ messages in thread
From: Tomáš Golembiovský @ 2023-07-12  8:11 UTC (permalink / raw)
  To: G. Branden Robinson; +Cc: Alejandro Colomar, linux-man

Hi,

On Mon, Jul 10, 2023 at 10:21:50AM -0500, G. Branden Robinson wrote:
> Hi Tomáš,
> 
> At 2023-07-10T15:59:28+0200, Tomáš Golembiovský wrote:
> [...]
> > Clarify the status reported by wait*() functions. The requirement
> > comes from POSIX specification.
> [...]
> > +The status made available to
> > +.BR wait "(2), " waitid "(2), or " waitpid (2)
> > +by
> > +.BR abort ()
> > +shall be that of a process terminated by the
> > +.BR SIGABRT
> > +signal.
> [...]
> 
> I believe Alex's preference in the Linux man-pages project is to
> document what is actually implemented, not to repeat normative language
> (paraphrased or not) from the POSIX standard.

Yeah, I don't feel strong about it and I have my doubts if mentioning is
useful anyway. It should be obvious from the fact that abort() raises
SIABGRT. I will drop that sentence. 

> 
> So glibc should be tested to verify the behavior it actually exhibits,
> and the language above then updated to describe that, noting any
> deviation from POSIX's prescription.

As a side note, in the normal situation glibc does what it should.
However, in the unlikely situation that raise() fails unexpectedly,
abort() tries to terminate the process with other means or loops for
ever if everything else fails to satisfy the condition that abort()
should never return.

    Tomas

> 
> The same can, optionally, be done for other libcs like musl.
> 
> Alex, please correct me if I'm mistaken.
> 
> Regards,
> Branden



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] abort: clarify consequences of calling abort
  2023-07-10 15:21 ` G. Branden Robinson
  2023-07-12  8:11   ` Tomáš Golembiovský
@ 2023-07-12 10:45   ` Stefan Puiu
  2023-07-15 15:44     ` Alejandro Colomar
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Puiu @ 2023-07-12 10:45 UTC (permalink / raw)
  To: G. Branden Robinson
  Cc: Tomáš Golembiovský, Alejandro Colomar, linux-man

Hi,

On Mon, Jul 10, 2023 at 6:41 PM G. Branden Robinson
<g.branden.robinson@gmail.com> wrote:
>
>
> At 2023-07-10T15:59:28+0200, Tomáš Golembiovský wrote:
>
> I believe Alex's preference in the Linux man-pages project is to
> document what is actually implemented, not to repeat normative language
> (paraphrased or not) from the POSIX standard.
>
> So glibc should be tested to verify the behavior it actually exhibits,
> and the language above then updated to describe that, noting any
> deviation from POSIX's prescription.

At least when Michael Kerrisk was the man-pages maintainer, he would
usually ask for a test program proving that the documentation change
is correct and / or a pointer to the kernel / libc code, where the
behavior could be (hopefully) inferred. I think this is valuable, it
makes it easier to track why a certain change was made, and how the
behavior was observed at that time. If running the same test case
after X years yields a different behavior, it's clear the change that
it triggered no longer stands. It's also fair, I think: the burden of
proof is on the person suggesting the change.

Just my 2 cents,
Stefan.

>
> The same can, optionally, be done for other libcs like musl.
>
> Alex, please correct me if I'm mistaken.
>
> Regards,
> Branden

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] abort: clarify consequences of calling abort
  2023-07-12 10:45   ` Stefan Puiu
@ 2023-07-15 15:44     ` Alejandro Colomar
  0 siblings, 0 replies; 5+ messages in thread
From: Alejandro Colomar @ 2023-07-15 15:44 UTC (permalink / raw)
  To: Stefan Puiu
  Cc: Tomáš Golembiovský, linux-man, G. Branden Robinson


[-- Attachment #1.1: Type: text/plain, Size: 1734 bytes --]

On 2023-07-12 12:45, Stefan Puiu wrote:
> Hi,
> 
> On Mon, Jul 10, 2023 at 6:41 PM G. Branden Robinson
> <g.branden.robinson@gmail.com> wrote:
>>
>>
>> At 2023-07-10T15:59:28+0200, Tomáš Golembiovský wrote:
>>
>> I believe Alex's preference in the Linux man-pages project is to
>> document what is actually implemented, not to repeat normative language
>> (paraphrased or not) from the POSIX standard.
>>
>> So glibc should be tested to verify the behavior it actually exhibits,
>> and the language above then updated to describe that, noting any
>> deviation from POSIX's prescription.
> 
> At least when Michael Kerrisk was the man-pages maintainer, he would
> usually ask for a test program proving that the documentation change
> is correct and / or a pointer to the kernel / libc code, where the
> behavior could be (hopefully) inferred. I think this is valuable, it
> makes it easier to track why a certain change was made, and how the
> behavior was observed at that time. If running the same test case
> after X years yields a different behavior, it's clear the change that
> it triggered no longer stands. It's also fair, I think: the burden of
> proof is on the person suggesting the change.

Hi Stefan!

Thanks for pointing that out!  I can only agree with you, and
I try maintain that good tradition of Michael.

Cheers,
Alex

> 
> Just my 2 cents,
> Stefan.
> 
>>
>> The same can, optionally, be done for other libcs like musl.
>>
>> Alex, please correct me if I'm mistaken.

Hi Branden!

I won't correct you either ;)

Thanks!

>>
>> Regards,
>> Branden

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-15 15:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-10 13:59 [PATCH v2] abort: clarify consequences of calling abort Tomáš Golembiovský
2023-07-10 15:21 ` G. Branden Robinson
2023-07-12  8:11   ` Tomáš Golembiovský
2023-07-12 10:45   ` Stefan Puiu
2023-07-15 15:44     ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox