10 Apr
2016
10 Apr
'16
11:57 p.m.
Hi!
Since alsa-lib commit dec428c352217010e4b8bd750d302b8062339d32, I've occationally been hit by an EBADFD whenever any program tries to play sound. The situation I get is that the first shmget succeds, so dmix->shmid >= 0, therefore first_instance = 0. But buf.shm_nattach = 1, so before the commit shmptr would have been zeroed out, but isn't anymore. And since I still have: dmix->shmptr->magic == SND_PCM_DIRECT_MAGIC, I don't get EINVAL, but EBADFD, somewhere down the line.
From what I understand, the race condition that was fixed would still
be avoided if shmptr was zeroed on (first_instance || buf.shm_nattch == 1). If that is the case, would you please consider applying attached diff?
Regards, Lars Lindqvist