public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Recent sigprocmask changes in libgo/runtime/proc.c killed thread debugging on alpha.
       [not found]       ` <CAFULd4bUU4__qj076SD28QE0eF84eOrdGjCPofD59X6xuj43uw@mail.gmail.com>
@ 2013-02-28 21:56         ` Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2013-02-28 21:56 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches, gofrontend-dev

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

On Thu, Feb 28, 2013 at 1:21 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Thu, Feb 28, 2013 at 9:55 PM, Ian Lance Taylor <iant@google.com> wrote:
>> On Thu, Feb 28, 2013 at 12:44 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>>
>>>> I'm fine with not blocking a signal that the debugger needs, but I
>>>> have no idea what that signal might be.
>>>
>>> Can you please advise me how to avoid blocking certain signal? I have
>>> a small testcase using pthreads that dies in the same way, so in fact
>>> the problem is not go specific. Anyway, I would like to investigate
>>> this issue some more.
>>
>> To avoid blocking a certain signal, after this line in proc.c
>>         sigfillset(&clear);
>> add
>>         sigdelset(&clear, SIGINT);
>> That will block all the signals other than SIGINT.  Pick whatever
>> signals you don't want to block, and call sigdelset as often as you
>> like.
>>
>> It may or may not help to know that there are two signals that are
>> special to the NPTL library: __SIGRTMIN and __SIGRTMIN + 1.  I don't
>> see why that would be an issue here, but who knows.
>
> Thanks for your instructions, I was able to find that SIGTRAP does all
> the difference!

Thanks.  I committed this patch.

Ian

[-- Attachment #2: foo.patch --]
[-- Type: application/octet-stream, Size: 573 bytes --]

diff -r 7a758385dda3 libgo/runtime/proc.c
--- a/libgo/runtime/proc.c	Wed Feb 20 12:03:21 2013 -0800
+++ b/libgo/runtime/proc.c	Thu Feb 28 13:54:25 2013 -0800
@@ -1256,6 +1256,12 @@
 	// Block signals during pthread_create so that the new thread
 	// starts with signals disabled.  It will enable them in minit.
 	sigfillset(&clear);
+
+#ifdef SIGTRAP
+	// Blocking SIGTRAP reportedly breaks gdb on Alpha GNU/Linux.
+	sigdelset(&clear, SIGTRAP);
+#endif
+
 	sigemptyset(&old);
 	sigprocmask(SIG_BLOCK, &clear, &old);
 	ret = pthread_create(&tid, &attr, runtime_mstart, mp);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-02-28 21:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAFULd4aQ9NgsF4JBJ9pxqza979itFhDm9JVxERkQpmSyGWqEBA@mail.gmail.com>
     [not found] ` <CAKOQZ8wBAkuxTsK76J=9MH1dtZa28hx3v6rbVA4LCSpi8Mtd=A@mail.gmail.com>
     [not found]   ` <CAFULd4Yna3h6vgz83Q-DtrjZMrTSp5_4HoQ1So7RS=WxWsfpBQ@mail.gmail.com>
     [not found]     ` <CAKOQZ8wF8Y8fm2y6nc=4KsMd8qKaCfsETsR3YVNCX1fhFkUVyw@mail.gmail.com>
     [not found]       ` <CAFULd4bUU4__qj076SD28QE0eF84eOrdGjCPofD59X6xuj43uw@mail.gmail.com>
2013-02-28 21:56         ` Recent sigprocmask changes in libgo/runtime/proc.c killed thread debugging on alpha Ian Lance Taylor

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