[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linrad] Re: Linrad053 and Ubuntu



Hi Leif,

On Nov 15, 8:00 am, Leif Asbrink <l...@xxxxxxxxxx> wrote:
> Hi All,
>
> Ermanno reported a bug when running Linrad02-53 with native
> ALSA under Ubuntu.
>
> The error is a buffer overflow, line 93 in lsetad.c:
> char alsa_dev_plughw_pcm_name [10];
> does not allocate enough space. Change it to:
> char alsa_dev_plughw_pcm_name [16];
>

This fixes the buffer overflow issue for me also (Ubuntu 8.10, gcc
4.3.2).

I suspect that you are correct that it is an alignment issue, my
debugging puts the crash at lsetad.c:235, which is the sprintf() call
with alsa_dev_hw_pcm_name. I haven't got my Ubuntu machine with me at
the moment, but gcc 4.3.2 may have 16-bit aligned alsa_dev_hw_pcm_name
due to alsa_dev_plughw_pcm_name being 16-bit divisible (ie. 10 bytes).
Forcing alsa_dev_plughw_pcm_name to a 32-bit boundary may have caused
alsa_dev_hw_pcm_name to 32-bit alignment also.

>                           ---   ooo   ---
>
> Before I upload Linrad-02.54 with the alsa_dev_plughw_pcm_name
> correction I would like to know if there is anything else that
> does not seem right with 02-53.
>

After compiling with your suggested change, I still receive regular
[1116] errors (short readi()) when in "I" Soundcard Test Mode. I
haven't done any more substantial testing to see whether this occurs
in normal operation, nor can I verify at this stage whether the error
occurs with the gcc-3.4 built binary.

I agree it shouldn't happen according to the ALSA API description, but
the doco is a little unclear on the semantics of blocking read calls
in what I can only assume is the presence of signals.

> 73
>
> Leif

Regards,

Sam.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Linrad" group.
To post to this group, send email to linrad@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to linrad+unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at http://groups.google.com/group/linrad?hl=en
-~----------~----~----~----~------~----~------~--~---

LINRADDARNIL