All of lore.kernel.org
 help / color / mirror / Atom feed
* memory leaks?
@ 2005-03-27  4:14 Lee Revell
  2005-03-29 12:27 ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Revell @ 2005-03-27  4:14 UTC (permalink / raw)
  To: alsa-devel

I recently started getting these messages every time I relaod my ALSA modules:

usbcore: registered new driver snd-usb-audio
usbcore: deregistering driver snd-usb-audio
ALSA /home/rlrevell/cvs/alsa/alsa-driver/usb/usbmidi.c:178: urb status -108
ALSA /home/rlrevell/cvs/alsa/alsa-driver/usb/usbmidi.c:163: usb_submit_urb: -90
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:71: Not freed snd_alloc_kmalloc = 864
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(164) from e0979806 not freed
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(268) from e09796fe not freed
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(164) from e0979806 not freed
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(268) from e09796fe not freed
PCI: Found IRQ 7 for device 0000:00:0f.0
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:71: Not freed snd_alloc_kmalloc = 432
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(164) from e098a806 not freed
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(268) from e098a6fe not freed
(     ksoftirqd/0-2    |#0): new 48 us maximum-latency wakeup.
PCI: Found IRQ 7 for device 0000:00:0f.0
usb 2-2: USB disconnect, address 3
(          IRQ 12-664  |#0): new 51 us maximum-latency wakeup.
(          IRQ 10-2804 |#0): new 70 us maximum-latency wakeup.
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:71: Not freed snd_alloc_kmalloc = 432
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(164) from e08b4806 not freed
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(268) from e08b46fe not freed
PCI: Found IRQ 7 for device 0000:00:0f.0
(     ksoftirqd/0-2    |#0): new 85 us maximum-latency wakeup.
(     ksoftirqd/0-2    |#0): new 90 us maximum-latency wakeup.
(          IRQ 11-691  |#0): new 100 us maximum-latency wakeup.

Does this indicate a memory leak in ALSA?

Lee



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

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

* Re: memory leaks?
  2005-03-27  4:14 memory leaks? Lee Revell
@ 2005-03-29 12:27 ` Takashi Iwai
  2005-03-29 20:24   ` Lee Revell
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2005-03-29 12:27 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

At Sat, 26 Mar 2005 23:14:46 -0500,
Lee Revell wrote:
> 
> I recently started getting these messages every time I relaod my ALSA modules:
> 
> usbcore: registered new driver snd-usb-audio
> usbcore: deregistering driver snd-usb-audio
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/usb/usbmidi.c:178: urb status -108
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/usb/usbmidi.c:163: usb_submit_urb: -90
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:71: Not freed snd_alloc_kmalloc = 864
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(164) from e0979806 not freed
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(268) from e09796fe not freed
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(164) from e0979806 not freed
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(268) from e09796fe not freed
> PCI: Found IRQ 7 for device 0000:00:0f.0
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:71: Not freed snd_alloc_kmalloc = 432
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(164) from e098a806 not freed
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(268) from e098a6fe not freed
> (     ksoftirqd/0-2    |#0): new 48 us maximum-latency wakeup.
> PCI: Found IRQ 7 for device 0000:00:0f.0
> usb 2-2: USB disconnect, address 3
> (          IRQ 12-664  |#0): new 51 us maximum-latency wakeup.
> (          IRQ 10-2804 |#0): new 70 us maximum-latency wakeup.
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:71: Not freed snd_alloc_kmalloc = 432
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(164) from e08b4806 not freed
> ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(268) from e08b46fe not freed
> PCI: Found IRQ 7 for device 0000:00:0f.0
> (     ksoftirqd/0-2    |#0): new 85 us maximum-latency wakeup.
> (     ksoftirqd/0-2    |#0): new 90 us maximum-latency wakeup.
> (          IRQ 11-691  |#0): new 100 us maximum-latency wakeup.
> 
> Does this indicate a memory leak in ALSA?

Yes.  Could you trace the corresponding addresses?
(just checking /proc/kallsyms before unloading would help, too).


Takashi


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

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

* Re: memory leaks?
  2005-03-29 12:27 ` Takashi Iwai
@ 2005-03-29 20:24   ` Lee Revell
  2005-03-29 21:31     ` Lee Revell
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Revell @ 2005-03-29 20:24 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Tue, 2005-03-29 at 14:27 +0200, Takashi Iwai wrote:
> Yes.  Could you trace the corresponding addresses?
> (just checking /proc/kallsyms before unloading would help, too).

How exactly would I trace those addresses?

Anyway, it looks to me that the leak is in snd_seq_midi.  Here is the
most recent output.  The first one I'm not sure about, the second seems
to be in snd_seq_midisynth_register_port.

ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:71: Not freed snd_alloc_kmalloc = 432
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(164) from e098b806 not freed
ALSA /home/rlrevell/cvs/alsa/alsa-driver/alsa-kernel/core/memory.c:80: kmalloc(268) from e098b6fe not freed

Here are the closest addresses from kallsyms:

00000000 a seq_midi.c   [snd_seq_midi]
e0a37ea0 ? __mod_author43       [snd_seq_midi]
e0a37f00 ? __mod_description44  [snd_seq_midi]
e0a37f44 ? __mod_license45      [snd_seq_midi]
e098d7ec d output_buffer_size   [snd_seq_midi]
e098d7f0 d __param_str_output_buffer_size       [snd_seq_midi]
e098be0c r __param_output_buffer_size   [snd_seq_midi]
e0a37f60 ? __mod_output_buffer_sizetype47       [snd_seq_midi]
e0a37f80 ? __mod_output_buffer_size48   [snd_seq_midi]
e098d804 d input_buffer_size    [snd_seq_midi]
e098d808 d __param_str_input_buffer_size        [snd_seq_midi]
e098be20 r __param_input_buffer_size    [snd_seq_midi]
e0a37fc0 ? __mod_input_buffer_sizetype50        [snd_seq_midi]
e0a37fe0 ? __mod_input_buffer_size51    [snd_seq_midi]
e098d81c d register_mutex       [snd_seq_midi]
e098b000 t snd_midi_input_event [snd_seq_midi]
e098b100 t dump_midi    [snd_seq_midi]
e098b1b0 t event_process_midi   [snd_seq_midi]
e098b2e0 t snd_seq_midisynth_new        [snd_seq_midi]
e098b330 t midisynth_subscribe  [snd_seq_midi]
e098b420 t midisynth_unsubscribe        [snd_seq_midi]
e098b480 t midisynth_use        [snd_seq_midi]
e098b540 t midisynth_unuse      [snd_seq_midi]
e098b5c0 t snd_seq_midisynth_delete     [snd_seq_midi]
e098b610 t set_client_name      [snd_seq_midi]
e098b6a0 t snd_seq_midisynth_register_port      [snd_seq_midi] 
e098bd68 t .text.lock.seq_midi  [snd_seq_midi]
e098d9c0 b synths       [snd_seq_midi]
e098bc80 t snd_seq_midisynth_unregister_port    [snd_seq_midi]
e098d82c d ops.1        [snd_seq_midi]
e08fd000 t alsa_seq_midi_init   [snd_seq_midi]
e098bdf0 t alsa_seq_midi_exit   [snd_seq_midi]

HTH,

Lee



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

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

* Re: memory leaks?
  2005-03-29 20:24   ` Lee Revell
@ 2005-03-29 21:31     ` Lee Revell
  2005-03-30 12:08       ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Revell @ 2005-03-29 21:31 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Tue, 2005-03-29 at 15:24 -0500, Lee Revell wrote:
> On Tue, 2005-03-29 at 14:27 +0200, Takashi Iwai wrote:
> > Yes.  Could you trace the corresponding addresses?
> > (just checking /proc/kallsyms before unloading would help, too).
> 
> How exactly would I trace those addresses?
> 
> Anyway, it looks to me that the leak is in snd_seq_midi.  Here is the
> most recent output.  The first one I'm not sure about, the second seems
> to be in snd_seq_midisynth_register_port.

I might have found it.  The info structure allocated in
snd_seq_midisynth_register_port does not seem to be freed in
snd_seq_midisynth_unregister_port, except on the error paths.

Lee



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

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

* Re: memory leaks?
  2005-03-29 21:31     ` Lee Revell
@ 2005-03-30 12:08       ` Takashi Iwai
  2005-03-30 12:18         ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2005-03-30 12:08 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 802 bytes --]

At Tue, 29 Mar 2005 16:31:56 -0500,
Lee Revell wrote:
> 
> On Tue, 2005-03-29 at 15:24 -0500, Lee Revell wrote:
> > On Tue, 2005-03-29 at 14:27 +0200, Takashi Iwai wrote:
> > > Yes.  Could you trace the corresponding addresses?
> > > (just checking /proc/kallsyms before unloading would help, too).
> > 
> > How exactly would I trace those addresses?
> > 
> > Anyway, it looks to me that the leak is in snd_seq_midi.  Here is the
> > most recent output.  The first one I'm not sure about, the second seems
> > to be in snd_seq_midisynth_register_port.
> 
> I might have found it.  The info structure allocated in
> snd_seq_midisynth_register_port does not seem to be freed in
> snd_seq_midisynth_unregister_port, except on the error paths.

Nice catch.  Does the patch below fix the problem?


Takashi

[-- Attachment #2: Type: text/plain, Size: 506 bytes --]

Index: alsa-kernel/core/seq/seq_midi.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/core/seq/seq_midi.c,v
retrieving revision 1.26
diff -u -r1.26 seq_midi.c
--- alsa-kernel/core/seq/seq_midi.c	22 Mar 2005 15:21:18 -0000	1.26
+++ alsa-kernel/core/seq/seq_midi.c	30 Mar 2005 12:07:12 -0000
@@ -414,6 +414,7 @@
 	if (newclient)
 		synths[card->number] = client;
 	up(&register_mutex);
+	kfree(info);
 	return 0;	/* success */
 
       __nomem:

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

* Re: memory leaks?
  2005-03-30 12:08       ` Takashi Iwai
@ 2005-03-30 12:18         ` Takashi Iwai
  0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2005-03-30 12:18 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 198 bytes --]

At Wed, 30 Mar 2005 14:08:05 +0200,
I wrote:
> 
> Nice catch.  Does the patch below fix the problem?

I found it's not enough.  Try this one please.
(I'll commit this to CVS now, anyway.)


Takashi

[-- Attachment #2: Type: text/plain, Size: 521 bytes --]

Index: alsa-kernel/core/seq/seq_midi.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/core/seq/seq_midi.c,v
retrieving revision 1.26
diff -u -r1.26 seq_midi.c
--- alsa-kernel/core/seq/seq_midi.c	22 Mar 2005 15:21:18 -0000	1.26
+++ alsa-kernel/core/seq/seq_midi.c	30 Mar 2005 12:17:27 -0000
@@ -414,6 +414,8 @@
 	if (newclient)
 		synths[card->number] = client;
 	up(&register_mutex);
+	kfree(info);
+	kfree(port);
 	return 0;	/* success */
 
       __nomem:

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

end of thread, other threads:[~2005-03-30 12:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-27  4:14 memory leaks? Lee Revell
2005-03-29 12:27 ` Takashi Iwai
2005-03-29 20:24   ` Lee Revell
2005-03-29 21:31     ` Lee Revell
2005-03-30 12:08       ` Takashi Iwai
2005-03-30 12:18         ` Takashi Iwai

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.