linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Found few memory leaks in gatt-client
@ 2015-04-02 10:01 Gowtham Anandha Babu
  2015-04-08 10:30 ` Gowtham Anandha Babu
  0 siblings, 1 reply; 4+ messages in thread
From: Gowtham Anandha Babu @ 2015-04-02 10:01 UTC (permalink / raw)
  To: 'BlueZ devel list'; +Cc: 'Bharat Bhusan Panda'

Hi All,

Found few memory leaks when testing the prepare write and execute write
using btgatt-client tool with PTS 6.0.1. Below are the logs for the same.

~/latest_bluez/bluez$  MALLOC_CHECK_=3 MALLOC_PERTURB_=69 valgrind
--trace-children=yes --track-origins=yes --show-possibly-lost=no
--leak-check=full -v ./tools/btgatt-client -i hci0 -d 00:1B:DC:07:33:4E

[GATT client]# write-prepare -s 0 0x00cd 00 00 03
--18895-- REDIR: 0x4ec2c10 (memchr) redirected to 0x4c2f390 (memchr)
--18895-- REDIR: 0x4ec8780 (__GI_memcpy) redirected to 0x4c2fc90
(__GI_memcpy)
--18895-- REDIR: 0x4ebe070 (strcmp) redirected to 0x4a25720
(_vgnU_ifunc_wrapper)
--18895-- REDIR: 0x4eced20 (__strcmp_sse2_unaligned) redirected to 0x4c2f1b0
(strcmp)
Prepare write success.
Session id: 1 to be used on next write
[GATT client]# Write successful
[GATT client]# write-execute 1 1 
[GATT client]# 
Write successful
[GATT client]# ^C

Shutting down...
==18895== 
==18895== HEAP SUMMARY:
==18895==     in use at exit: 2,862 bytes in 86 blocks
==18895==   total heap usage: 1,305 allocs, 1,219 frees, 49,976 bytes
allocated
==18895== 
==18895== Searching for pointers to 86 not-freed blocks
==18895== Checked 91,288 bytes
==18895== 
==18895== 46 (40 direct, 6 indirect) bytes in 1 blocks are definitely lost
in loss record 2 of 4
==18895==    at 0x4C2CC70: calloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18895==    by 0x4093E0: bt_gatt_client_prepare_write (gatt-client.c:2690)
==18895==    by 0x4031A7: cmd_write_prepare (btgatt-client.c:1015)
==18895==    by 0x4028F0: prompt_read_cb (btgatt-client.c:1402)
==18895==    by 0x40C7B2: mainloop_run (mainloop.c:157)
==18895==    by 0x401FC4: main (btgatt-client.c:1658)
==18895== 
==18895== 2,656 bytes in 83 blocks are definitely lost in loss record 4 of 4
==18895==    at 0x4C2AB80: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18895==    by 0x40C8D9: mainloop_add_timeout (mainloop.c:327)
==18895==    by 0x40C342: timeout_add (timeout-mainloop.c:69)
==18895==    by 0x404AE2: can_write_data (att.c:504)
==18895==    by 0x40BEDE: io_callback (io-mainloop.c:138)
==18895==    by 0x40C7B2: mainloop_run (mainloop.c:157)
==18895==    by 0x401FC4: main (btgatt-client.c:1658)
==18895== 
==18895== LEAK SUMMARY:
==18895==    definitely lost: 2,696 bytes in 84 blocks
==18895==    indirectly lost: 6 bytes in 1 blocks
==18895==      possibly lost: 0 bytes in 0 blocks
==18895==    still reachable: 160 bytes in 1 blocks
==18895==         suppressed: 0 bytes in 0 blocks
==18895== Reachable blocks (those to which a pointer was found) are not
shown.
==18895== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==18895== 
==18895== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
==18895== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

git - up-to-date
gcc - 4.9.2

Regards
Gowtham Anandha Babu


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Found few memory leaks in gatt-client
  2015-04-02 10:01 Found few memory leaks in gatt-client Gowtham Anandha Babu
@ 2015-04-08 10:30 ` Gowtham Anandha Babu
  2015-04-08 12:44   ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 4+ messages in thread
From: Gowtham Anandha Babu @ 2015-04-08 10:30 UTC (permalink / raw)
  To: 'BlueZ devel list'

Ping.

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Gowtham Anandha Babu
> Sent: Thursday, April 02, 2015 3:32 PM
> To: 'BlueZ devel list'
> Cc: 'Bharat Bhusan Panda'
> Subject: Found few memory leaks in gatt-client
> 
> Hi All,
> 
> Found few memory leaks when testing the prepare write and execute write
> using btgatt-client tool with PTS 6.0.1. Below are the logs for the same.
> 
> ~/latest_bluez/bluez$  MALLOC_CHECK_=3 MALLOC_PERTURB_=69 valgrind
> --trace-children=yes --track-origins=yes --show-possibly-lost=no --leak-
> check=full -v ./tools/btgatt-client -i hci0 -d 00:1B:DC:07:33:4E
> 
> [GATT client]# write-prepare -s 0 0x00cd 00 00 03
> --18895-- REDIR: 0x4ec2c10 (memchr) redirected to 0x4c2f390 (memchr)
> --18895-- REDIR: 0x4ec8780 (__GI_memcpy) redirected to 0x4c2fc90
> (__GI_memcpy)
> --18895-- REDIR: 0x4ebe070 (strcmp) redirected to 0x4a25720
> (_vgnU_ifunc_wrapper)
> --18895-- REDIR: 0x4eced20 (__strcmp_sse2_unaligned) redirected to
> 0x4c2f1b0
> (strcmp)
> Prepare write success.
> Session id: 1 to be used on next write
> [GATT client]# Write successful
> [GATT client]# write-execute 1 1
> [GATT client]#
> Write successful
> [GATT client]# ^C
> 
> Shutting down...
> ==18895==
> ==18895== HEAP SUMMARY:
> ==18895==     in use at exit: 2,862 bytes in 86 blocks
> ==18895==   total heap usage: 1,305 allocs, 1,219 frees, 49,976 bytes
> allocated
> ==18895==
> ==18895== Searching for pointers to 86 not-freed blocks ==18895== Checked
> 91,288 bytes ==18895== ==18895== 46 (40 direct, 6 indirect) bytes in 1
blocks
> are definitely lost in loss record 2 of 4
> ==18895==    at 0x4C2CC70: calloc (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==18895==    by 0x4093E0: bt_gatt_client_prepare_write
(gatt-client.c:2690)
> ==18895==    by 0x4031A7: cmd_write_prepare (btgatt-client.c:1015)
> ==18895==    by 0x4028F0: prompt_read_cb (btgatt-client.c:1402)
> ==18895==    by 0x40C7B2: mainloop_run (mainloop.c:157)
> ==18895==    by 0x401FC4: main (btgatt-client.c:1658)
> ==18895==
> ==18895== 2,656 bytes in 83 blocks are definitely lost in loss record 4 of
4
> ==18895==    at 0x4C2AB80: malloc (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==18895==    by 0x40C8D9: mainloop_add_timeout (mainloop.c:327)
> ==18895==    by 0x40C342: timeout_add (timeout-mainloop.c:69)
> ==18895==    by 0x404AE2: can_write_data (att.c:504)
> ==18895==    by 0x40BEDE: io_callback (io-mainloop.c:138)
> ==18895==    by 0x40C7B2: mainloop_run (mainloop.c:157)
> ==18895==    by 0x401FC4: main (btgatt-client.c:1658)
> ==18895==
> ==18895== LEAK SUMMARY:
> ==18895==    definitely lost: 2,696 bytes in 84 blocks
> ==18895==    indirectly lost: 6 bytes in 1 blocks
> ==18895==      possibly lost: 0 bytes in 0 blocks
> ==18895==    still reachable: 160 bytes in 1 blocks
> ==18895==         suppressed: 0 bytes in 0 blocks
> ==18895== Reachable blocks (those to which a pointer was found) are not
> shown.
> ==18895== To see them, rerun with: --leak-check=full --show-leak-kinds=all
> ==18895== ==18895== ERROR SUMMARY: 2 errors from 2 contexts
> (suppressed: 0 from 0) ==18895== ERROR SUMMARY: 2 errors from 2
> contexts (suppressed: 0 from 0)
> 
> git - up-to-date
> gcc - 4.9.2
> 
> Regards
> Gowtham Anandha Babu
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
in
> the body of a message to majordomo@vger.kernel.org More majordomo
> info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Found few memory leaks in gatt-client
  2015-04-08 10:30 ` Gowtham Anandha Babu
@ 2015-04-08 12:44   ` Luiz Augusto von Dentz
  2015-04-08 12:53     ` Gowtham Anandha Babu
  0 siblings, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2015-04-08 12:44 UTC (permalink / raw)
  To: Gowtham Anandha Babu; +Cc: BlueZ devel list

Hi Gowtham,

On Wed, Apr 8, 2015 at 1:30 PM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> Ping.

I thought you would be looking into that, or you don't know how to fix it?

>> -----Original Message-----
>> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>> owner@vger.kernel.org] On Behalf Of Gowtham Anandha Babu
>> Sent: Thursday, April 02, 2015 3:32 PM
>> To: 'BlueZ devel list'
>> Cc: 'Bharat Bhusan Panda'
>> Subject: Found few memory leaks in gatt-client
>>
>> Hi All,
>>
>> Found few memory leaks when testing the prepare write and execute write
>> using btgatt-client tool with PTS 6.0.1. Below are the logs for the same.
>>
>> ~/latest_bluez/bluez$  MALLOC_CHECK_=3 MALLOC_PERTURB_=69 valgrind
>> --trace-children=yes --track-origins=yes --show-possibly-lost=no --leak-
>> check=full -v ./tools/btgatt-client -i hci0 -d 00:1B:DC:07:33:4E
>>
>> [GATT client]# write-prepare -s 0 0x00cd 00 00 03
>> --18895-- REDIR: 0x4ec2c10 (memchr) redirected to 0x4c2f390 (memchr)
>> --18895-- REDIR: 0x4ec8780 (__GI_memcpy) redirected to 0x4c2fc90
>> (__GI_memcpy)
>> --18895-- REDIR: 0x4ebe070 (strcmp) redirected to 0x4a25720
>> (_vgnU_ifunc_wrapper)
>> --18895-- REDIR: 0x4eced20 (__strcmp_sse2_unaligned) redirected to
>> 0x4c2f1b0
>> (strcmp)
>> Prepare write success.
>> Session id: 1 to be used on next write
>> [GATT client]# Write successful
>> [GATT client]# write-execute 1 1
>> [GATT client]#
>> Write successful
>> [GATT client]# ^C
>>
>> Shutting down...
>> ==18895==
>> ==18895== HEAP SUMMARY:
>> ==18895==     in use at exit: 2,862 bytes in 86 blocks
>> ==18895==   total heap usage: 1,305 allocs, 1,219 frees, 49,976 bytes
>> allocated
>> ==18895==
>> ==18895== Searching for pointers to 86 not-freed blocks ==18895== Checked
>> 91,288 bytes ==18895== ==18895== 46 (40 direct, 6 indirect) bytes in 1
> blocks
>> are definitely lost in loss record 2 of 4
>> ==18895==    at 0x4C2CC70: calloc (in
>> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
>> ==18895==    by 0x4093E0: bt_gatt_client_prepare_write
> (gatt-client.c:2690)
>> ==18895==    by 0x4031A7: cmd_write_prepare (btgatt-client.c:1015)
>> ==18895==    by 0x4028F0: prompt_read_cb (btgatt-client.c:1402)
>> ==18895==    by 0x40C7B2: mainloop_run (mainloop.c:157)
>> ==18895==    by 0x401FC4: main (btgatt-client.c:1658)
>> ==18895==
>> ==18895== 2,656 bytes in 83 blocks are definitely lost in loss record 4 of
> 4
>> ==18895==    at 0x4C2AB80: malloc (in
>> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
>> ==18895==    by 0x40C8D9: mainloop_add_timeout (mainloop.c:327)
>> ==18895==    by 0x40C342: timeout_add (timeout-mainloop.c:69)
>> ==18895==    by 0x404AE2: can_write_data (att.c:504)
>> ==18895==    by 0x40BEDE: io_callback (io-mainloop.c:138)
>> ==18895==    by 0x40C7B2: mainloop_run (mainloop.c:157)
>> ==18895==    by 0x401FC4: main (btgatt-client.c:1658)
>> ==18895==
>> ==18895== LEAK SUMMARY:
>> ==18895==    definitely lost: 2,696 bytes in 84 blocks
>> ==18895==    indirectly lost: 6 bytes in 1 blocks
>> ==18895==      possibly lost: 0 bytes in 0 blocks
>> ==18895==    still reachable: 160 bytes in 1 blocks
>> ==18895==         suppressed: 0 bytes in 0 blocks
>> ==18895== Reachable blocks (those to which a pointer was found) are not
>> shown.
>> ==18895== To see them, rerun with: --leak-check=full --show-leak-kinds=all
>> ==18895== ==18895== ERROR SUMMARY: 2 errors from 2 contexts
>> (suppressed: 0 from 0) ==18895== ERROR SUMMARY: 2 errors from 2
>> contexts (suppressed: 0 from 0)
>>
>> git - up-to-date
>> gcc - 4.9.2
>>
>> Regards
>> Gowtham Anandha Babu
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
> in
>> the body of a message to majordomo@vger.kernel.org More majordomo
>> info at  http://vger.kernel.org/majordomo-info.html
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Found few memory leaks in gatt-client
  2015-04-08 12:44   ` Luiz Augusto von Dentz
@ 2015-04-08 12:53     ` Gowtham Anandha Babu
  0 siblings, 0 replies; 4+ messages in thread
From: Gowtham Anandha Babu @ 2015-04-08 12:53 UTC (permalink / raw)
  To: 'Luiz Augusto von Dentz'; +Cc: 'BlueZ devel list'

Hi Luiz,

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
> Sent: Wednesday, April 08, 2015 6:15 PM
> To: Gowtham Anandha Babu
> Cc: BlueZ devel list
> Subject: Re: Found few memory leaks in gatt-client
> 
> Hi Gowtham,
> 
> On Wed, Apr 8, 2015 at 1:30 PM, Gowtham Anandha Babu
> <gowtham.ab@samsung.com> wrote:
> > Ping.
> 
> I thought you would be looking into that, or you don't know how to fix it?

I don’t know how to fix it.

> 
> >> -----Original Message-----
> >> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> >> owner@vger.kernel.org] On Behalf Of Gowtham Anandha Babu
> >> Sent: Thursday, April 02, 2015 3:32 PM
> >> To: 'BlueZ devel list'
> >> Cc: 'Bharat Bhusan Panda'
> >> Subject: Found few memory leaks in gatt-client
> >>
> >> Hi All,
> >>
> >> Found few memory leaks when testing the prepare write and execute
> >> write using btgatt-client tool with PTS 6.0.1. Below are the logs for the
> same.
> >>
> >> ~/latest_bluez/bluez$  MALLOC_CHECK_=3 MALLOC_PERTURB_=69
> valgrind
> >> --trace-children=yes --track-origins=yes --show-possibly-lost=no
> >> --leak- check=full -v ./tools/btgatt-client -i hci0 -d
> >> 00:1B:DC:07:33:4E
> >>
> >> [GATT client]# write-prepare -s 0 0x00cd 00 00 03
> >> --18895-- REDIR: 0x4ec2c10 (memchr) redirected to 0x4c2f390 (memchr)
> >> --18895-- REDIR: 0x4ec8780 (__GI_memcpy) redirected to 0x4c2fc90
> >> (__GI_memcpy)
> >> --18895-- REDIR: 0x4ebe070 (strcmp) redirected to 0x4a25720
> >> (_vgnU_ifunc_wrapper)
> >> --18895-- REDIR: 0x4eced20 (__strcmp_sse2_unaligned) redirected to
> >> 0x4c2f1b0
> >> (strcmp)
> >> Prepare write success.
> >> Session id: 1 to be used on next write [GATT client]# Write
> >> successful [GATT client]# write-execute 1 1 [GATT client]# Write
> >> successful [GATT client]# ^C
> >>
> >> Shutting down...
> >> ==18895==
> >> ==18895== HEAP SUMMARY:
> >> ==18895==     in use at exit: 2,862 bytes in 86 blocks
> >> ==18895==   total heap usage: 1,305 allocs, 1,219 frees, 49,976 bytes
> >> allocated
> >> ==18895==
> >> ==18895== Searching for pointers to 86 not-freed blocks ==18895==
> >> Checked
> >> 91,288 bytes ==18895== ==18895== 46 (40 direct, 6 indirect) bytes in
> >> 1
> > blocks
> >> are definitely lost in loss record 2 of 4
> >> ==18895==    at 0x4C2CC70: calloc (in
> >> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> >> ==18895==    by 0x4093E0: bt_gatt_client_prepare_write
> > (gatt-client.c:2690)
> >> ==18895==    by 0x4031A7: cmd_write_prepare (btgatt-client.c:1015)
> >> ==18895==    by 0x4028F0: prompt_read_cb (btgatt-client.c:1402)
> >> ==18895==    by 0x40C7B2: mainloop_run (mainloop.c:157)
> >> ==18895==    by 0x401FC4: main (btgatt-client.c:1658)
> >> ==18895==
> >> ==18895== 2,656 bytes in 83 blocks are definitely lost in loss record
> >> 4 of
> > 4
> >> ==18895==    at 0x4C2AB80: malloc (in
> >> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> >> ==18895==    by 0x40C8D9: mainloop_add_timeout (mainloop.c:327)
> >> ==18895==    by 0x40C342: timeout_add (timeout-mainloop.c:69)
> >> ==18895==    by 0x404AE2: can_write_data (att.c:504)
> >> ==18895==    by 0x40BEDE: io_callback (io-mainloop.c:138)
> >> ==18895==    by 0x40C7B2: mainloop_run (mainloop.c:157)
> >> ==18895==    by 0x401FC4: main (btgatt-client.c:1658)
> >> ==18895==
> >> ==18895== LEAK SUMMARY:
> >> ==18895==    definitely lost: 2,696 bytes in 84 blocks
> >> ==18895==    indirectly lost: 6 bytes in 1 blocks
> >> ==18895==      possibly lost: 0 bytes in 0 blocks
> >> ==18895==    still reachable: 160 bytes in 1 blocks
> >> ==18895==         suppressed: 0 bytes in 0 blocks
> >> ==18895== Reachable blocks (those to which a pointer was found) are
> >> not shown.
> >> ==18895== To see them, rerun with: --leak-check=full
> >> --show-leak-kinds=all ==18895== ==18895== ERROR SUMMARY: 2 errors
> >> from 2 contexts
> >> (suppressed: 0 from 0) ==18895== ERROR SUMMARY: 2 errors from 2
> >> contexts (suppressed: 0 from 0)
> >>
> >> git - up-to-date
> >> gcc - 4.9.2
> >>
> >> Regards
> >> Gowtham Anandha Babu
> >>
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
> > in
> >> the body of a message to majordomo@vger.kernel.org More majordomo
> >> info at  http://vger.kernel.org/majordomo-info.html
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-bluetooth" in the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 
> --
> Luiz Augusto von Dentz
> --

Regards,
Gowtham Anandha Babu

> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org More majordomo
> info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-08 12:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-02 10:01 Found few memory leaks in gatt-client Gowtham Anandha Babu
2015-04-08 10:30 ` Gowtham Anandha Babu
2015-04-08 12:44   ` Luiz Augusto von Dentz
2015-04-08 12:53     ` Gowtham Anandha Babu

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).