alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* UCM list 'modifiers' Seg-Fault when list is empty
@ 2011-03-16 19:40 Alejandro Gonzalez
  0 siblings, 0 replies; only message in thread
From: Alejandro Gonzalez @ 2011-03-16 19:40 UTC (permalink / raw)
  To: alsa-devel; +Cc: Liam Girdwood

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

Hi, 

I've been testing the Alsa UCM and find that when listing 'modifiers'
there is a segmentation fault if the list is empty.

$ alsaucm -c Panda set _verb HiFi list _modifiers
  Im setting defaults
    list is empty
 Segmentation fault (core dumped)

Using 'gdb' I see that the issue is trying to free a not NULL pointer.
Program received signal SIGSEGV, Segmentation fault.
0x402a096c in free () from /lib/libc.so.6
(gdb) bt
#0  0x402a096c in free () from /lib/libc.so.6
#1  0x40221224 in snd_use_case_free_list () from /usr/lib/libasound.so.2
#2  0x00008d8a in do_one (context=0x13008) at usecase.c:256
#3  do_commands (context=0x13008) at usecase.c:329
#4  0x000091aa in main (argc=<value optimized out>, argv=0xbe9986c4) at
usecase.c:440
(gdb) quit

But this can be easily resolved with the correct initialization of the
'**list' pointer on the 'do_one' function in 'alsaucm/usecase.c'. 

You can find a patch attached to the mail.

Regards, 

Alejandro




[-- Attachment #2: Alsa-UCM-list-modifiers-Segmentation-Fault.patch --]
[-- Type: text/x-patch, Size: 312 bytes --]


--- /home/ubuntu/usecase.c	2011-03-16 13:03:07.000000000 -0600
+++ ./alsaucm/usecase.c	2011-03-16 12:45:33.000000000 -0600
@@ -170,7 +170,7 @@
 
 static int do_one(struct context *context, struct cmd *cmd, char **argv)
 {
-	const char **list, *str;
+	const char **list=NULL, *str;
 	long lval;
 	int err, i;




[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-16 19:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-16 19:40 UCM list 'modifiers' Seg-Fault when list is empty Alejandro Gonzalez

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