From: Jarek Poplawski <jarkao2@gmail.com>
To: Bernard Pidoux <bernard.pidoux@upmc.fr>
Cc: Ralf Baechle DL5RB <ralf@linux-mips.org>,
Linux Netdev List <netdev@vger.kernel.org>,
linux-hams <linux-hams@vger.kernel.org>
Subject: Re: [AX25] kernel panic
Date: Sun, 20 Sep 2009 23:02:42 +0200 [thread overview]
Message-ID: <20090920210242.GA9804@del.dom.local> (raw)
In-Reply-To: <4AB5EAE5.6070605@upmc.fr>
On Sun, Sep 20, 2009 at 10:42:13AM +0200, Bernard Pidoux wrote:
> Hi,
>
> Here are the first events noticed since I turned on
> CONFIG_DEBUG_OBJECTS_TIMERS option.
>
> First a kernel BUG, second a kernel panic.
...
> ------------[ cut here ]------------
> kernel BUG at kernel/timer.c:913!
Alas this BUG doesn't show much (this new debugging didn't trigger
here). Maybe the patch below will be luckier.
Best regards,
Jarek P.
---
include/net/ax25.h | 36 ++++++++++++++++++++++++++++++++++++
net/ax25/af_ax25.c | 3 +++
2 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 717e219..e8f6e33 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -252,9 +252,45 @@ typedef struct ax25_cb {
#define ax25_cb_hold(__ax25) \
atomic_inc(&((__ax25)->refcount))
+static __inline__ int ax25_timers_warn(ax25_cb *ax25)
+{
+ int err = 0;
+
+ if (del_timer(&ax25->timer)) {
+ WARN_ON_ONCE(1);
+ err = 1;
+ }
+ if (del_timer(&ax25->t1timer)) {
+ WARN_ON_ONCE(1);
+ err += 2;
+ }
+ if (del_timer(&ax25->t2timer)) {
+ WARN_ON_ONCE(1);
+ err += 4;
+ }
+ if (del_timer(&ax25->t3timer)) {
+ WARN_ON_ONCE(1);
+ err += 8;
+ }
+ if (del_timer(&ax25->idletimer)) {
+ WARN_ON_ONCE(1);
+ err += 16;
+ }
+ if (del_timer(&ax25->dtimer)) {
+ WARN_ON_ONCE(1);
+ err += 32;
+ }
+ if (err)
+ printk(KERN_WARNING "AX25_DBG: %d %p %u\n", err, ax25,
+ ax25->state);
+
+ return err;
+}
+
static __inline__ void ax25_cb_put(ax25_cb *ax25)
{
if (atomic_dec_and_test(&ax25->refcount)) {
+ ax25_timers_warn(ax25);
kfree(ax25->digipeat);
kfree(ax25);
}
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index da0f64f..f443fe0 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -58,6 +58,9 @@ static const struct proto_ops ax25_proto_ops;
static void ax25_free_sock(struct sock *sk)
{
+ if (ax25_timers_warn(ax25_sk(sk)))
+ printk(KERN_WARNING "AX25_DBG: %p %u %u %u\n", sk,
+ sk->sk_family, sk->sk_type, sk->sk_protocol);
ax25_cb_put(ax25_sk(sk));
}
next prev parent reply other threads:[~2009-09-20 21:02 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-09 22:28 [AX25] kernel panic Bernard Pidoux
2009-09-11 19:21 ` Jarek Poplawski
2009-09-15 10:16 ` Bernard Pidoux
[not found] ` <20090910142436.GB10547@linux-mips.org>
[not found] ` <4AA9288B.2070205@upmc.fr>
[not found] ` <20090911120557.GA12175@linux-mips.org>
2009-09-20 8:42 ` Bernard Pidoux
2009-09-20 9:09 ` f8arr
2009-09-20 21:02 ` Jarek Poplawski [this message]
2009-09-21 8:44 ` Bernard Pidoux
-- strict thread matches above, loose matches on Subject: below --
2009-09-21 20:11 Jarek Poplawski
2009-09-23 21:17 ` Bernard Pidoux F6BVP
2009-09-24 8:07 ` Jarek Poplawski
2008-03-18 10:44 Bernard Pidoux F6BVP
2008-03-18 21:25 ` Francois Romieu
2008-03-19 7:36 ` Bernard Pidoux F6BVP
2008-03-19 20:57 ` Bernard Pidoux
2008-03-20 7:30 ` Jarek Poplawski
2008-03-20 22:58 ` Bernard Pidoux
2008-03-21 0:28 ` Jarek Poplawski
2008-03-21 9:52 ` Bernard Pidoux
2008-03-21 11:22 ` Jarek Poplawski
2008-03-21 9:40 ` Bernard Pidoux
2008-03-22 11:36 ` Jarek Poplawski
2008-03-23 17:00 ` Bernard Pidoux
2008-03-24 20:51 ` Jarek Poplawski
2008-03-25 13:23 ` Bernard Pidoux
2008-03-25 20:51 ` Jarek Poplawski
2008-03-26 18:35 ` Jarek Poplawski
2008-03-28 8:24 ` Bernard Pidoux
2008-03-28 8:27 ` Bernard Pidoux
2008-03-28 12:07 ` Jarek Poplawski
2008-03-29 12:04 ` Bernard Pidoux
2008-03-29 12:24 ` Jarek Poplawski
2008-03-30 8:43 ` Bernard Pidoux
2008-03-30 9:16 ` Jarek Poplawski
2008-03-30 17:38 ` Bernard Pidoux
2008-03-30 18:49 ` Jarek Poplawski
2008-03-30 9:00 ` Bernard Pidoux
[not found] ` <47EE38BA.9090500@free.fr>
[not found] ` <20080329130451.GC3407@ami.dom.local>
[not found] ` <47EF6479.7030702@free.fr>
[not found] ` <20080330115958.GA4975@ami.dom.local>
2008-04-01 20:37 ` Bernard Pidoux
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=20090920210242.GA9804@del.dom.local \
--to=jarkao2@gmail.com \
--cc=bernard.pidoux@upmc.fr \
--cc=linux-hams@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ralf@linux-mips.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;
as well as URLs for NNTP newsgroup(s).