Re: [PATCH] Fix removal of variable change notifications



On Fri, 2012-12-07 at 12:38 +0100, Jens Georg wrote:
> On Fr, 2012-12-07 at 11:59 +0100, Sven Neumann wrote:
> > Need to pass the key to g_hash_table_remove(), not the
> > value. This fixes crashes in emit_notification().
> 
> Is there any way to trigger this so we can add a test?

Well, the code is obviously wrong. But if you absolutely want to test
this, you should be able to reproduce the crash by instantiating a
service-proxy object, using gupnp_service_proxy_add_notify() on it, then
use gupnp_service_proxy_remove_notify() to unregister yourself from
change notifications. After that change the state variable on the
service. You will most likely see a crash in emit_notification() because
it is accessing released memory. If it doesn't crash, then you should
use valgrind. It will definitely show you an invalid read.


Regards,
Sven




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]