public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Use SIG_BLOCK instead of numeric constant
@ 2018-12-16 20:04 info
  2018-12-18 20:26 ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: info @ 2018-12-16 20:04 UTC (permalink / raw)
  To: gdb-patches

gdb on mipsel-alpine-linux-musl* (at least) fails to start without
this change because SIG_BLOCK is 1 not 0 on linux/mips (unlike most
other architectures).

---
 gdb/common/signals-state-save-restore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/common/signals-state-save-restore.c b/gdb/common/signals-state-save-restore.c
index 5bb66321bb..6597decbc6 100644
--- a/gdb/common/signals-state-save-restore.c
+++ b/gdb/common/signals-state-save-restore.c
@@ -41,7 +41,7 @@ save_original_signals_state (bool quiet)
   int i;
   int res;
 
-  res = sigprocmask (0,  NULL, &original_signal_mask);
+  res = sigprocmask (SIG_BLOCK,  NULL, &original_signal_mask);
   if (res == -1)
     perror_with_name (("sigprocmask"));
 
-- 
2.19.2


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

* Re: [PATCH] Use SIG_BLOCK instead of numeric constant
  2018-12-16 20:04 [PATCH] Use SIG_BLOCK instead of numeric constant info
@ 2018-12-18 20:26 ` Simon Marchi
  2018-12-19  1:12   ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2018-12-18 20:26 UTC (permalink / raw)
  To: info; +Cc: gdb-patches, Pedro Alves, Rich Felker

On 2018-12-16 14:39, info@mobile-stream.com wrote:
> gdb on mipsel-alpine-linux-musl* (at least) fails to start without
> this change because SIG_BLOCK is 1 not 0 on linux/mips (unlike most
> other architectures).
> 
> ---
>  gdb/common/signals-state-save-restore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/common/signals-state-save-restore.c
> b/gdb/common/signals-state-save-restore.c
> index 5bb66321bb..6597decbc6 100644
> --- a/gdb/common/signals-state-save-restore.c
> +++ b/gdb/common/signals-state-save-restore.c
> @@ -41,7 +41,7 @@ save_original_signals_state (bool quiet)
>    int i;
>    int res;
> 
> -  res = sigprocmask (0,  NULL, &original_signal_mask);
> +  res = sigprocmask (SIG_BLOCK,  NULL, &original_signal_mask);
>    if (res == -1)
>      perror_with_name (("sigprocmask"));

There was a discussion about this last year:

   https://sourceware.org/ml/gdb-patches/2017-03/threads.html#00426

A bug was filed against the POSIX standard here:

   http://austingroupbugs.net/view.php?id=1132#c4124

... and the way it was clarified goes with GDB's interpretation.  So I 
guess musl's implementation will have to change to match.

Simon

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

* Re: [PATCH] Use SIG_BLOCK instead of numeric constant
  2018-12-18 20:26 ` Simon Marchi
@ 2018-12-19  1:12   ` Rich Felker
  0 siblings, 0 replies; 3+ messages in thread
From: Rich Felker @ 2018-12-19  1:12 UTC (permalink / raw)
  To: Simon Marchi; +Cc: info, gdb-patches, Pedro Alves

On Tue, Dec 18, 2018 at 03:26:04PM -0500, Simon Marchi wrote:
> On 2018-12-16 14:39, info@mobile-stream.com wrote:
> >gdb on mipsel-alpine-linux-musl* (at least) fails to start without
> >this change because SIG_BLOCK is 1 not 0 on linux/mips (unlike most
> >other architectures).
> >
> >---
> > gdb/common/signals-state-save-restore.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/gdb/common/signals-state-save-restore.c
> >b/gdb/common/signals-state-save-restore.c
> >index 5bb66321bb..6597decbc6 100644
> >--- a/gdb/common/signals-state-save-restore.c
> >+++ b/gdb/common/signals-state-save-restore.c
> >@@ -41,7 +41,7 @@ save_original_signals_state (bool quiet)
> >   int i;
> >   int res;
> >
> >-  res = sigprocmask (0,  NULL, &original_signal_mask);
> >+  res = sigprocmask (SIG_BLOCK,  NULL, &original_signal_mask);
> >   if (res == -1)
> >     perror_with_name (("sigprocmask"));
> 
> There was a discussion about this last year:
> 
>   https://sourceware.org/ml/gdb-patches/2017-03/threads.html#00426
> 
> A bug was filed against the POSIX standard here:
> 
>   http://austingroupbugs.net/view.php?id=1132#c4124
> 
> .... and the way it was clarified goes with GDB's interpretation.
> So I guess musl's implementation will have to change to match.

Thank you for the CC. I'm fixing it now to conform with the resolution
of #1132.

Rich

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

end of thread, other threads:[~2018-12-19  1:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-16 20:04 [PATCH] Use SIG_BLOCK instead of numeric constant info
2018-12-18 20:26 ` Simon Marchi
2018-12-19  1:12   ` Rich Felker

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).