lkml.org 
[lkml]   [2019]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] signal: Better detection of synchronous signals
On 02/11, Eric W. Biederman wrote:
>
> Oleg Nesterov <oleg@redhat.com> writes:
>
> >> + /*
> >> + * Check if there is another siginfo for the same signal.
> >> + */
> >> + list_for_each_entry_continue(q, &pending->list, list) {
> >> + if (q->info.si_signo == sync->info.si_signo)
> >> + goto still_pending;
> >> + }
> >
> > But this must not be possible? SYNCHRONOUS_MASK doesn't include real-time
> > signals, we can't have 2 siginfo's for the same signal < SIGRTMIN.
>
> Yes for that reason it should be safe to strip that logic out at the
> moment. I overlooked that when writing the code.
>
> However. I am not certain that is a limit we actually want to honor
> with synchronous signals. As it results in a louzy quality of
> implementation.
>
> We start with an instruction in the program being debugged. In
> principle before that instruction starts we know that no signals
> are pending because they were not delivered to that process.
>
> If we for some reason send signal A to the process and at the same time
> hit a fault that is reported as signal A. It is currently a race which
> one wins. I think we could legitimately say that the fault happened
> before signal A was enqueued, and deliver both. It is a bit murkier if
> signal A was blocked.
>
> If we let the enqueued signal A win (as we do today) we have SA_SIGNFO
> that is not useful for describing the fault the instruction generated.
> Which is a really lousy quality of implementation.

I doubt this would be really useful but this doesn't matter right now,

> Which is a long way of saying I think that hunk of code is useful as it
> allows us the possibility of fixing a lousy quality of implementation in
> our code today.

If we ever rework the legacy_queue() logic we can easily add this hunk back.

Until then it complicates the code for no reason imo, just to confuse the reader.

Oleg.

\
 
 \ /
  Last update: 2019-02-12 18:21    [W:0.044 / U:0.792 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site