Skip to content

async: fix snd_async_del_handler for TIMER type - #525

Open
LilyKing2026 wants to merge 1 commit into
alsa-project:masterfrom
LilyKing2026:fix-timer-async-handler
Open

LilyKing2026 wants to merge 1 commit into
alsa-project:masterfrom
LilyKing2026:fix-timer-async-handler

Conversation

@LilyKing2026

Copy link
Copy Markdown

Problem

snd_async_del_handler() has two switch statements that handle PCM and CTL handler types, but not TIMER. When a TIMER type handler is deleted, both switches fall through to default and trigger assert(0), crashing any program that uses snd_async_add_timer_handler().

Reproduction

On Ubuntu 26.04 (alsa-lib 1.2.15.3), running selftests/alsa/utimer-test:

global-timer: async.c:166: snd_async_del_handler: Assertion '0' failed.

Aborted (core dumped)

Fix

  • Add the missing SND_ASYNC_HANDLER_TIMER cases to both switches in src/async.c
  • Include timer/timer_local.h to access the members of struct _snd_timer

Testing

After rebuilding and installing alsa-lib, utimer-test changes from FAIL to PASS:

# PASSED: 2 / 2 tests passed.

snd_async_del_handler() has two switch statements that handle
PCM and CTL handler types, but not TIMER. When a TIMER type
handler is deleted, both switches fall through to default and
trigger assert(0), crashing any program that uses
snd_async_add_timer_handler().

Add the missing SND_ASYNC_HANDLER_TIMER cases to both switches,
and include timer_local.h to access struct _snd_timer.

Signed-off-by: Jin Li <jinli@lanxincomputing.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant