From: Oleg Nesterov <oleg@redhat.com>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: christian@brauner.io, "Eric W. Biederman" <ebiederm@xmission.com>,
Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: 5.8-rc*: kernel BUG at kernel/signal.c:1917
Date: Fri, 17 Jul 2020 14:40:18 +0200 [thread overview]
Message-ID: <20200717124017.GB6067@redhat.com> (raw)
In-Reply-To: <20200717122651.GA6067@redhat.com>
On 07/17, Oleg Nesterov wrote:
>
> On 07/17, Jiri Slaby wrote:
> >
> > On 17. 07. 20, 12:45, Jiri Slaby wrote:
> > > Hi,
> > >
> > > the strace testsuite triggers this on 5.8-rc4 and -rc5 both on x86_64
> > > and i586:
> >
> > make check needs -jsomething, running is sequentially (-j1) doesn't
> > trigger it. After the error, I cannot run anything. Like ps to find out
> > what test caused the crash...
>
> Strange... I'll try to reproduce but I can't do this till Monday.
>
> Meanwhile, could you try the patch below? It needs CONFIG_DEBUG_ATOMIC_SLEEP.
please see the updated patch below, lets check ptrace_unfreeze() too.
Oleg.
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 43d6179508d6..71c76bc7dec6 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -180,6 +180,7 @@ static bool ptrace_freeze_traced(struct task_struct *task)
spin_lock_irq(&task->sighand->siglock);
if (task_is_traced(task) && !__fatal_signal_pending(task)) {
+ task->task_state_change = _THIS_IP_;
task->state = __TASK_TRACED;
ret = true;
}
@@ -203,8 +204,10 @@ static void ptrace_unfreeze_traced(struct task_struct *task)
if (task->state == __TASK_TRACED) {
if (__fatal_signal_pending(task))
wake_up_state(task, __TASK_TRACED);
- else
+ else {
+ task->task_state_change = _THIS_IP_;
task->state = TASK_TRACED;
+ }
}
spin_unlock_irq(&task->sighand->siglock);
}
diff --git a/kernel/signal.c b/kernel/signal.c
index ee22ec78fd6d..ba4c4c9ed9b5 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1914,7 +1914,9 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
BUG_ON(sig == -1);
/* do_notify_parent_cldstop should have been called instead. */
- BUG_ON(task_is_stopped_or_traced(tsk));
+ WARN(task_is_stopped_or_traced(tsk),
+ "exist with state=%ld set at %pS",
+ tsk->state, (void*)tsk->task_state_change);
BUG_ON(!tsk->ptrace &&
(tsk->group_leader != tsk || !thread_group_empty(tsk)));
@@ -2214,6 +2216,7 @@ static void ptrace_stop(int exit_code, int why, int clear_code, kernel_siginfo_t
preempt_enable_no_resched();
freezable_schedule();
cgroup_leave_frozen(true);
+ WARN_ON(current->state);
} else {
/*
* By the time we got the lock, our tracer went away.
@@ -2393,6 +2396,7 @@ static bool do_signal_stop(int signr)
/* Now we don't run again until woken by SIGCONT or SIGKILL */
cgroup_enter_frozen();
freezable_schedule();
+ WARN_ON(current->state);
return true;
} else {
/*
next prev parent reply other threads:[~2020-07-17 12:40 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-17 10:45 Jiri Slaby
2020-07-17 11:04 ` Jiri Slaby
2020-07-17 11:12 ` Christian Brauner
2020-07-18 13:05 ` Jiri Slaby
2020-07-17 12:26 ` Oleg Nesterov
2020-07-17 12:40 ` Oleg Nesterov [this message]
2020-07-18 12:28 ` Jiri Slaby
2020-07-18 17:14 ` Oleg Nesterov
2020-07-18 17:44 ` Christian Brauner
2020-07-20 5:44 ` Jiri Slaby
2020-07-20 6:43 ` Oleg Nesterov
2020-07-20 8:26 ` Oleg Nesterov
2020-07-20 8:41 ` Peter Zijlstra
2020-07-20 10:59 ` peterz
2020-07-20 11:26 ` peterz
2020-07-20 11:40 ` Jiri Slaby
2020-07-20 12:20 ` Valentin Schneider
2020-07-20 13:17 ` peterz
2020-07-20 14:26 ` Valentin Schneider
2020-07-20 12:57 ` Christian Brauner
2020-07-20 14:05 ` peterz
2020-07-20 14:02 ` Oleg Nesterov
2020-07-20 14:21 ` Peter Zijlstra
2020-07-20 14:39 ` Oleg Nesterov
2020-07-20 15:35 ` Oleg Nesterov
2020-07-20 15:38 ` Peter Zijlstra
2020-07-21 4:52 ` Paul Gortmaker
2020-07-21 8:37 ` peterz
2020-07-21 12:13 ` [PATCH] sched: Fix race against ptrace_freeze_trace() peterz
2020-07-21 14:29 ` Christian Brauner
2020-07-21 15:38 ` Oleg Nesterov
2020-07-21 9:14 ` 5.8-rc*: kernel BUG at kernel/signal.c:1917 Valentin Schneider
[not found] ` <20200719072726.5892-1-hdanton@sina.com>
2020-07-19 18:23 ` Oleg Nesterov
2020-07-20 6:00 ` Jiri Slaby
2020-07-20 6:56 ` Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200717124017.GB6067@redhat.com \
--to=oleg@redhat.com \
--cc=christian@brauner.io \
--cc=ebiederm@xmission.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome