Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1209)

Issue 4568072: Fix some race condition between idle and timeout events. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 11 months ago by Peng
Modified:
12 years, 11 months ago
Reviewers:
Yusuke Sato
Base URL:
git@github.com:ibus/ibus.git@master
Visibility:
Public.

Description

Fix some race condition between idle and timeout events. Also fix a memory leak. BUG=http://crosbug.com/16387 TEST=Linux desktop

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -16 lines) Patch
M bus/engineproxy.c View 6 chunks +30 lines, -16 lines 2 comments Download

Messages

Total messages: 5
Peng
12 years, 11 months ago (2011-06-10 14:51:45 UTC) #1
Yusuke Sato
http://codereview.appspot.com/4568072/diff/1/bus/engineproxy.c File bus/engineproxy.c (right): http://codereview.appspot.com/4568072/diff/1/bus/engineproxy.c#newcode808 bus/engineproxy.c:808: * And use HIGH priority to avoid timeout event ...
12 years, 11 months ago (2011-06-11 15:50:26 UTC) #2
Yusuke Sato
> But I'm still wondering whether the following scenario could still happen or > not: ...
12 years, 11 months ago (2011-06-11 16:00:36 UTC) #3
Peng
http://codereview.appspot.com/4568072/diff/1/bus/engineproxy.c File bus/engineproxy.c (right): http://codereview.appspot.com/4568072/diff/1/bus/engineproxy.c#newcode808 bus/engineproxy.c:808: * And use HIGH priority to avoid timeout event ...
12 years, 11 months ago (2011-06-12 01:31:56 UTC) #4
Yusuke Sato
12 years, 11 months ago (2011-06-12 04:05:48 UTC) #5
LGTM

On 2011/06/12 01:31:56, Peng wrote:
> http://codereview.appspot.com/4568072/diff/1/bus/engineproxy.c
> File bus/engineproxy.c (right):
> 
> http://codereview.appspot.com/4568072/diff/1/bus/engineproxy.c#newcode808
> bus/engineproxy.c:808: * And use HIGH priority to avoid timeout event
happening
> before
> On 2011/06/11 15:50:26, Yusuke Sato wrote:
> > So if we use HIGH, it is guaranteed that cancelled_idle_cb() will never be
> > called after timeout_cb() is called, correct? That's fine.
> > 
> > But I'm still wondering whether the following scenario could still happen or
> > not:
> > 
> > 1. cancelled_cb() is called.
> > 2. (timeout happens here)
> > 3. cancelled_idle_cb() is called.
> > 4. timeout_cb() is called, and touches 'data' which is already freed.
> > 
> > Thoughts?
> 
> I think it step 3. It will call engine_proxy_new_data_free() that will remove
> the timeout by g_source_remove(). So I believe the timeout_cb() should not be
> called anymore.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b