This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Fix lin-lwp SIGINT handling for 2.6


Daniel Jacobowitz wrote:
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

Oh. Well then -- never mind. ;-) Speaking as the originator of linux-proc.c, it's fine with me to put it there. I don't feel competent to judge the correctness of the code, though.


.





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]