Hi all,

On 26 December 2016 at 05:08, Petter Reinholdtsen <p...@hungry.com> wrote:
> [Felipe Sateler]
> > This suggests there is some wrong thread usage. Andrew, any idea what
> > could this be?
> There are several bugs that can trigger this.  For example trying to unlock an
> non-locked lock.  Using 'valgrind --tool=helgrind' make it possible to see 
> incorrect
> lock usage.

Does anyone have hardware to test this fix? It appears the problem is
not on node-groove, but on libgrooveplayer. In particular, the dummy
device thread unlocks a mutex too early when an underrun occurs, and
then later on it is unlocked again. The following diff fixes the
helgrind error (but leaves plenty of other possible data race

diff --git a/grooveplayer/player.c b/grooveplayer/player.c
index 5d2239c..ad4ad75 100644
--- a/grooveplayer/player.c
+++ b/grooveplayer/player.c
@@ -198,7 +198,7 @@ static void *dummy_thread(void *arg) {
                     // track of time, we're going to pretend that we did *not*
                     // just get a buffer underrun. Instead we'll wait patiently
                     // for the next buffer to appear and handle it
-                    pthread_mutex_unlock(&p->play_head_mutex);

However as I cannot reproduce the error, I cannot test if this indeed
fixes the issue...


Felipe Sateler

Pkg-javascript-devel mailing list

Reply via email to