LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Quel Qun <kelk1@comcast.net>
Cc: Dave Young <hidave.darkstar@gmail.com>,
Marcel Holtmann <marcel@holtmann.org>,
LKML <linux-kernel@vger.kernel.org>,
Jiri Kosina <jkosina@suse.cz>, Ingo Molnar <mingo@elte.hu>
Subject: Re: Kernel oops with bluetooth usb dongle
Date: Thu, 21 Feb 2008 20:37:08 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.1.00.0802212024310.7583@apollo.tec.linutronix.de> (raw)
In-Reply-To: <022120081649.19368.47BDAB89000C038700004BA82207300793CE05040A05@comcast.net>
On Thu, 21 Feb 2008, Quel Qun wrote:
> > > > Not that I'm aware off, but this might as well be some old use after
> > > > free bug which got exposed by some unrelated change. The good news is
> > > > that it is reproducible. I'll hack up some nasty debug patch which
> > > > lets us - hopefully - decode where the timer was armed.
> > >
> > > Quel, before I do that, is there any chance that you retest with the
> > > latest mainline git version ?
> > >
> > >
> > http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-2.6.25-rc2-git4.bz2
> >
> > And please test with this patch as well:
> >
> > http://lkml.org/lkml/2008/2/20/121
> >
> Same kind of result unfortunately with this last patch on top of git4:
At least it is fully reproducible. Please apply the patch below to
your git4 tree and do not change your .config. The output should show,
which code armed the timer.
Thanks,
tglx
Index: linux-2.6/kernel/timer.c
===================================================================
--- linux-2.6.orig/kernel/timer.c
+++ linux-2.6/kernel/timer.c
@@ -58,6 +58,40 @@ EXPORT_SYMBOL(jiffies_64);
#define TVN_MASK (TVN_SIZE - 1)
#define TVR_MASK (TVR_SIZE - 1)
+struct timer_trace {
+ struct timer_list *timer;
+ void *fn;
+ void *addr;
+};
+
+#define TTRACE_SIZE 4096
+static struct timer_trace ttrace[TTRACE_SIZE];
+static int ttrace_idx;
+static DEFINE_SPINLOCK(ttrace_lock);
+
+void ttrace_find_timer(struct timer_list *timer)
+{
+ char symname[KSYM_NAME_LEN];
+
+ unsigned long flags;
+ int i;
+
+ spin_lock_irqsave(&ttrace_lock, flags);
+ for (i = 0; i < TTRACE_SIZE; i++) {
+ if (ttrace[i].timer == timer) {
+ printk(KERN_ERR "TTRACE timer %p fn %p addr %p\n",
+ ttrace[i].timer, ttrace[i].fn, ttrace[i].addr);
+ if (lookup_symbol_name((unsigned long) ttrace[i].fn,
+ symname) == 0)
+ printk(KERN_ERR "TTRACE fn %s\n", symname);
+ if (lookup_symbol_name((unsigned long) ttrace[i].addr,
+ symname) == 0)
+ printk(KERN_ERR "TTRACE addr %s\n", symname);
+ }
+ }
+ spin_unlock_irqrestore(&ttrace_lock, flags);
+}
+
struct tvec {
struct list_head vec[TVN_SIZE];
};
@@ -395,6 +429,13 @@ int __mod_timer(struct timer_list *timer
unsigned long flags;
int ret = 0;
+ spin_lock_irqsave(&ttrace_lock, flags);
+ ttrace[ttrace_idx].timer = timer;
+ ttrace[ttrace_idx].fn = timer->function;
+ ttrace[ttrace_idx].addr = __builtin_return_address(0);
+ ttrace_idx = (ttrace_idx + 1) & (TTRACE_SIZE - 1);
+ spin_unlock_irqrestore(&ttrace_lock, flags);
+
timer_stats_timer_set_start_info(timer);
BUG_ON(!timer->function);
@@ -687,6 +728,14 @@ static unsigned long __next_timer_interr
/* Look for timer events in tv1. */
index = slot = timer_jiffies & TVR_MASK;
do {
+ struct list_head *tmp;
+
+ __list_for_each(tmp, base->tv1.vec + slot) {
+ nte = (struct timer_list *) tmp;
+ if (nte->entry.next == (void *)0x6b6b6b6b)
+ ttrace_find_timer(nte);
+ }
+
list_for_each_entry(nte, base->tv1.vec + slot, entry) {
if (tbase_get_deferrable(nte->base))
continue;
next prev parent reply other threads:[~2008-02-21 19:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-21 16:49 Quel Qun
2008-02-21 19:37 ` Thomas Gleixner [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-02-26 15:49 Quel Qun
2008-02-26 0:03 Quel Qun
2008-02-26 3:13 ` Marcel Holtmann
2008-02-28 1:03 ` Dave Young
2008-02-28 1:37 ` Dave Young
2008-02-22 2:40 Quel Qun
2008-02-22 3:23 ` Dave Young
2008-02-22 7:23 ` Thomas Gleixner
2008-02-22 11:34 ` David Woodhouse
2008-02-22 11:43 ` Thomas Gleixner
2008-02-18 0:01 Quel Qun
2008-02-18 12:43 ` Sebastian Siewior
2008-02-18 13:12 ` Thomas Gleixner
2008-02-19 21:07 ` Marcel Holtmann
2008-02-20 0:14 ` Thomas Gleixner
2008-02-20 8:11 ` Thomas Gleixner
2008-02-21 7:30 ` Dave Young
2008-02-16 21:37 Quel Qun
2008-02-16 23:59 ` Thomas Gleixner
2008-02-16 0:41 Quel Qun
2008-02-16 11:05 ` Jiri Kosina
2008-02-16 11:50 ` Thomas Gleixner
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=alpine.LFD.1.00.0802212024310.7583@apollo.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=hidave.darkstar@gmail.com \
--cc=jkosina@suse.cz \
--cc=kelk1@comcast.net \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=mingo@elte.hu \
--subject='Re: Kernel oops with bluetooth usb dongle' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).