Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: GitHub issues - opened <github@alsa-project.org>
To: alsa-devel@alsa-project.org
Subject: alsamixer: segfault in display_controls()
Date: Fri, 28 Aug 2026 18:39:56 +0200 (CEST)	[thread overview]
Message-ID: <18d00595a73abf00-webhooks-bot@alsa-project.org> (raw)
In-Reply-To: <18d00595a7166c00-webhooks-bot@alsa-project.org>

alsa-project/alsa-utils issue #335 was opened from fenugrec:

I think I know what sequence triggers this.

*** steps to reproduce
1-  connect a device that has no Capture controls (unclear if this is the crucial difference). Here this is a Presonus Studio 1824c
2- run alsamixer; F6 to select that Card
3- Go the Capture view (F4)
4- arrow right
5- go to All view (F5) -> segfault


*** backtrace
```
#0  display_control (control_index=0xffffffff) at /usr/src/debug/alsa-utils/alsa-utils-1.2.16/alsamixer/mixer_display.c:421
        control = 0x55855558ff60
        col = 0x0
        i = <optimized out>
        c = <optimized out>
        left = 0x2
        frame_left = 0xb
        bar_height = <optimized out>
        volumes = {0, 6.9531436082559572e-310}
        switches = {0x0, 0x0}
        index = 0x555a0710
        s = <optimized out>
        buf = "\360\030_UUU\000\000\003\000\000\000UU", '\000' <repeats 11 times>, "\230z\021\003\000\000\000\b\000\000\000\a\000\000\000\003\000\000\000UU\000\000\2352VUUU\000\000\2462VUUU\000"
        err = <optimized out>
#1  display_controls () at /usr/src/debug/alsa-utils/alsa-utils-1.2.16/alsamixer/mixer_display.c:674
        i = 0x0
#2  0x00005555555585dc in mainloop () at /usr/src/debug/alsa-utils/alsa-utils-1.2.16/alsamixer/mainloop.c:146
        pollfds = 0x55555560e790
        nfds = 0x2
        n = <optimized out>
        active_widget = 0x5555555676e0 <mixer_widget>
        revents = 0x1
        key = <optimized out>
        err = <optimized out>
#3  main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/alsa-utils/alsa-utils-1.2.16/alsamixer/cli.c:176
No locals.
```

The problem is the argument `control_index=0xffffffff` which comes from display_controls() around lines 660-670 ; in this debug run (after the segfault) I observe the following values

```
(gdb) p first_visible_control_index
$1 = 0xffffffff
(gdb) p controls_count
$2 = 0x5
(gdb) p visible_controls
$3 = 0x5
(gdb) p focus_control_index
$4 = 0x0
```

not sure why `first_visible_control_index` has that value...

Issue URL     : https://github.com/alsa-project/alsa-utils/issues/335
Repository URL: https://github.com/alsa-project/alsa-utils

           reply	other threads:[~2026-08-28 16:40 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <18d00595a7166c00-webhooks-bot@alsa-project.org>]

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=18d00595a73abf00-webhooks-bot@alsa-project.org \
    --to=github@alsa-project.org \
    --cc=alsa-devel@alsa-project.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