Re: [PATCH] fix unregister/callback race in conn.c
"Mi Reflejo" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Ok. I'll test it today too. M On 10/26/06, Vincent CHAVANIS <[email protected]> wrote: > Alex is right here, > > The patch (+ list != NULL) was only submited to prevent smsbox from crashing > in the 1.4.1 release. > I will test alex's patch today. > > Vincent. > > -- > Telemaque - 06560 SOPHIA-ANTIPOLIS - (FR) > Service Technique/Reseau - NOC > Developpement SMS/MMS/Kiosques > http://www.telemaque.fr/ > [email protected] > Tel : +33 4 92 90 99 84 (fax 9142) > ----- Original Message ----- > From: "Alexander Malysh" <[email protected]> > To: <[email protected]> > Sent: Thursday, October 26, 2006 9:35 AM > Subject: Re: [PATCH] fix unregister/callback race in conn.c > > > Hi, > > because dict_get(conn_pool, key) may not be NULL it's just impossible if > no races there. > > > Am 26.10.2006, 07:53 Uhr, schrieb Mi Reflejo <[email protected]>: > > > Umh. > > Why this?: > > > > - if (list != NULL && gwlist_delete_equal(list, conn) > 0) { > > + if (gwlist_delete_equal(list, conn) > 0) { > > > > dict_get couldn't return null value from conn_pool and key? > > > > M > > > > On 10/25/06, Alexander Malysh <[email protected]> wrote: > >> Hi All, > >> > >> attached patch fixes race condition in unregister/callback usage/destroy > >> of callback data. > >> The race is as follow, spotted with help of http.c: > >> > >> 1 Thread 2 Thread > >> 1) http:conn_pool_get 1) http:check_pool_conn > >> 2) conn = XYZ > >> 3) conn_unregister > >> in conn_unregister > >> destroy callbackdata > >> 2) dict_get(conn_pool, > >> key) -> crash because connback data already > >> destroyed > >> > >> @Vincent: you reported similar crash. This patch should fix it. > >> > >> Votes please? > >> > >> -- > >> Thanks, > >> Alex > >> > >> > > > > > > > > -- > Thanks, > Alex > > > > > >