Re: [asterisk-users] Issues with Siren14 codec in Asterisk 14.3.0

2017-04-06 Thread Joshua Colp
On Thu, Apr 6, 2017, at 12:17 PM, Richard Kenner wrote:
> > I would say this is a bug in func_speex and not in codec_siren14. This
> > is because the datalen is zero. 
> 
> Ah!  So, like?
> 
> *** func_speex.c.orig   2017-02-13 15:00:19.0 -0500
> --- func_speex.c2017-04-06 11:16:03.0 -0400
> ***
> *** 185,189 
> }
>   
> !   speex_preprocess(sdi->state, frame->data.ptr, NULL);
> snprintf(source, sizeof(source), "%s/speex", frame->src);
> if (frame->mallocd & AST_MALLOCD_SRC) {
> --- 185,190 
> }
>   
> !   if (frame->data.ptr && frame->datalen)
> ! speex_preprocess(sdi->state, frame->data.ptr, NULL);
> snprintf(source, sizeof(source), "%s/speex", frame->src);
> if (frame->mallocd & AST_MALLOCD_SRC) {

Yes, although really you only need to check datalen. If that is set to
non-zero then there is data.

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Issues with Siren14 codec in Asterisk 14.3.0

2017-04-06 Thread Richard Kenner
> I would say this is a bug in func_speex and not in codec_siren14. This
> is because the datalen is zero. 

Ah!  So, like?

*** func_speex.c.orig   2017-02-13 15:00:19.0 -0500
--- func_speex.c2017-04-06 11:16:03.0 -0400
***
*** 185,189 
}
  
!   speex_preprocess(sdi->state, frame->data.ptr, NULL);
snprintf(source, sizeof(source), "%s/speex", frame->src);
if (frame->mallocd & AST_MALLOCD_SRC) {
--- 185,190 
}
  
!   if (frame->data.ptr && frame->datalen)
! speex_preprocess(sdi->state, frame->data.ptr, NULL);
snprintf(source, sizeof(source), "%s/speex", frame->src);
if (frame->mallocd & AST_MALLOCD_SRC) {


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Issues with Siren14 codec in Asterisk 14.3.0

2017-04-06 Thread Joshua Colp
On Thu, Apr 6, 2017, at 10:57 AM, Richard Kenner wrote:
> I'm seeing Asterisk crashes with the following frame at func_speex.c:188:
> 
> (gdb) p *frame
> $6 = {frametype = AST_FRAME_VOICE, subclass = {integer = 0, 
> format = 0xe2f9e20, frame_ending = 0}, datalen = 0, samples = 640, 
>   mallocd = 1, mallocd_hdr_len = 232, offset = 64, 
>   src = 0x2ac07413e7f8 "siren14tolin32", data = {ptr = 0x3cab9378, 
> uint32 = 1017877368, pad = "x\223\253<\000\000\000"}, delivery = {
> tv_sec = 1491485582, tv_usec = 407272}, frame_list = {next = 0x0}, 
>   flags = 0, ts = 0, len = 0, seqno = 0}
> 
> frame->data.ptr is an out-of-range address.
> 
> Does this ring a bell to anybody?  Without sources of the Siren14 codec,
> how would you recommend we debug this?

I would say this is a bug in func_speex and not in codec_siren14. This
is because the datalen is zero. There is no data on the frame (which is
why frame->data.ptr is garbage, although it could be improved to be
NULL) but there are samples, so it's an interpolated frame. The
func_speex module should be changed to handle this.

I'd suggest filing an issue on the issue tracker for it[1].

[1] https://issues.asterisk.org/jira

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Issues with Siren14 codec in Asterisk 14.3.0

2017-04-06 Thread Richard Kenner
I'm seeing Asterisk crashes with the following frame at func_speex.c:188:

(gdb) p *frame
$6 = {frametype = AST_FRAME_VOICE, subclass = {integer = 0, 
format = 0xe2f9e20, frame_ending = 0}, datalen = 0, samples = 640, 
  mallocd = 1, mallocd_hdr_len = 232, offset = 64, 
  src = 0x2ac07413e7f8 "siren14tolin32", data = {ptr = 0x3cab9378, 
uint32 = 1017877368, pad = "x\223\253<\000\000\000"}, delivery = {
tv_sec = 1491485582, tv_usec = 407272}, frame_list = {next = 0x0}, 
  flags = 0, ts = 0, len = 0, seqno = 0}

frame->data.ptr is an out-of-range address.

Does this ring a bell to anybody?  Without sources of the Siren14 codec,
how would you recommend we debug this?

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users