[alsa-devel] UCM list 'modifiers' Seg-Fault when list is empty

Alejandro Gonzalez x0092071 at ti.com
Wed Mar 16 20:40:22 CET 2011


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



-------------- next part --------------
A non-text attachment was scrubbed...
Name: Alsa-UCM-list-modifiers-Segmentation-Fault.patch
Type: text/x-patch
Size: 312 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20110316/f8cef34d/attachment.patch 

More information about the Alsa-devel mailing list