diff mbox

1.1.4 bug report: dmix fails when using both 32-bit and 64-bit clients

Message ID s5h37bslwyf.wl-tiwai@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Takashi Iwai May 25, 2017, 4:31 p.m. UTC
On Thu, 25 May 2017 17:43:44 +0200,
Cheng Sun wrote:
> 
> On 25 May 2017 14:49, "Takashi Iwai" <tiwai@suse.de> wrote:
> >
> > On Wed, 24 May 2017 21:13:46 +0200,
> > Cheng Sun wrote:
> > >
> > > Hi all,
> > >
> > > The following commit (released in v1.1.4) introduced an issue where a
> > > client compiled against a 32-bit (x86) compile of alsa-lib cannot use
> > > the same dmix as a client compiled against a 64-bit alsa-lib.
> > >
> > >     1a9bd0f0448106b917ae7f7bedccfcbf6ce84802
> > >
> > > The error message is:
> > >
> > >     ALSA lib pcm_dmix.c:1077:(snd_pcm_dmix_open) unable to create IPC
> > > shm instance
> > >
> > > The following forum post (not mine) describes the symptoms of the
> > > issue in more detail (although the git commit the poster specified is
> > > not correct):
> > >
> > >
> https://forums.gentoo.org/viewtopic-p-8072290.html?sid=c2fbca45102933ddf9ca7cf8b6713e56
> >
> > There is a known problem when you mix up two alsa-lib versions because
> > of the changes in dmix shmem struct.  The solution should upgrade all
> > users.
> 
> (Apologies for duplicate email --accidentally sent the first reply to the
> wrong address.)
> 
> Arch Linux has upgraded both its 32 and 64 bit packages to v1.1.4, and I'm
> still experiencing this problem.
> 
> While bisecting the bug I linked against two compiles of the same alsa-lib
> versions each time.
> 
> Let me know if I can provide any other information.

OK, at first to see whether it's the issue of the struct size
mismatch, check the following patch.  If it is, you'll see the error
message.  To be sure, check both cases: 64bit -> 32bit, and 32bit ->
64bit.


Takashi

---

Comments

Cheng Sun May 25, 2017, 4:51 p.m. UTC | #1
On 25 May 2017 at 17:31, Takashi Iwai <tiwai@suse.de> wrote:
> On Thu, 25 May 2017 17:43:44 +0200,
> Cheng Sun wrote:
>>
>> On 25 May 2017 14:49, "Takashi Iwai" <tiwai@suse.de> wrote:
>> >
>> > On Wed, 24 May 2017 21:13:46 +0200,
>> > Cheng Sun wrote:
>> > >
>> > > Hi all,
>> > >
>> > > The following commit (released in v1.1.4) introduced an issue where a
>> > > client compiled against a 32-bit (x86) compile of alsa-lib cannot use
>> > > the same dmix as a client compiled against a 64-bit alsa-lib.
>> > >
>> > >     1a9bd0f0448106b917ae7f7bedccfcbf6ce84802
>> > >
>> > > The error message is:
>> > >
>> > >     ALSA lib pcm_dmix.c:1077:(snd_pcm_dmix_open) unable to create IPC
>> > > shm instance
>> > >
>> > > The following forum post (not mine) describes the symptoms of the
>> > > issue in more detail (although the git commit the poster specified is
>> > > not correct):
>> > >
>> > >
>> https://forums.gentoo.org/viewtopic-p-8072290.html?sid=c2fbca45102933ddf9ca7cf8b6713e56
>> >
>> > There is a known problem when you mix up two alsa-lib versions because
>> > of the changes in dmix shmem struct.  The solution should upgrade all
>> > users.
>>
>> (Apologies for duplicate email --accidentally sent the first reply to the
>> wrong address.)
>>
>> Arch Linux has upgraded both its 32 and 64 bit packages to v1.1.4, and I'm
>> still experiencing this problem.
>>
>> While bisecting the bug I linked against two compiles of the same alsa-lib
>> versions each time.
>>
>> Let me know if I can provide any other information.
>
> OK, at first to see whether it's the issue of the struct size
> mismatch, check the following patch.  If it is, you'll see the error
> message.  To be sure, check both cases: 64bit -> 32bit, and 32bit ->
> 64bit.

The behaviour is different for the two cases.

1) If 64bit client is started first, then the 32bit client prints the following:

magic mismatch: shmptr=a15ad4f0, expected=a15ad4ec
ALSA lib pcm_dmix.c:1077:(snd_pcm_dmix_open) unable to create IPC shm instance

2) If 32bit client is started first, then the 64bit client only prints:

ALSA lib pcm_dmix.c:1077:(snd_pcm_dmix_open) unable to create IPC shm instance

I've added some further print statements and it turns out that this is
because the "return err;" on line 115 is triggered.

Cheers,
Cheng
diff mbox

Patch

diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -136,6 +136,7 @@  retryget:
 		return 1;
 	} else {
 		if (dmix->shmptr->magic != SND_PCM_DIRECT_MAGIC) {
+			fprintf(stderr, "magic mismatch: shmptr=%x, expected=%x\n", (int)dmix->shmptr->magic, (int)SND_PCM_DIRECT_MAGIC);
 			snd_pcm_direct_shm_discard(dmix);
 			return -EINVAL;
 		}