This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: Fix lin-lwp SIGINT handling for 2.6
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Michael Snyder <msnyder at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com, kettenis at gnu dot org
- Date: Wed, 27 Aug 2003 00:01:11 -0400
- Subject: Re: RFA: Fix lin-lwp SIGINT handling for 2.6
- References: <20030826193621.GA1925@nevyn.them.org> <3F4C15D5.8080207@redhat.com>
On Tue, Aug 26, 2003 at 07:22:13PM -0700, Michael Snyder wrote:
> Daniel Jacobowitz wrote:
> >This patch fixes a number of inconsistent regressions in schedlock.exp and
> >pthreads.exp on 2.6-series kernels, using LinuxThreads. Red Hat 2.4
> >kernels
> >have the same problems; the fix will work there too iff there is an update
> >which exports ShdPnd in /proc.
> >
> >The problem is that the SIGINT is delivered to every thread, and not
> >properly flushed. So we go later to step or continue and get an "echo" of
> >the original SIGINT. This is a timing problem caused by the introduction
> >of
> >two signal queues in the kernel; the SIGSTOP is now guaranteed to be
> >delivered before the SIGINT, since it's on the thread-specific queue. It
> >used to be that SIGINT would be delivered first; they were on the same
> >queue, and SIGINT was lower numbered.
> >
> >So we have to check whether a SIGINT is pending (and not blocked/ignored)
> >for the current thread after we stop it, and resume the thread to catch the
> >SIGINT if so.
> >
> >It's not a perfect fix, but it's enough more reliable than the current
> >scheme that I haven't been able to reproduce the problems. OK? HEAD only;
> >this is a bit of an annoyance, but too risky for the branch, IMO.
> >
>
> I've been worried about that.
>
> May I suggest that the function that opens a proc file belongs
> in linux-proc.c?
It is in linux-proc.c :)
* linux-proc.c (linux_proc_add_line_to_sigset): New function.
(linux_proc_pending_signals): New function.
* linux-nat.h (linux_proc_pending_signals): Add prototype.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer