Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Prabhu Chawandi <foss.chaws@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: Crash in android/hal-sco.c
Date: Tue, 31 Mar 2015 17:06:14 +0200	[thread overview]
Message-ID: <4841807.9Mv5T1jXya@leonov> (raw)
In-Reply-To: <CAKafyqooRHOCtKbzWdLeDW4Dr3S151+tz-S0S+YBsRhWADVYsQ@mail.gmail.com>

Hi,

On Tuesday 31 of March 2015 18:43:16 Prabhu Chawandi wrote:
> Hi,
> 
>   I was trying to do SCO read using haltest but I was getting FPERROR.
> 
> So further I went debug coredump
> 
> 
> static ssize_t in_read(struct audio_stream_in *stream, void *buffer,
>                                                                 size_t
> bytes) {
>         struct sco_stream_in *in = (struct sco_stream_in *) stream;
> #if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
>         size_t frame_size = audio_stream_in_frame_size(&in->stream);
> #else
>         size_t frame_size = audio_stream_frame_size(&stream->common);
> #endif
> 
>         size_t frame_num = bytes / frame_size; ===> Floating point error.
> 
>         size_t input_frame_num = frame_num;
> 
> 
> I am getting channel number as 1  from audio_channel_count_from_in_mask
> 
> which is reserved for future hence I am getting zero as return which
> leading to the crash

Thanks for reporting.
I've just send a patch "android/hal-sco: Fix divide by zero". This should fix 
the crash so please test.

-- 
BR
Szymon Janc

  reply	other threads:[~2015-03-31 15:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 13:13 Crash in android/hal-sco.c Prabhu Chawandi
2015-03-31 15:06 ` Szymon Janc [this message]
2015-04-01  3:43   ` Prabhu Chawandi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4841807.9Mv5T1jXya@leonov \
    --to=szymon.janc@tieto.com \
    --cc=foss.chaws@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox