unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>,
	Dave Martin <Dave.Martin@arm.com>,
	Joseph Myers <joseph@codesourcery.com>
Subject: Re: PING: V7 [PATCH] sysconf: Add _SC_MINSIGSTKSZ/_SC_SIGSTKSZ [BZ #20305]
Date: Wed, 18 Nov 2020 09:48:35 -0800	[thread overview]
Message-ID: <CAMe9rOpPE5-Nr80oKhN2vZzRnA7X925iZQJEPK9r4KGdeLvhzw@mail.gmail.com> (raw)
In-Reply-To: <873616va9n.fsf@mid.deneb.enyo.de>

On Wed, Nov 18, 2020 at 9:35 AM Florian Weimer <fw@deneb.enyo.de> wrote:
>
> * Dave Martin:
>
> > Having _GNU_SOURCE enable this feature will break existing source code.
>
> Does this matter?
>
> The code is already broken on a quickly increasing number of machines,
> so it needs fixing anyway.  A compile-time error is probably
> preferable to an obscure run-time failure.

I can see points on both sides.  Either approach is better than the status quo.
Can we make a decision for glibc 2.33?

> > It probably should go under _GNU_SOURCE in the long term, but is there
> > usually a transitional period when the change is opt-in via some feature
> > macro?
>
> Not always.  See the iszero and other macros in <math.h>, that also
> broke existing sources (largely C++, so we worked around it by using
> C++ features instead of macros).  There are also many older examples.
>
> > I have some thoughts on what a better interface might look like --
> > basically separating the signal ucontext_t type from the setcontext()/
> > getcontext() etc. type, and providing accessors for the architectural
> > register state rather than just having a fixed struct definition for
> > mcontext_t.
> >
> > But, there also may not be a lot of appetite for such a change, and
> > I can't see how it could be backwards compatible.
> >
> > I can elaborate if people think it's worth discussing.
>
> I think Rich Felker wants to copy signal contexts around to implement
> critical sections that can't be interrupted by a signal handler, I
> think that would need this fully fixed.
>
> But this is somewhat separate from fixing stack sizes to accomodate
> kernel and hardware needs.
>
> By the way, something that I tried to raise in the past, but wasn't
> good at it: In the future, we may need a mechanism to reduce the
> kernel stack size usage for legacy binaries, perhaps using
> virtualization.  The last time I looked at this, the signal context
> did not actually reduce when AVX-512 support was masked in a guest, I
> think.  (Okay, this is largely for H.J.'s benefit.)  This also applies
> to ld.so and its context save operation.  Fortunately, not many people
> have run into this compatibility issue so far.  The case I remember
> was an application that broke because it assumed zeros on the stack,
> and the XSAVE trampoline wrote some non-zero bits there because it
> reached much deeper into the stack.  But the user was happy when we
> found the root cause and was able to add the missing initializer to
> their code, so all was good.

We, Intel, are investigating different approaches to improve signal handling
on machines with large XSAVE states.  One possibility is fast signal handler
where the programmer informs the kernel that only to save and restore a subset
of XSAVE states in the signal handler and update the compiler to enforce that.


-- 
H.J.

  reply	other threads:[~2020-11-18 17:49 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-10 12:19 [PATCH] sysconf: Add _SC_MINSIGSTKSZ/_SC_SIGSTKSZ [BZ #20305] H.J. Lu via Libc-alpha
2020-10-12  7:53 ` Szabolcs Nagy via Libc-alpha
2020-10-12 11:04   ` Dave Martin via Libc-alpha
2020-10-12 12:42     ` V4 " H.J. Lu via Libc-alpha
2020-10-12 13:21       ` Dave Martin via Libc-alpha
2020-10-12 14:12     ` Szabolcs Nagy via Libc-alpha
2020-10-12 14:37       ` Dave Martin via Libc-alpha
2020-10-12 15:36         ` [libc-coord] " Rich Felker
2020-10-12 22:03 ` Joseph Myers
2020-10-13 20:32   ` V5 " H.J. Lu via Libc-alpha
2020-10-14 17:47     ` Dave Martin via Libc-alpha
2020-10-14 18:07       ` Florian Weimer via Libc-alpha
2020-10-19 16:30         ` Dave Martin via Libc-alpha
2020-10-15 11:57       ` V6 " H.J. Lu via Libc-alpha
2020-10-19 15:08         ` Dave Martin via Libc-alpha
2020-10-19 21:32           ` H.J. Lu via Libc-alpha
2020-10-20  9:19             ` Dave Martin via Libc-alpha
2020-10-20 14:59               ` H.J. Lu via Libc-alpha
2020-10-20 15:22                 ` Dave Martin via Libc-alpha
2020-10-20 18:19                 ` V7 " H.J. Lu via Libc-alpha
2020-11-03  3:06                   ` PING: " H.J. Lu via Libc-alpha
2020-11-04 16:50                     ` Dave Martin via Libc-alpha
2020-11-04 17:48                       ` H.J. Lu via Libc-alpha
2020-11-18 14:13                         ` H.J. Lu via Libc-alpha
2020-11-18 14:25                           ` Zack Weinberg
2020-11-18 14:40                             ` H.J. Lu via Libc-alpha
2020-11-18 15:12                               ` Zack Weinberg
2020-11-18 15:17                                 ` H.J. Lu via Libc-alpha
2020-11-18 15:20                                   ` Florian Weimer
2020-11-18 17:04                                     ` Dave Martin via Libc-alpha
2020-11-18 17:35                                       ` Florian Weimer
2020-11-18 17:48                                         ` H.J. Lu via Libc-alpha [this message]
2020-11-18 18:09                                         ` Dave Martin via Libc-alpha
2020-11-19 14:59                                           ` Szabolcs Nagy via Libc-alpha
2020-11-19 15:10                                             ` H.J. Lu via Libc-alpha
2020-11-19 15:39                                             ` Zack Weinberg
2020-11-19 15:51                                               ` Florian Weimer
2020-11-19 16:16                                               ` Rich Felker
2020-11-19 16:52                                                 ` Dave Martin via Libc-alpha
2020-11-19 16:37                                             ` Dave Martin via Libc-alpha
2020-11-19 17:29                                               ` Rich Felker
2020-11-19 17:33                                               ` Szabolcs Nagy via Libc-alpha
2020-11-19 19:39                                                 ` Dave Martin via Libc-alpha
2020-11-20 14:08                                           ` H.J. Lu via Libc-alpha
2020-11-20 14:11                                             ` Florian Weimer
2020-11-20 23:13                                               ` V8 " H.J. Lu via Libc-alpha
2021-01-20 14:16                                                 ` Carlos O'Donell via Libc-alpha
2021-01-20 15:05                                                   ` V9 " H.J. Lu via Libc-alpha
2021-01-22 19:41                                                     ` V10 " H.J. Lu via Libc-alpha
2021-01-25 13:31                                                       ` Carlos O'Donell via Libc-alpha
2021-01-25 13:57                                                         ` H.J. Lu via Libc-alpha
2021-01-25 13:59                                                           ` Carlos O'Donell via Libc-alpha
2021-01-25 13:58                                                       ` Carlos O'Donell via Libc-alpha
2021-01-25 14:16                                                         ` Florian Weimer via Libc-alpha
2021-02-02 13:08                                                           ` Carlos O'Donell via Libc-alpha
2021-01-25 14:34                                                         ` Carlos O'Donell via Libc-alpha
2021-01-20 15:06                                                   ` V8 " Florian Weimer via Libc-alpha
2021-01-20 15:30                                                     ` Carlos O'Donell via Libc-alpha
2021-01-20 15:33                                                       ` H.J. Lu via Libc-alpha
2021-01-20 15:59                                                         ` Carlos O'Donell via Libc-alpha
2021-01-20 16:04                                                           ` H.J. Lu via Libc-alpha
2021-01-20 15:33                                                       ` Florian Weimer via Libc-alpha
2020-10-15 12:26       ` [PATCH] Deprecate SIGSTKSZ/MINSIGSTKSZ with _SC_SIGSTKSZ_SOURCE H.J. Lu via Libc-alpha
2020-10-15 19:59         ` Joseph Myers
2020-10-15 21:22           ` V2 " H.J. Lu via Libc-alpha
2020-10-16  0:57             ` Joseph Myers
2021-07-09 18:53             ` Carlos O'Donell via Libc-alpha
2021-07-09 19:34               ` H.J. Lu via Libc-alpha
2020-10-12 22:07 ` [PATCH] sysconf: Add _SC_MINSIGSTKSZ/_SC_SIGSTKSZ [BZ #20305] Joseph Myers

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=CAMe9rOpPE5-Nr80oKhN2vZzRnA7X925iZQJEPK9r4KGdeLvhzw@mail.gmail.com \
    --to=libc-alpha@sourceware.org \
    --cc=Dave.Martin@arm.com \
    --cc=fw@deneb.enyo.de \
    --cc=hjl.tools@gmail.com \
    --cc=joseph@codesourcery.com \
    /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).