All of lore.kernel.org
 help / color / mirror / Atom feed
* Confusion about whether snd_pcm_poll_descriptors_revents()'s revents field is a single integer or an array
@ 2009-02-02  2:50 Lennart Poettering
  2009-02-02  7:02 ` Takashi Iwai
  0 siblings, 1 reply; 11+ messages in thread
From: Lennart Poettering @ 2009-02-02  2:50 UTC (permalink / raw)
  To: ALSA Development Mailing List

Heya!

If we look into the pcm example how snd_pcm_poll_descriptors_revents()
is used then we can see that the revents parameter apparently is
supposed to be a single integer. (which makes a lot of sense to me)

http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_8c-example.html#a33

However, snd_pcm_wait_nocheck() calls the same function and assumes it
is a complete array!

http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/pcm/pcm.c;h=74d1d1a4bd6083cd461b6d793c0ae41cca912f16;hb=HEAD#l2368

So what's it now? It makes more sense to me if it would be a single
fd. 

The problem becomnes visible if someone writes a plugin that wants
wakeups from more than one fd because either snd_pcm_wait() using
applications start to act weirdly because the revents are not fully
initialized or snd_pcm_poll_descriptors_revents() using applications
get invalid memory accesses.

This has become visible in the Bluetooth plugin.

I guess nobody has written a plugin that has more than one fd to sleep
on yet, right?

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-02-02 15:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-02  2:50 Confusion about whether snd_pcm_poll_descriptors_revents()'s revents field is a single integer or an array Lennart Poettering
2009-02-02  7:02 ` Takashi Iwai
2009-02-02 14:34   ` Takashi Iwai
2009-02-02 14:58     ` Takashi Iwai
2009-02-02 15:04       ` Jaroslav Kysela
2009-02-02 15:10         ` Takashi Iwai
2009-02-02 14:49   ` Lennart Poettering
2009-02-02 14:55     ` Takashi Iwai
2009-02-02 15:02       ` Jaroslav Kysela
2009-02-02 15:15         ` Takashi Iwai
2009-02-02 15:04     ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.