[libnice] [Nice] Multithreading bug when removing streams
kakaroto at kakaroto.homelinux.net
Tue Jun 17 18:11:49 PDT 2014
Thank you very much for the report, the stack from valgrind was enough to
track down the bug. Yes, libnice is safe in a multithread environment, but
this was one bug where the mutex was released in the middle of a function
call (when emitting the IO callback) and it was not checking if the stream
got delete between the moment it unlocked and locked the mutex again.
I've fixed it in my repository but haven't tested it :
On Sun, Apr 27, 2014 at 10:50 AM, Stephan Thamm <thammi at chaossource.net>
> working on my node.js bindings for libnice  I came across what I
> suspect is
> a multithreading bug in libnice. I was unable to find a statement about
> multithreading support in the documentation, but a mail on this list 
> stated that the agent API should be safe.
> The error occurs after removing a stream. It seems that code tries to
> io for the stream after it was removed, which fails when GSList tries to
> access the freed memory.
> I was running my application inside valgrind when the error occured. This
> might have increased the chances of this bug occuring (everything is very
> ...). The stack traces are attached.
> The bug triggered on Debian with libnice 0.1.5 as well as
> 0.1.5+rc20140402-0exp1 from Debian Experimental.
> I hope that this information is enough to find the cause of the bug. I
> looking into the libnice code, but my understanding of the code is not
> good enough.
>  https://github.com/thammi/node-libnice
>  http://lists.freedesktop.org/archives/nice/2009-September/000293.html
> So far, farewell
> nice mailing list
> nice at lists.freedesktop.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nice