From: Takashi Iwai Subject: Re: [Re: Crash when snd_pcm_open is called from a thread with "pulse" as playback] Date: Mon, 09 Mar 2009 14:18:49 +0100 Message-ID: References: <2210.93.1.202.94.1236528705.squirrel@acroe.imag.fr> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 5C9E324338 for ; Mon, 9 Mar 2009 14:18:49 +0100 (CET) In-Reply-To: <2210.93.1.202.94.1236528705.squirrel@acroe.imag.fr> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Nicolas.Castagne@imag.fr Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Sun, 8 Mar 2009 16:11:45 -0000 (GMT), Nicolas.Castagne@imag.fr wrote: > = > Hi folks, > = > I'd need the help of some alsa developpers regarding the bug report : > https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3D4426 > = > We've made a few progress on it, but we are stuck again. > = > Basically, it seems that calling snd_config_update_free_global() from a > pthread causes the program to crash when the thread terminates. > = > = > = > Questions are: > = > Should config_update_free_global NOT be called from a thread ? > = > In other words, is the following code valid (though dumb :=3D)) ? > Or is there some reason for it to crash ? Hm, I don't see any reason, and I cannot reproduce a crash on my machine... Takashi > = > = > = > ********************************** > #include > #include > void * threadWork(void *arg) { > snd_pcm_t *playback_handle; > if (snd_pcm_open (&playback_handle, "default", > SND_PCM_STREAM_PLAYBACK, 0) < 0) > fprintf (stderr, "error\n"; > snd_pcm_close(playback_handle); > = > snd_config_update_free_global(); > return NULL; > } > int main() { > pthread_attr_t attr; > pthread_attr_init(&attr); > pthread_t threadid; > pthread_create( &threadid, &attr, threadWork, NULL); > return EXIT_SUCCESS; > } > ********************************** > = > = > I thank you much, > = > Nicolas > = > = > = > = > = > ---------------------------- Message original ---------------------------- > Objet: Crash when snd_pcm_open is called from a thread with "pulse" as = > playback > De: castagne@imag.fr > Date: Mer 4 mars 2009 8:20 > =C0: alsa-devel@alsa-project.org > -------------------------------------------------------------------------- > = > Hi folks, > = > I hope I post on the correct mail list... > I've read somewhere that I should report bugs on a list, and not only on > the Tracker. That's the aim of this message. > = > = > On all my Fedora 10 machines, > whenever > snd_pcm_open > has been called from a pthread using "pulse" as playback > then the program crashes when the thread terminates. > = > Crash in __nptl_deallocate_tsd > = > However, AFAIK, one should be able to call snd_pcm_open from a thread. > = > The full bug report is there, with a very simple sample code : > https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3D4426 > = > I think this bug relates directly to alsa. > I hope this report is useful. > = > = > Best- > Nicolas > = > = > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel