* [PATCH] jack: Fixing a small memory leak
@ 2015-08-11 6:37 Valentin Corfu
2015-08-11 7:39 ` Takashi Iwai
0 siblings, 1 reply; 5+ messages in thread
From: Valentin Corfu @ 2015-08-11 6:37 UTC (permalink / raw)
To: alsa-devel; +Cc: Valentin Corfu
A small memory leak can be observed when using alsa-plugins (jack).
Check the following valgrind log:
...
==1034== 8 bytes in 1 blocks are definitely lost in loss record 7 of 108
==1034== at 0x4027E5A: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==1034== by 0x4035102: snd_pcm_jack_prepare (in /usr/lib/alsa-lib/libasound_module_pcm_jack.so)
==1034== by 0x40D07AB: snd_pcm_ioplug_prepare (pcm_ioplug.c:145)
==1034== by 0x4084961: snd_pcm_prepare (pcm.c:1052)
==1034== by 0x409DDB4: snd_pcm_plugin_prepare (pcm_plugin.c:162)
==1034== by 0x4084961: snd_pcm_prepare (pcm.c:1052)
==1034== by 0x409DDB4: snd_pcm_plugin_prepare (pcm_plugin.c:162)
==1034== by 0x4084961: snd_pcm_prepare (pcm.c:1052)
==1034== by 0x4084A1D: snd_pcm_hw_params (pcm.c:838)
==1034== by 0x4090013: snd_pcm_set_params (pcm.c:8053)
==1034== by 0x80486EB: main (in /root/pcm_min_ok)
...
==1034== LEAK SUMMARY:
==1034== definitely lost: 8 bytes in 1 blocks
==1034== indirectly lost: 0 bytes in 0 blocks
==1034== possibly lost: 31,311 bytes in 1,630 blocks
==1034== still reachable: 5,619 bytes in 24 blocks
==1034== suppressed: 0 bytes in 0 blocks
...
Signed-off-by: Valentin Corfu <corfuvalentin@gmail.com>
---
jack/pcm_jack.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/jack/pcm_jack.c b/jack/pcm_jack.c
index 568ec43..de9c46e 100644
--- a/jack/pcm_jack.c
+++ b/jack/pcm_jack.c
@@ -103,6 +103,7 @@ static void snd_pcm_jack_free(snd_pcm_jack_t *jack)
if (jack->io.poll_fd >= 0)
close(jack->io.poll_fd);
free(jack->areas);
+ free(jack->ports);
free(jack);
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] jack: Fixing a small memory leak
2015-08-11 6:37 [PATCH] jack: Fixing a small memory leak Valentin Corfu
@ 2015-08-11 7:39 ` Takashi Iwai
2015-08-11 7:43 ` Valentin Corfu
0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2015-08-11 7:39 UTC (permalink / raw)
To: Valentin Corfu; +Cc: alsa-devel
On Tue, 11 Aug 2015 08:37:14 +0200,
Valentin Corfu wrote:
>
> A small memory leak can be observed when using alsa-plugins (jack).
> Check the following valgrind log:
> ...
> ==1034== 8 bytes in 1 blocks are definitely lost in loss record 7 of 108
> ==1034== at 0x4027E5A: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
> ==1034== by 0x4035102: snd_pcm_jack_prepare (in /usr/lib/alsa-lib/libasound_module_pcm_jack.so)
> ==1034== by 0x40D07AB: snd_pcm_ioplug_prepare (pcm_ioplug.c:145)
> ==1034== by 0x4084961: snd_pcm_prepare (pcm.c:1052)
> ==1034== by 0x409DDB4: snd_pcm_plugin_prepare (pcm_plugin.c:162)
> ==1034== by 0x4084961: snd_pcm_prepare (pcm.c:1052)
> ==1034== by 0x409DDB4: snd_pcm_plugin_prepare (pcm_plugin.c:162)
> ==1034== by 0x4084961: snd_pcm_prepare (pcm.c:1052)
> ==1034== by 0x4084A1D: snd_pcm_hw_params (pcm.c:838)
> ==1034== by 0x4090013: snd_pcm_set_params (pcm.c:8053)
> ==1034== by 0x80486EB: main (in /root/pcm_min_ok)
> ...
> ==1034== LEAK SUMMARY:
> ==1034== definitely lost: 8 bytes in 1 blocks
> ==1034== indirectly lost: 0 bytes in 0 blocks
> ==1034== possibly lost: 31,311 bytes in 1,630 blocks
> ==1034== still reachable: 5,619 bytes in 24 blocks
> ==1034== suppressed: 0 bytes in 0 blocks
> ...
>
> Signed-off-by: Valentin Corfu <corfuvalentin@gmail.com>
Applied, thanks.
Takashi
> ---
> jack/pcm_jack.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/jack/pcm_jack.c b/jack/pcm_jack.c
> index 568ec43..de9c46e 100644
> --- a/jack/pcm_jack.c
> +++ b/jack/pcm_jack.c
> @@ -103,6 +103,7 @@ static void snd_pcm_jack_free(snd_pcm_jack_t *jack)
> if (jack->io.poll_fd >= 0)
> close(jack->io.poll_fd);
> free(jack->areas);
> + free(jack->ports);
> free(jack);
> }
> }
> --
> 1.9.1
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] jack: Fixing a small memory leak
2015-08-11 7:39 ` Takashi Iwai
@ 2015-08-11 7:43 ` Valentin Corfu
0 siblings, 0 replies; 5+ messages in thread
From: Valentin Corfu @ 2015-08-11 7:43 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
I also thank you, for your implication.
Have a nice day,
Valentin Corfu
On 11.08.2015 10:39, Takashi Iwai wrote:
> On Tue, 11 Aug 2015 08:37:14 +0200,
> Valentin Corfu wrote:
>> A small memory leak can be observed when using alsa-plugins (jack).
>> Check the following valgrind log:
>> ...
>> ==1034== 8 bytes in 1 blocks are definitely lost in loss record 7 of 108
>> ==1034== at 0x4027E5A: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
>> ==1034== by 0x4035102: snd_pcm_jack_prepare (in /usr/lib/alsa-lib/libasound_module_pcm_jack.so)
>> ==1034== by 0x40D07AB: snd_pcm_ioplug_prepare (pcm_ioplug.c:145)
>> ==1034== by 0x4084961: snd_pcm_prepare (pcm.c:1052)
>> ==1034== by 0x409DDB4: snd_pcm_plugin_prepare (pcm_plugin.c:162)
>> ==1034== by 0x4084961: snd_pcm_prepare (pcm.c:1052)
>> ==1034== by 0x409DDB4: snd_pcm_plugin_prepare (pcm_plugin.c:162)
>> ==1034== by 0x4084961: snd_pcm_prepare (pcm.c:1052)
>> ==1034== by 0x4084A1D: snd_pcm_hw_params (pcm.c:838)
>> ==1034== by 0x4090013: snd_pcm_set_params (pcm.c:8053)
>> ==1034== by 0x80486EB: main (in /root/pcm_min_ok)
>> ...
>> ==1034== LEAK SUMMARY:
>> ==1034== definitely lost: 8 bytes in 1 blocks
>> ==1034== indirectly lost: 0 bytes in 0 blocks
>> ==1034== possibly lost: 31,311 bytes in 1,630 blocks
>> ==1034== still reachable: 5,619 bytes in 24 blocks
>> ==1034== suppressed: 0 bytes in 0 blocks
>> ...
>>
>> Signed-off-by: Valentin Corfu <corfuvalentin@gmail.com>
> Applied, thanks.
>
>
> Takashi
>
>> ---
>> jack/pcm_jack.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/jack/pcm_jack.c b/jack/pcm_jack.c
>> index 568ec43..de9c46e 100644
>> --- a/jack/pcm_jack.c
>> +++ b/jack/pcm_jack.c
>> @@ -103,6 +103,7 @@ static void snd_pcm_jack_free(snd_pcm_jack_t *jack)
>> if (jack->io.poll_fd >= 0)
>> close(jack->io.poll_fd);
>> free(jack->areas);
>> + free(jack->ports);
>> free(jack);
>> }
>> }
>> --
>> 1.9.1
>>
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>
^ permalink raw reply [flat|nested] 5+ messages in thread
* jack: Fixing a small memory leak
@ 2015-08-10 14:58 Valentin Corfu
2015-08-10 14:58 ` [PATCH] " Valentin Corfu
0 siblings, 1 reply; 5+ messages in thread
From: Valentin Corfu @ 2015-08-10 14:58 UTC (permalink / raw)
To: alsa-devel
Hello Alsa developers,
I observed a small memory leak in alsa-plugins (jack):
...
==1034==
==1034== 8 bytes in 1 blocks are definitely lost in loss record 7 of 108
==1034== at 0x4027E5A: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==1034== by 0x4035102: snd_pcm_jack_prepare (in /usr/lib/alsa-lib/libasound_module_pcm_jack.so)
==1034== by 0x40D07AB: snd_pcm_ioplug_prepare (pcm_ioplug.c:145)
==1034== by 0x4084961: snd_pcm_prepare (pcm.c:1052)
==1034== by 0x409DDB4: snd_pcm_plugin_prepare (pcm_plugin.c:162)
==1034== by 0x4084961: snd_pcm_prepare (pcm.c:1052)
==1034== by 0x409DDB4: snd_pcm_plugin_prepare (pcm_plugin.c:162)
==1034== by 0x4084961: snd_pcm_prepare (pcm.c:1052)
==1034== by 0x4084A1D: snd_pcm_hw_params (pcm.c:838)
==1034== by 0x4090013: snd_pcm_set_params (pcm.c:8053)
==1034== by 0x80486EB: main (in /root/pcm_min_ok)
...
==1034== LEAK SUMMARY:
==1034== definitely lost: 8 bytes in 1 blocks
==1034== indirectly lost: 0 bytes in 0 blocks
==1034== possibly lost: 31,311 bytes in 1,630 blocks
==1034== still reachable: 5,619 bytes in 24 blocks
==1034== suppressed: 0 bytes in 0 blocks
==1034== Reachable blocks (those to which a pointer was found) are not shown.
==1034== To see them, rerun with: --leak-check=full --show-leak-kinds=all
...
Best Regards,
Valentin Corfu
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] jack: Fixing a small memory leak
2015-08-10 14:58 Valentin Corfu
@ 2015-08-10 14:58 ` Valentin Corfu
2015-08-10 15:09 ` Takashi Iwai
0 siblings, 1 reply; 5+ messages in thread
From: Valentin Corfu @ 2015-08-10 14:58 UTC (permalink / raw)
To: alsa-devel; +Cc: Valentin Corfu
Signed-off-by: Valentin Corfu <corfuvalentin@gmail.com>
---
jack/pcm_jack.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/jack/pcm_jack.c b/jack/pcm_jack.c
index 568ec43..de9c46e 100644
--- a/jack/pcm_jack.c
+++ b/jack/pcm_jack.c
@@ -103,6 +103,7 @@ static void snd_pcm_jack_free(snd_pcm_jack_t *jack)
if (jack->io.poll_fd >= 0)
close(jack->io.poll_fd);
free(jack->areas);
+ free(jack->ports);
free(jack);
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] jack: Fixing a small memory leak
2015-08-10 14:58 ` [PATCH] " Valentin Corfu
@ 2015-08-10 15:09 ` Takashi Iwai
0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2015-08-10 15:09 UTC (permalink / raw)
To: Valentin Corfu; +Cc: alsa-devel
On Mon, 10 Aug 2015 16:58:26 +0200,
Valentin Corfu wrote:
>
> Signed-off-by: Valentin Corfu <corfuvalentin@gmail.com>
So you found out the very same fix :)
But please put more description in the commit log. For example, the
valgrind output you cited would be a good material.
thanks,
Takashi
> ---
> jack/pcm_jack.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/jack/pcm_jack.c b/jack/pcm_jack.c
> index 568ec43..de9c46e 100644
> --- a/jack/pcm_jack.c
> +++ b/jack/pcm_jack.c
> @@ -103,6 +103,7 @@ static void snd_pcm_jack_free(snd_pcm_jack_t *jack)
> if (jack->io.poll_fd >= 0)
> close(jack->io.poll_fd);
> free(jack->areas);
> + free(jack->ports);
> free(jack);
> }
> }
> --
> 1.9.1
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-11 7:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-11 6:37 [PATCH] jack: Fixing a small memory leak Valentin Corfu
2015-08-11 7:39 ` Takashi Iwai
2015-08-11 7:43 ` Valentin Corfu
-- strict thread matches above, loose matches on Subject: below --
2015-08-10 14:58 Valentin Corfu
2015-08-10 14:58 ` [PATCH] " Valentin Corfu
2015-08-10 15:09 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox