Skip to content
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

alsactl: Segmentation fault (/usr/bin/alsactl restore 0) #43

Closed
kyx0r opened this issue Jun 10, 2021 · 2 comments
Closed

alsactl: Segmentation fault (/usr/bin/alsactl restore 0) #43

kyx0r opened this issue Jun 10, 2021 · 2 comments

Comments

@kyx0r
Copy link

kyx0r commented Jun 10, 2021

[    2.228958] alsactl[255]: segfault at c ip 00007f3794a72fe7 sp 00007ffe44aaf7a0 error 4 in libasound.so.2.0.0[7f3794a6d000+93000]
[    2.228964] Code: 00 00 00 5b b8 ef ff ff ff 5d 41 5c 41 5d 41 5e c3 b8 ea ff ff ff eb db 66 66 2e 0f 1f 84 00 00 00 00 00 41 54 55 53 48 89 fd <8b> 47 0c 85
 c0 7f 72 8b 47 08 83 f8 03 74 7a 3d 00 04 00 00 75 33
[    2.229010] udevd[240]: '/usr/bin/alsactl restore 0' [255] terminated by signal 11 (Segmentation fault)

Hello recent alsactl update broke the restore function... Same segfault for every device is experienced on my system hw: 0-2

@kyx0r
Copy link
Author

kyx0r commented Jun 10, 2021

Okay I think I found the problem, our version of source code is not up to date, there is a NULL pointer passed in. Here is a patch that will fix this:

--- state1.c
+++ state.c
@@ -1676,7 +1676,8 @@
 	}
 	err = finalerr ? finalerr : snd_card_iterator_error(&iter);
 out:
-	snd_config_delete(config);
+	if (config)
+		snd_config_delete(config);
 	snd_config_update_free_global();
 	return err;
 }

Also looking at this repo here: it was fixed already https://github.com/alsa-project/alsa-utils/blob/6018c2014ac24877b2aa58c2c57f2fd901e6c7b1/alsactl/state.c#L1695

@dilyn-corner
Copy link
Member

Thanks, I was waiting for this patch to show up!

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

No branches or pull requests

2 participants