Skip to contentSkip to conversation

alsa-lib 1.2.2 kills my unity3d games

DISCUSSION Thomas J. Moore 2 participants 2 messages Feb 29, 2020

lore
Share & tools
lore
#0 lore raw

Sorry if this has already been reported, but I only really subscribed to report this bug, and nothing recent in the archive jumped out at me.

Some time after Jan 12, some change in my (Gentoo Linux) system caused 67 of my 72 commercial, closed-source unity3d games to crash on startup.
gdb was no help, but strace showed alsa activity before two crashes,
and, sure enough, reverting alsa-lib to 1.2.1.2 cured it.

I bisected to this commit (5ee5ef31b "namehint: correct the @args check"):

https://git.alsa-project.org/?p=alsa-lib.git;a=blobdiff;f=src/control/namehint.c;h=4927ef973c326bef41e33b87714de87b31c1f752;hp=808df6b507336b8f6d6e618a0cfa520d62a3b4fc;hb=5ee5ef31b5ff3fb7c904054cb9cac7478a727f7c;hpb=ebdd2b6cdb8119cf75f0dd0a3b283d271b3a547e

I don't know what the exact problem is, but reverting just this commit was enough to make everything work again (and its later modification in 6055f8a58 which doesn't make sense looking at the code as the function always returns 0 and str may still be NULL on exit, but adding a check for NULL str is not enough to stop unity3d from crashing).

#1 lore raw

Dne 29. 02. 20 v 21:19 Thomas J. Moore napsal(a):

Quoted 10 lines

Sorry if this has already been reported, but I only really subscribed to report this bug, and nothing recent in the archive jumped out at me.

Some time after Jan 12, some change in my (Gentoo Linux) system caused 67 of my 72 commercial, closed-source unity3d games to crash on startup.
gdb was no help, but strace showed alsa activity before two crashes,
and, sure enough, reverting alsa-lib to 1.2.1.2 cured it.

I bisected to this commit (5ee5ef31b "namehint: correct the @args check"):

Quoted 7 lines

https://git.alsa-project.org/?p=alsa-lib.git;a=blobdiff;f=src/control/namehint.c;h=4927ef973c326bef41e33b87714de87b31c1f752;hp=808df6b507336b8f6d6e618a0cfa520d62a3b4fc;hb=5ee5ef31b5ff3fb7c904054cb9cac7478a727f7c;hpb=ebdd2b6cdb8119cf75f0dd0a3b283d271b3a547e

I don't know what the exact problem is, but reverting just this commit was enough to make everything work again (and its later modification in 6055f8a58 which doesn't make sense looking at the code as the function always returns 0 and str may still be NULL on exit, but adding a check for NULL str is not enough to stop unity3d from crashing).

The revert does not resolve the culprit. I already posted my comments to
https://github.com/alsa-project/alsa-lib/issues/27 . It's difficult to fix something without sources. The bug seems to be in the sound device enumeration in the commercial binary.

The alsa-lib's change just returns more devices than the previous version. It should not affect anything. The device list collected from the affected application in the comment bellow looks really suspicious:
https://github.com/alsa-project/alsa-lib/issues/27#issuecomment-592920831

It appears that the code does really something unwanted. You can find workarounds in the issue.

Jaroslav

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.