linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: "Gustavo F. Padovan" <gustavo@padovan.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	Linux Bluetooth mailing list <linux-bluetooth@vger.kernel.org>
Subject: Re: Memory leak in btusb
Date: Sat, 06 Jun 2015 16:38:24 -0500	[thread overview]
Message-ID: <55736850.4050406@lwfinger.net> (raw)
In-Reply-To: <C04EFF03-5661-4BFC-893F-4BFFB99CAD03@holtmann.org>

On 06/06/2015 01:31 PM, Marcel Holtmann wrote:
> Hi Larry,
>
> since the interrupt endpoint is only used for HCI events, you do not even need connections. This could be anything simple like HCI command complete event.
>
> Now I wonder if this is something odd where the HCI event fits completely into a single interrupt URB or something special like that. If you get get the content of that URB, then I might be able to track this down. Or do you have a chance to run btmon and correlate the timestamps.

Synchronizing the timing between kmemleak and btmon is a little difficult as the 
former reports time only in jiffies and seconds before present. I will keep 
looking, but I think the leaked allocation happened at roughly 16:17:52. The 
only things that btmon logged are

> HCI Event: Number of Completed Packets (0x13) plen 5
                                      [hci0] 8
         Num handles: 1
         Handle: 256
         Count: 1
> ACL Data RX: Handle 256 flags 0x02 dlen 12
                                      [hci0] 16:18:49.598733
       L2CAP: Disconnection Response (0x07) ident 4 len 4
         Destination CID: 65
         Source CID: 64
< HCI Command: Read Clock Offset (0x01|0x001f) plen 2 
           [hci0] 16:18:51.601920
         Handle: 256
> HCI Event: Command Status (0x0f) plen 4
                                      [hci0] 16:18:51.602808
       Read Clock Offset (0x01|0x001f) ncmd 1
         Status: Success (0x00)
< HCI Command: Disconnect (0x01|0x0006) plen 3 
    [hci0] 16:18:51.603069
         Handle: 256
         Reason: Remote User Terminated Connection (0x13)
> HCI Event: Command Status (0x0f) plen 4
                                      [hci0] 16:18:51.603750
       Disconnect (0x01|0x0006) ncmd 1
         Status: Success (0x00)
> HCI Event: Read Clock Offset Complete (0x1c) plen 5
                                      [hci0] 16:18:51.606847
         Status: Success (0x00)
         Handle: 256
         Clock offset: 0x4568
> HCI Event: Disconnect Complete (0x05) plen 4
                                      [hci0] 16:18:51.687885
         Status: Success (0x00)
         Handle: 256
         Reason: Connection Terminated By Local Host (0x16)
@ Device Disconnected: 00:26:5F:D4:27:72 (0) reason 2
< HCI Command: Write Scan Enable (0x03|0x001a) plen 1 
           [hci0] 16:18:51.701737
         Scan enable: Page Scan (0x02)
> HCI Event: Command Complete (0x0e) plen 4
                                      [hci0] 16:18:51.702749
       Write Scan Enable (0x03|0x001a) ncmd 2
         Status: Success (0x00)
@ Device Removed: 00:26:5F:D4:27:72 (0)
< HCI Command: Write Scan Enable (0x03|0x001a) plen 1 
           [hci0] 16:19:04.771489
         Scan enable: No Scans (0x00)

Sorry, previous message sent early by mistake.

Is it possible that the Disconnect event is the source of the leak?

I will try to coordinate the clocks.

Larry

  parent reply	other threads:[~2015-06-06 21:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25 21:01 Memory leak in btusb Larry Finger
2015-06-06  6:20 ` Marcel Holtmann
2015-06-06  6:23 ` Marcel Holtmann
2015-06-06 16:03   ` Larry Finger
2015-06-06 16:37 ` Marcel Holtmann
2015-06-06 18:03   ` Larry Finger
2015-06-06 18:31     ` Marcel Holtmann
2015-06-06 21:31       ` Larry Finger
2015-06-06 21:38       ` Larry Finger [this message]
2015-06-06 22:54         ` Marcel Holtmann

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=55736850.4050406@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=gustavo@padovan.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.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).