-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhandled asynchronous SIGIO #394
Comments
Thanks. The above commit should move |
Hi all, We are using alsa 1.2.12 with patch mentioned above, but have same behavior as reported by jansenmd, via debugging we got that the part inside of:
will be never called. |
…ng sigaction as last") A wrong list head is used to check if the given list with async handlers is empty. Correct this. Link: #394 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
It reduces probablity to activate the async handler when snd_pcm_close() is called. Link: #394 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
When using
libasound.so
on embedded systems, I've come across several instances where an unhandledSIGIO
is detected. This can occur when closing a hardware microphone device that was set up to use asynchronous calls backs viasnd_async_add_pcm_handler
.Example: when opening a hardware device with asynchronous callbacks:
SIGIO
viasigaction
.fd
by setting theO_ASYNC
flag:fcntl(fd, F_SETFL, flags | O_ASYNC)
fcntl(fd, F_SETSIG, (long)SIGIO)
Now, when data is available to be read from the
fd
,SIGIO
should be generated and handled by the signal handler set insigaction
. That appears to work fine.The current teardown process looks like this:
sigaction
.fd
by clearing theO_ASYNC
flag:fcntl(fd, F_SETFL, flags & ~O_ASYNC)
fd
.This teardown process seems to set up a race condition where an unhandled
SIGIO
can be generated between unregistering the signal handler and actually stopping any more signals from occurring. Since the default action forSIGIO
is termination, this can cause an application to unexpectedly terminate.The text was updated successfully, but these errors were encountered: