From: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
To: laurent vaudoit <laurent.vaudoit@gmail.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>, linux-can@vger.kernel.org
Subject: Re: J1939 crash after receiving BAM frame and no DT frame
Date: Fri, 4 Dec 2015 15:04:14 +0100 [thread overview]
Message-ID: <20151204140414.GA24723@airbook.eia.lan> (raw)
In-Reply-To: <CAA7hF3xDeRRg3LXyfzWtY_DxmMUM8bL=sxvRcAEwHr_G4GsZ=A@mail.gmail.com>
> On Wed, Nov 25, 2015 at 3:59 PM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> > On 11/25/2015 02:39 PM, laurent vaudoit wrote:
> >>>> i have found a workaround, working with rtpatch, but not sure if this
> >>>> can be considered as a bug fix or not.
> >>>> in function j1939tp_rxtask, there is a call to j1939session_cancel,
> >>>> who call put_session
> >>>> and at the end of j1939tp_rxtask, we call put_session.
> >>>> if i comment this "second call" to put_session, the problem disappear.
> >>>
> >>> It seems that you added a memory leak because put_session if a ref
> >>> counter. You keep the session installed ... forever, or until a next
> >>> similar session is about to be created.
> >>>
> >>> I'm not sure either that this is the correct way to proceed.
> >>
> >> i'm not sure i understand well.
> >> this seems weird for me to have one get_session and 2 put_session
> >> should'nt we have one get_session and one put_session only? (this is
> >> what i tried)?
When you come to the point where you want to get rid of the session,
you need decrement the refcounter to become zero.
This extra put_session compensates the initial 1 in the refcounter.
I still don't see where it goes wrong. Can you experiment with disabling
individual lines in j1939session_destroy()? Since problems occur only
later, I suspect that the call to skb_free is causing the issue, but I'm
not sure.
Kurt
prev parent reply other threads:[~2015-12-04 14:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 15:24 J1939 crash after receiving BAM frame and no DT frame laurent vaudoit
2015-11-23 12:51 ` Kurt Van Dijck
2015-11-23 20:09 ` Kurt Van Dijck
2015-11-25 10:28 ` laurent vaudoit
2015-11-25 13:26 ` Kurt Van Dijck
2015-11-25 13:39 ` laurent vaudoit
2015-11-25 14:59 ` Marc Kleine-Budde
2015-11-25 15:16 ` laurent vaudoit
2015-12-04 14:04 ` Kurt Van Dijck [this message]
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=20151204140414.GA24723@airbook.eia.lan \
--to=dev.kurt@vandijck-laurijssen.be \
--cc=laurent.vaudoit@gmail.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
/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.