public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: Cong Wang <cwang@twopensource.com>,
	Vince Weaver <vincent.weaver@maine.edu>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: Re: perf: perf_fuzzer triggers instant reboot
Date: Tue, 30 Sep 2014 10:54:14 +0200	[thread overview]
Message-ID: <20140930085414.GR5430@worktop> (raw)
In-Reply-To: <5429906D.2030106@oracle.com>

On Mon, Sep 29, 2014 at 01:01:33PM -0400, Sasha Levin wrote:
> On 09/29/2014 07:11 AM, Peter Zijlstra wrote:
> > On Sun, Sep 28, 2014 at 12:09:09AM -0400, Sasha Levin wrote:
> > 
> >> > [  690.801720] 2 locks held by trinity-c95/17888:
> >> > [  690.801738] #0: (cpu_hotplug.lock){++++++}, at: get_online_cpus (kernel/cpu.c:92)
> >> > [  690.801754] #1: (&ctx->lock){-.-...}, at: perf_lock_task_context (kernel/events/core.c:988)
> >> > [  690.801758]
> >> > [  690.801758] stack backtrace:
> >> > [  690.801766] CPU: 21 PID: 17888 Comm: trinity-c95 Not tainted 3.17.0-rc6-next-20140926-sasha-00051-g9253dff-dirty #1242
> >> > [  690.801779]  ffffffff92b7f320 0000000000000000 ffffffff92afbee0 ffff8804078179c8
> >> > [  690.801798]  ffffffff8ef0070f 0000000000000011 ffffffff92ab6aa0 ffff880407817a18
> >> > [  690.801813]  ffffffff8a24ec2c ffff880407817aa8 ffff880409c00000 ffff880407817a18
> >> > [  690.801818] Call Trace:
> >> > [  690.801836] dump_stack (lib/dump_stack.c:52)
> >> > [  690.801845] print_circular_bug (kernel/locking/lockdep.c:1217)
> >> > [  690.801856] __lock_acquire (kernel/locking/lockdep.c:1842 kernel/locking/lockdep.c:1947 kernel/locking/lockdep.c:2133 kernel/locking/lockdep.c:3184)
> >> > [  690.801872] lock_acquire (kernel/locking/lockdep.c:3610)
> >> > [  690.801892] _raw_spin_lock (include/linux/spinlock_api_smp.h:143 kernel/locking/spinlock.c:151)
> >> > [  690.801921] __queue_work (kernel/workqueue.c:1325)
> >> > [  690.801943] queue_work_on (kernel/workqueue.c:1403)
> >> > [  690.801956] free_object (lib/debugobjects.c:209)
> >> > [  690.801967] __debug_check_no_obj_freed (lib/debugobjects.c:718)
> >> > [  690.801983] debug_check_no_obj_freed (lib/debugobjects.c:727)
> >> > [  690.801995] kmem_cache_free (mm/slub.c:2687 mm/slub.c:2715)
> >> > [  690.802016] free_task (kernel/fork.c:221)
> >> > [  690.802026] __put_task_struct (kernel/fork.c:251)
> >> > [  690.802037] put_ctx (include/linux/sched.h:1864 kernel/events/core.c:904)
> >> > [  690.802049] find_get_context (kernel/events/core.c:913 kernel/events/core.c:3222)
> >> > [  690.802078] SYSC_perf_event_open (kernel/events/core.c:7347)
> >> > [  690.802111] SyS_perf_event_open (kernel/events/core.c:7210)
> >> > [  690.802120] tracesys_phase2 (arch/x86/kernel/entry_64.S:529)
> > This doesn't make sense; perf_lock_task_context() isn't supposed to
> > return with ctx->lock held and therefore it should not still be held in
> > find_get_context() when calling put_ctx().
> > 
> > Now, the only put_ctx() call in find_get_context() is in the !ctx path
> > of the perf_lock_task_context() call, furthermore there is a
> > mutex_lock() - which implies a might_sleep() - before that, so we can't
> > still be holding a spinlock().
> 
> I think you missed the put_ctx() call in the other branch in find_get_context(),
> which is the call described by the trace above:
> 
> 	find_get_context()
> 		unclone_ctx()
> 			put_ctx()
> 

Yes indeed. Bah. Lemme see what I can make of that.

  reply	other threads:[~2014-09-30  8:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 17:47 perf: perf_fuzzer triggers instant reboot Vince Weaver
2014-09-08 18:51 ` Peter Zijlstra
2014-09-08 19:08   ` Vince Weaver
2014-09-09 16:06   ` Vince Weaver
2014-09-09 17:20     ` Vince Weaver
2014-09-09 17:53       ` Vince Weaver
2014-09-10  8:31         ` Peter Zijlstra
2014-09-10 13:18           ` Vince Weaver
2014-09-10 13:28             ` Peter Zijlstra
2014-09-10 14:01             ` Sasha Levin
2014-09-10 14:30               ` Vince Weaver
2014-09-10 14:33                 ` Peter Zijlstra
2014-09-11 13:27                   ` Vince Weaver
2014-09-25  4:59                     ` Vince Weaver
2014-09-25 16:38                       ` Cong Wang
2014-09-28  4:09                         ` Sasha Levin
2014-09-29 11:11                           ` Peter Zijlstra
2014-09-29 17:01                             ` Sasha Levin
2014-09-30  8:54                               ` Peter Zijlstra [this message]
2014-09-30 17:23                           ` Peter Zijlstra
2014-10-01 11:16                             ` Sasha Levin
2014-10-02 15:06                               ` Vince Weaver
2014-10-02 16:06                                 ` Vince Weaver
2014-10-03  5:27                             ` [tip:perf/urgent] perf: Fix unclone_ctx() vs. locking tip-bot for Peter Zijlstra
2014-09-29  5:21                         ` perf: perf_fuzzer triggers instant reboot Vince Weaver
2014-09-30 17:58                           ` Cong Wang

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=20140930085414.GR5430@worktop \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=cwang@twopensource.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=sasha.levin@oracle.com \
    --cc=vincent.weaver@maine.edu \
    /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