[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-patches
Subject:    Re: Recent sigprocmask changes in libgo/runtime/proc.c killed thread debugging on alpha.
From:       Ian Lance Taylor <iant () google ! com>
Date:       2013-02-28 21:56:29
Message-ID: CAKOQZ8yH312evJvcymke_Qy-G-nCBcBZjVEBQQ9FgVNGGfS72Q () mail ! gmail ! com
[Download RAW message or body]

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

["foo.patch" (application/octet-stream)]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic