public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: shwaresyst <shwaresyst@aol.com>
To: eblake@redhat.com, bruno@clisp.org, cbouchar@redhat.com,
	bug-m4@gnu.org,  libc-alpha@sourceware.org,
	austin-group-l@opengroup.org
Subject: Re: SIGSTKSZ is now a run-time variable
Date: Tue, 9 Mar 2021 21:29:57 +0000 (UTC)	[thread overview]
Message-ID: <1569476484.1894162.1615325397167@mail.yahoo.com> (raw)
In-Reply-To: <1569476484.1894162.1615325397167.ref@mail.yahoo.com>


Yes, it's not something an application would expect to need to keep increasing, just that's the part of <limits.h> I'd move it to. The definition could also be the max required by a processor family, with sysconf() reporting a possible lower value for a particular processor stepping. At least that way the application that doesn't use sysconf() won't be getting SIGSEGV faults.

Additionally, I believe the definition can be calculated at compile time as a multiple of ( sizeof(ucontext_t)+sizeof(overhead_struct(s)) ), whatever other overhead applies, so I don't see any real need to use sysconf(). This may mean having to munge a <signal.in> by configure, based on config.guess, but that's not the standard's headache.


The CS, SC, and PC constants are not in the XSH 2.2.2 table deliberately, from Issue 6 TC1, as adding any also requires a bump in POSIX_VERSION or POSIX2_VERSION, and often XSI_VERSION. This is so each usage of a constant doesn't need individual #ifdefs to test option group availability. The previous text was allowing if an implementation wasn't supporting an option group they could skip including the related constants in <unistd.h>. A simple check of VERSION at the top of a source C file suffices now to indicate those constants shall be available.
On Tuesday, March 9, 2021 Eric Blake <eblake@redhat.com> wrote:
On 3/9/21 10:14 AM, shwaresyst wrote:
> 
> To me that looks like a conformance violation and should be reverted. There is no _SC_SIGSTKSZ defined in <unistd.h> by the standard, to begin with, so that use of sysconf() is a non-portable extension on its own.

Portable apps can't use _SC_SIGSTKSZ, but the standard generally permits
implementations to define further constants.  Then again, re-reading XSH
2.2.2:

" Implementations may add symbols to the headers shown in the following
table, provided the identifiers for those symbols either:

    Begin with the corresponding reserved prefixes in the table, or
..."

but the table lacks a row for <unistd.h> with _CS_* and _SC_* constants.
 Looks like you found an independent defect.

> 
> I could see the definition of SIGSTKSZ being changed to the static minimum a particular processor requires, or is initially allocated as a 'safe' amount, rather than static "default size", and moving SIGSTKSZ to <limits.h>. This would contrast to MINSIGSTKSZ as the lowest value for a platform for all supported processors. Then an application could use sysconf() to query for the maximum size the configuration supports if it wants to use more than that, as a runtime increasable limit.

As I understand it, the concern in glibc is less about runtime
increasability, so much as ABI compatibility with applications compiled
against older headers at a time when the kernel had less state
information to store during a context switch.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.          +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


       reply	other threads:[~2021-03-09 21:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1569476484.1894162.1615325397167.ref@mail.yahoo.com>
2021-03-09 21:29 ` shwaresyst [this message]
2021-03-09 23:58   ` H.J. Lu
     [not found] <832918739.1734727.1615306471320.ref@mail.yahoo.com>
2021-03-09 16:14 ` shwaresyst
2021-03-09 19:33   ` Paul Eggert
2021-03-09 19:34   ` Eric Blake
2021-03-09 20:12     ` Eric Blake
     [not found] <1841269.IEpri3ZHvQ@omega>
2021-03-09 15:23 ` Eric Blake
2021-03-09 15:26   ` Andreas Schwab
2021-03-09 15:48     ` Eric Blake
2021-03-09 19:58       ` Bruno Haible
2021-03-09 21:05         ` H.J. Lu
     [not found]         ` <20210309211735.GW19922@dragon.sl.home>
2021-03-16 19:46           ` Carol Bouchard
2021-03-26 12:46             ` Carol Bouchard
2021-03-09 15:46   ` Zack Weinberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1569476484.1894162.1615325397167@mail.yahoo.com \
    --to=shwaresyst@aol.com \
    --cc=austin-group-l@opengroup.org \
    --cc=bruno@clisp.org \
    --cc=bug-m4@gnu.org \
    --cc=cbouchar@redhat.com \
    --cc=eblake@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).