Segmentation Fault in snd_pcm_rate_hw_free()
Hello ALSA developers,
I observed one segmentation fault in snd_pcm_rate_hw_free() function, with the following BT:
(gdb) up
#1 0xb7554cc1 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb)
#2 0xb75580ee in abort () at abort.c:92
92 raise (SIGABRT);
(gdb)
#3 0xb758a7dd in __libc_message (do_abort=2,
fmt=0xb766053c "*** glibc detected *** %s: %s: 0x%s ***\n")
at ../sysdeps/unix/sysv/linux/libc_fatal.c:189
189 abort ();
(gdb)
#4 0xb7594a71 in malloc_printerr (action=<value optimized out>,
str=<value optimized out>, ptr=0x969ae98) at malloc.c:6283
6283 __libc_message (action & 2,
(gdb)
#5 0xb759636b in _int_free (av=<value optimized out>, p=0x969ae90)
at malloc.c:47954795 malloc_printerr (check_action, errstr, chunk2mem(p));
(gdb)
#6 0xb75994bd in __libc_free (mem=0x969ae98) at malloc.c:3738
3738 _int_free(ar_ptr, p);
(gdb)
#7 0xb76f3a81 in snd_pcm_rate_hw_free (pcm=0x9685d78) at pcm_rate.c:341
341 free(rate->pareas[0].addr);
(gdb)
#8 0xb76d045b in snd_pcm_hw_free (pcm=0x9685d78) at pcm.c:858
858 err = pcm->ops->hw_free(pcm->op_arg);
(gdb)
#9 0xb76f826e in snd_pcm_plug_hw_free (pcm=0x96856b0) at pcm_plug.c:1046
1046 int err = snd_pcm_hw_free(slave);
(gdb)
#10 0xb76d045b in snd_pcm_hw_free (pcm=0x96856b0) at pcm.c:858
858 err = pcm->ops->hw_free(pcm->op_arg);
(gdb)
#11 0x080492ad in main ()
Could you please give me some hints how to solve this issue?
I can provide you more info or the test application, if needed.
I can see the issue every time, and I also checked with latest version of alsa-lib but I got the same results.
Thank you,
Valentin Corfu
Quoted 25 lines · Valentin Corfu
Hello ALSA developers,
I observed one segmentation fault in
snd_pcm_rate_hw_free()function, with the following BT:(gdb) up
#10xb7554cc1in raise (sig=6) at../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 returnINLINE_SYSCALL(tgkill, 3, pid, selftid, sig);
(gdb)
#20xb75580eein abort () at abort.c:92
92 raise (SIGABRT);
(gdb)
#30xb758a7ddin__libc_message(do_abort=2,fmt=0xb766053c "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:189 189 abort (); (gdb) #4 0xb7594a71 in malloc_printerr (action=<value optimized out>, str=<value optimized out>, ptr=0x969ae98) at malloc.c:6283 6283 __libc_message (action & 2, (gdb) #5 0xb759636b in _int_free (av=<value optimized out>, p=0x969ae90) at malloc.c:4795
Quoted 7 lines
4795
malloc_printerr(check_action, errstr, chunk2mem(p));
(gdb)
#60xb75994bdin__libc_free(mem=0x969ae98) at malloc.c:3738
3738_int_free(ar_ptr, p);
(gdb)
#70xb76f3a81insnd_pcm_rate_hw_free(pcm=0x9685d78) at pcm_rate.c:341
341free(rate->pareas[0].addr);
Could you check the content of rate->pareas[0] via gdb?
Quoted 13 lines
(gdb)
#80xb76d045binsnd_pcm_hw_free(pcm=0x9685d78) at pcm.c:858
858 err =pcm->ops->hw_free(pcm->op_arg);
(gdb)
#90xb76f826einsnd_pcm_plug_hw_free(pcm=0x96856b0) at pcm_plug.c:1046
1046 int err =snd_pcm_hw_free(slave);
(gdb)
#100xb76d045binsnd_pcm_hw_free(pcm=0x96856b0) at pcm.c:858
858 err =pcm->ops->hw_free(pcm->op_arg);
(gdb)
#110x080492adin main ()
Quoted 5 lines
Could you please give me some hints how to solve this issue?
I can provide you more info or the test application, if needed. I can see the issue every time, and I also checked with latest version of alsa-lib but I got the same results.
I don't know of such an error, so far.
It smells like some memory corruption to me.
If a test case is a simple code, tracking the bug would be easy...
Takashi
Quoted 33 lines · Takashi Iwai
Quoted 24 lines · Valentin Corfu
Hello ALSA developers,
I observed one segmentation fault in
snd_pcm_rate_hw_free()function, with the following BT:(gdb) up
#10xb7554cc1in raise (sig=6) at../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 returnINLINE_SYSCALL(tgkill, 3, pid, selftid, sig);
(gdb)
#20xb75580eein abort () at abort.c:92
92 raise (SIGABRT);
(gdb)
#30xb758a7ddin__libc_message(do_abort=2,fmt=0xb766053c "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:189 189 abort (); (gdb) #4 0xb7594a71 in malloc_printerr (action=<value optimized out>, str=<value optimized out>, ptr=0x969ae98) at malloc.c:6283 6283 __libc_message (action & 2, (gdb) #5 0xb759636b in _int_free (av=<value optimized out>, p=0x969ae90) at malloc.c:4795Quoted 7 lines
4795
malloc_printerr(check_action, errstr, chunk2mem(p));
(gdb)
#60xb75994bdin__libc_free(mem=0x969ae98) at malloc.c:3738
3738_int_free(ar_ptr, p);
(gdb)
#70xb76f3a81insnd_pcm_rate_hw_free(pcm=0x9685d78) at pcm_rate.c:341
341free(rate->pareas[0].addr);
Quoted 1 line
Could you check the content of rate->pareas[0] via gdb?
(gdb) frame 7
#7 0xb76f3a81 in snd_pcm_rate_hw_free (pcm=0x9685d78) at pcm_rate.c:341
341 free(rate->pareas[0].addr);
(gdb) print rate->pareas[0]
$1 = {addr = 0x969ae98, first = 0, step = 16}
(gdb) print rate->pareas[0].addr
$2 = (void *) 0x969ae98
Quoted 15 lines
Quoted 15 lines
(gdb)
#80xb76d045binsnd_pcm_hw_free(pcm=0x9685d78) at pcm.c:858
858 err =pcm->ops->hw_free(pcm->op_arg);
(gdb)
#90xb76f826einsnd_pcm_plug_hw_free(pcm=0x96856b0) at pcm_plug.c:1046
1046 int err =snd_pcm_hw_free(slave);
(gdb)
#100xb76d045binsnd_pcm_hw_free(pcm=0x96856b0) at pcm.c:858
858 err =pcm->ops->hw_free(pcm->op_arg);
(gdb)
#110x080492adin main ()Could you please give me some hints how to solve this issue?
Quoted 7 lines
Quoted 3 lines
I can provide you more info or the test application, if needed. I can see the issue every time, and I also checked with latest version of alsa-lib but I got the same results.
I don't know of such an error, so far.
It smells like some memory corruption to me.If a test case is a simple code, tracking the bug would be easy...
I have paste it here:
http://pastebin.com/WJDTz6cE
Quoted 2 lines
Takashi
Thank you,
Valentin
Quoted 37 lines · Valentin Corfu
Quoted 33 lines · Takashi Iwai
Quoted 31 lines · Valentin Corfu
Hello ALSA developers,
I observed one segmentation fault in
snd_pcm_rate_hw_free()function, with the following BT:(gdb) up
#10xb7554cc1in raise (sig=6) at../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 returnINLINE_SYSCALL(tgkill, 3, pid, selftid, sig);
(gdb)
#20xb75580eein abort () at abort.c:92
92 raise (SIGABRT);
(gdb)
#30xb758a7ddin__libc_message(do_abort=2,fmt=0xb766053c "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:189 189 abort (); (gdb) #4 0xb7594a71 in malloc_printerr (action=<value optimized out>, str=<value optimized out>, ptr=0x969ae98) at malloc.c:6283 6283 __libc_message (action & 2, (gdb) #5 0xb759636b in _int_free (av=<value optimized out>, p=0x969ae90) at malloc.c:47954795
malloc_printerr(check_action, errstr, chunk2mem(p));
(gdb)
#60xb75994bdin__libc_free(mem=0x969ae98) at malloc.c:3738
3738_int_free(ar_ptr, p);
(gdb)
#70xb76f3a81insnd_pcm_rate_hw_free(pcm=0x9685d78) at pcm_rate.c:341
341free(rate->pareas[0].addr);
Quoted 8 lines
Quoted 1 line
Could you check the content of rate->pareas[0] via gdb?
(gdb) frame 7
#70xb76f3a81insnd_pcm_rate_hw_free(pcm=0x9685d78) at pcm_rate.c:341
341free(rate->pareas[0].addr);
(gdb) print rate->pareas[0]
$1 = {addr =0x969ae98, first = 0, step = 16}
(gdb) print rate->pareas[0].addr
$2 = (void *)0x969ae98
And accessing to pareas[0].addr is OK? This is a temporary sample buffer allocated in alsa-lib rate plugin.
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
(gdb)
#80xb76d045binsnd_pcm_hw_free(pcm=0x9685d78) at pcm.c:858
858 err =pcm->ops->hw_free(pcm->op_arg);
(gdb)
#90xb76f826einsnd_pcm_plug_hw_free(pcm=0x96856b0) at pcm_plug.c:1046
1046 int err =snd_pcm_hw_free(slave);
(gdb)
#100xb76d045binsnd_pcm_hw_free(pcm=0x96856b0) at pcm.c:858
858 err =pcm->ops->hw_free(pcm->op_arg);
(gdb)
#110x080492adin main ()Could you please give me some hints how to solve this issue?
I can provide you more info or the test application, if needed. I can see the issue every time, and I also checked with latest version of alsa-lib but I got the same results.
Quoted 6 lines
Quoted 4 lines
I don't know of such an error, so far.
It smells like some memory corruption to me.If a test case is a simple code, tracking the bug would be easy...
I have paste it here:
http://pastebin.com/WJDTz6cE
It works fine on my system. How is your PCM setup? Does the same problem occur for "plughw" PCM, too? Also, no external PCM rate plugin is involved?
Takashi
Hello Takashi,
Quoted 46 lines · Takashi Iwai
Quoted 36 lines · Valentin Corfu
Quoted 33 lines · Takashi Iwai
Quoted 31 lines · Valentin Corfu
Hello ALSA developers,
I observed one segmentation fault in
snd_pcm_rate_hw_free()function, with the following BT:(gdb) up
#10xb7554cc1in raise (sig=6) at../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 returnINLINE_SYSCALL(tgkill, 3, pid, selftid, sig);
(gdb)
#20xb75580eein abort () at abort.c:92
92 raise (SIGABRT);
(gdb)
#30xb758a7ddin__libc_message(do_abort=2,fmt=0xb766053c "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:189 189 abort (); (gdb) #4 0xb7594a71 in malloc_printerr (action=<value optimized out>, str=<value optimized out>, ptr=0x969ae98) at malloc.c:6283 6283 __libc_message (action & 2, (gdb) #5 0xb759636b in _int_free (av=<value optimized out>, p=0x969ae90) at malloc.c:47954795
malloc_printerr(check_action, errstr, chunk2mem(p));
(gdb)
#60xb75994bdin__libc_free(mem=0x969ae98) at malloc.c:3738
3738_int_free(ar_ptr, p);
(gdb)
#70xb76f3a81insnd_pcm_rate_hw_free(pcm=0x9685d78) at pcm_rate.c:341
341free(rate->pareas[0].addr);Quoted 8 lines
Quoted 1 line
Could you check the content of rate->pareas[0] via gdb?
(gdb) frame 7
#70xb76f3a81insnd_pcm_rate_hw_free(pcm=0x9685d78) at pcm_rate.c:341
341free(rate->pareas[0].addr);
(gdb) print rate->pareas[0]
$1 = {addr =0x969ae98, first = 0, step = 16}
(gdb) print rate->pareas[0].addr
$2 = (void *)0x969ae98
Quoted 3 lines
And accessing to pareas[0].addr is OK? This is a temporary sample buffer allocated in alsa-lib rate plugin.
Are you referring if the pointer is valid one?
How could I check this?
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 13 lines
(gdb)
#80xb76d045binsnd_pcm_hw_free(pcm=0x9685d78) at pcm.c:858
858 err =pcm->ops->hw_free(pcm->op_arg);
(gdb)
#90xb76f826einsnd_pcm_plug_hw_free(pcm=0x96856b0) at pcm_plug.c:1046
1046 int err =snd_pcm_hw_free(slave);
(gdb)
#100xb76d045binsnd_pcm_hw_free(pcm=0x96856b0) at pcm.c:858
858 err =pcm->ops->hw_free(pcm->op_arg);
(gdb)
#110x080492adin main ()Quoted 5 lines
Could you please give me some hints how to solve this issue?
I can provide you more info or the test application, if needed. I can see the issue every time, and I also checked with latest version of alsa-lib but I got the same results.
I don't know of such an error, so far.
It smells like some memory corruption to me.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
If a test case is a simple code, tracking the bug would be easy...
I have paste it here:
http://pastebin.com/WJDTz6cEIt works fine on my system. How is your PCM setup? Does the same problem occur for "plughw" PCM, too? Also, no external PCM rate plugin is involved?
In my setup it is involved the alsa jack plugin, so I'm using the pcm jack when the segmentation fault is visible. I can not reproduce the issue when I'm using "default" / "plughw" PCM.
For more info I have pasted the dump() & log at run: http://pastebin.com/jyy7pP9e
It is involved here PCM rate conversion at 48000, but not external one.
Quoted 2 lines
Takashi
Thank you,
Valentin
Quoted 51 lines · Valentin Corfu
Hello Takashi,
Quoted 46 lines · Takashi Iwai
Quoted 44 lines · Valentin Corfu
Quoted 33 lines · Takashi Iwai
Quoted 24 lines · Valentin Corfu
Hello ALSA developers,
I observed one segmentation fault in
snd_pcm_rate_hw_free()function, with the following BT:(gdb) up
#10xb7554cc1in raise (sig=6) at../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 returnINLINE_SYSCALL(tgkill, 3, pid, selftid, sig);
(gdb)
#20xb75580eein abort () at abort.c:92
92 raise (SIGABRT);
(gdb)
#30xb758a7ddin__libc_message(do_abort=2,fmt=0xb766053c "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:189 189 abort (); (gdb) #4 0xb7594a71 in malloc_printerr (action=<value optimized out>, str=<value optimized out>, ptr=0x969ae98) at malloc.c:6283 6283 __libc_message (action & 2, (gdb) #5 0xb759636b in _int_free (av=<value optimized out>, p=0x969ae90) at malloc.c:4795Quoted 7 lines
4795
malloc_printerr(check_action, errstr, chunk2mem(p));
(gdb)
#60xb75994bdin__libc_free(mem=0x969ae98) at malloc.c:3738
3738_int_free(ar_ptr, p);
(gdb)
#70xb76f3a81insnd_pcm_rate_hw_free(pcm=0x9685d78) at pcm_rate.c:341
341free(rate->pareas[0].addr);Quoted 1 line
Could you check the content of rate->pareas[0] via gdb?
(gdb) frame 7
#70xb76f3a81insnd_pcm_rate_hw_free(pcm=0x9685d78) at pcm_rate.c:341
341free(rate->pareas[0].addr);
(gdb) print rate->pareas[0]
$1 = {addr =0x969ae98, first = 0, step = 16}
(gdb) print rate->pareas[0].addr
$2 = (void *)0x969ae98
Quoted 6 lines
Quoted 3 lines
And accessing to pareas[0].addr is OK? This is a temporary sample buffer allocated in alsa-lib rate plugin.
Are you referring if the pointer is valid one?
How could I check this?
Look into it via gdb.
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 15 lines
Quoted 15 lines
(gdb)
#80xb76d045binsnd_pcm_hw_free(pcm=0x9685d78) at pcm.c:858
858 err =pcm->ops->hw_free(pcm->op_arg);
(gdb)
#90xb76f826einsnd_pcm_plug_hw_free(pcm=0x96856b0) at pcm_plug.c:1046
1046 int err =snd_pcm_hw_free(slave);
(gdb)
#100xb76d045binsnd_pcm_hw_free(pcm=0x96856b0) at pcm.c:858
858 err =pcm->ops->hw_free(pcm->op_arg);
(gdb)
#110x080492adin main ()Could you please give me some hints how to solve this issue?
Quoted 7 lines
Quoted 3 lines
I can provide you more info or the test application, if needed. I can see the issue every time, and I also checked with latest version of alsa-lib but I got the same results.
I don't know of such an error, so far.
It smells like some memory corruption to me.If a test case is a simple code, tracking the bug would be easy...
I have paste it here:
http://pastebin.com/WJDTz6cE
Quoted 7 lines
Quoted 3 lines
It works fine on my system. How is your PCM setup? Does the same problem occur for "plughw" PCM, too? Also, no external PCM rate plugin is involved?
In my setup it is involved the alsa jack plugin, so I'm using the pcm jack when the segmentation fault is visible.
I can not reproduce the issue when I'm using "default" / "plughw" PCM.
That's the biggest missing piece. So, a possible bug in jack plugin that has been rarely tested / debugged.
Takashi
Quoted 12 lines
For more info I have pasted the
dump()& log at run:
http://pastebin.com/jyy7pP9e
It is involved here PCM rate conversion at 48000, but not external one.Quoted 2 lines
Takashi
Thank you,
Valentin
Quoted 51 lines · Takashi Iwai
Quoted 49 lines · Valentin Corfu
Hello Takashi,
Quoted 45 lines · Takashi Iwai
Quoted 43 lines · Valentin Corfu
Quoted 33 lines · Takashi Iwai
Quoted 24 lines · Valentin Corfu
Hello ALSA developers,
I observed one segmentation fault in
snd_pcm_rate_hw_free()function, with the following BT:(gdb) up
#10xb7554cc1in raise (sig=6) at../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 returnINLINE_SYSCALL(tgkill, 3, pid, selftid, sig);
(gdb)
#20xb75580eein abort () at abort.c:92
92 raise (SIGABRT);
(gdb)
#30xb758a7ddin__libc_message(do_abort=2,fmt=0xb766053c "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:189 189 abort (); (gdb) #4 0xb7594a71 in malloc_printerr (action=<value optimized out>, str=<value optimized out>, ptr=0x969ae98) at malloc.c:6283 6283 __libc_message (action & 2, (gdb) #5 0xb759636b in _int_free (av=<value optimized out>, p=0x969ae90) at malloc.c:4795Quoted 7 lines
4795
malloc_printerr(check_action, errstr, chunk2mem(p));
(gdb)
#60xb75994bdin__libc_free(mem=0x969ae98) at malloc.c:3738
3738_int_free(ar_ptr, p);
(gdb)
#70xb76f3a81insnd_pcm_rate_hw_free(pcm=0x9685d78) at pcm_rate.c:341
341free(rate->pareas[0].addr);Quoted 1 line
Could you check the content of rate->pareas[0] via gdb?
(gdb) frame 7
#70xb76f3a81insnd_pcm_rate_hw_free(pcm=0x9685d78) at pcm_rate.c:341
341free(rate->pareas[0].addr);
(gdb) print rate->pareas[0]
$1 = {addr =0x969ae98, first = 0, step = 16}
(gdb) print rate->pareas[0].addr
$2 = (void *)0x969ae98
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
And accessing to pareas[0].addr is OK? This is a temporary sample buffer allocated in alsa-lib rate plugin.
Are you referring if the pointer is valid one?
How could I check this?Look into it via gdb.
(gdb) list
336
337 static int snd_pcm_rate_hw_free(snd_pcm_t *pcm)
338 {
339 snd_pcm_rate_t *rate = pcm->private_data;
340 if (rate->pareas) {
341 free(rate->pareas[0].addr); 342 free(rate->pareas); 343 rate->pareas = NULL; 344 rate->sareas = NULL;
345 }
(gdb) x rate->pareas[0].addr0x969ae98: 0x019f0110
(gdb) x 0x019f01100x19f0110: Cannot access memory at address 0x19f0110
(gdb) print *(rate->pareas[0].addr)
Attempt to dereference a generic pointer.
(gdb) p /s *(char *)(rate->pareas[0].addr)
$6 = 16 '\020'
(gdb) p /s *(char **)(rate->pareas[0].addr)
$7 = 0x19f0110 <Address 0x19f0110 out of bounds>
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
(gdb)
#80xb76d045binsnd_pcm_hw_free(pcm=0x9685d78) at pcm.c:858
858 err =pcm->ops->hw_free(pcm->op_arg);
(gdb)
#90xb76f826einsnd_pcm_plug_hw_free(pcm=0x96856b0) at pcm_plug.c:1046
1046 int err =snd_pcm_hw_free(slave);
(gdb)
#100xb76d045binsnd_pcm_hw_free(pcm=0x96856b0) at pcm.c:858
858 err =pcm->ops->hw_free(pcm->op_arg);
(gdb)
#110x080492adin main ()Could you please give me some hints how to solve this issue?
I can provide you more info or the test application, if needed. I can see the issue every time, and I also checked with latest version of alsa-lib but I got the same results.
Quoted 6 lines
Quoted 4 lines
I don't know of such an error, so far.
It smells like some memory corruption to me.If a test case is a simple code, tracking the bug would be easy...
I have paste it here:
http://pastebin.com/WJDTz6cEIt works fine on my system. How is your PCM setup? Does the same problem occur for "plughw" PCM, too? Also, no external PCM rate plugin is involved?
Quoted 19 lines
Quoted 3 lines
In my setup it is involved the alsa jack plugin, so I'm using the pcm jack when the segmentation fault is visible.
I can not reproduce the issue when I'm using "default" / "plughw" PCM.That's the biggest missing piece. So, a possible bug in jack plugin that has been rarely tested / debugged.
Takashi
Quoted 10 lines
For more info I have pasted the
dump()& log at run:
http://pastebin.com/jyy7pP9e
It is involved here PCM rate conversion at 48000, but not external one.Quoted 1 line
Takashi
Thank you,
Valentin
Best Regards,
Valentin