From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Jovi Zhangwei <jovi.zhangwei@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Oleg Nesterov <oleg@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
"yrl.pp-manager.tt@hitachi.com" <yrl.pp-manager.tt@hitachi.com>
Subject: Re: Re: [BUG] 3.13-rc1 kernel crash when enable all tracepoints
Date: Tue, 26 Nov 2013 19:27:15 +0900 [thread overview]
Message-ID: <52947783.2040700@hitachi.com> (raw)
In-Reply-To: <52946261.8020408@hitachi.com>
(2013/11/26 17:57), Masami Hiramatsu wrote:
> (2013/11/26 16:20), Jovi Zhangwei wrote:
>> I'm not sure this relate with ftrace:function event, from the
>> crash log, it seems more like caused by lock events.
>>
>> Now I only enable lock events (lockdep compiled in my box), below
>> two commands both can crash system.
>
> That is not the lockdep, but the lockstat. :)
>
>>
>> #echo 1 > /sys/kernel/debug/tracing/events/lock/lock_acquire/enable
>> or.
>> #echo 1 > /sys/kernel/debug/tracing/events/lock/lock_release/enable
>>
>> According to the log, it seems like a recursion tracing bug.
>>
>> register lock event -> jump_label_update -> text_poke_bp ->
>> on_each_cpu -> local_apic_timer_interrupt -> ktime_get_update_offsets
>> -> lock_release
>
> OK, the problem is in the lock_acquire/release events.
Hm, it seems that the bug is caused because lock->name is NULL in
ftrace_raw_event_lock(_acquire). To allocate a buffer on ring_buffer,
ftrace_raw_event_##call tries to measure the length of lock->name
but it causes a memory access violation in ftrace_get_offsets_##call
because lock->name is NULL. :(
I could fix this by checking lock->name in include/trace/events/lock.h
e.g.
TP_STRUCT__entry(
__field(unsigned int, flags)
__string(name, lock->name ?: "NULL")
__field(void *, lockdep_addr)
),
TP_fast_assign(
__entry->flags = (trylock ? 1 : 0) | (read ? 2 : 0);
__assign_str(name, lock->name ?: "NULL");
__entry->lockdep_addr = lock;
),
Thank you,
--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com
next prev parent reply other threads:[~2013-11-26 10:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-26 4:38 [BUG] 3.13-rc1 kernel crash when enable all tracepoints Jovi Zhangwei
2013-11-26 6:33 ` Masami Hiramatsu
2013-11-26 7:20 ` Jovi Zhangwei
2013-11-26 8:57 ` Masami Hiramatsu
2013-11-26 10:27 ` Masami Hiramatsu [this message]
2013-11-26 7:26 ` (ltc-kernel 7837) " Masami Hiramatsu
2013-11-26 12:58 ` Steven Rostedt
2013-11-26 14:32 ` Shuah Khan
2013-11-26 14:44 ` Steven Rostedt
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=52947783.2040700@hitachi.com \
--to=masami.hiramatsu.pt@hitachi.com \
--cc=jovi.zhangwei@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=rostedt@goodmis.org \
--cc=yrl.pp-manager.tt@hitachi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.