Open Bug 830123 Opened 12 years ago Updated 2 years ago

MessagePumpLibevent::WatchFileDescriptor is totally broken if you call it twice without an intervening StopWatchingFileDescriptor call

Categories

(Core :: IPC, defect)

defect

Tracking

()

Tracking Status
b2g18 + ---

People

(Reporter: justin.lebar+bug, Unassigned)

Details

MessagePumpLibevent::WatchFileDescriptor tries to handle the case where you call it twice without an intervening StopWatchingFileDescriptor call. But it completely fails. In particular, it calls evt_add on an active event, which can cause a cycle in libevent's linked list of events. The upstream code [1] calls event_del before the evt_add; I think that should fix the problem. We should either take this change from upstream or add an assertion to our code that we don't hit this condition. Given that we saw the symptoms of this issue in bug 817946, I'm afraid we may be calling WatchFileDescriptor twice in B2G under some circumstances. So if we add an assertion, I think it should be a release-time assertion, so we catch the issue. [1] http://code.google.com/searchframe#OAMlx_jo-ck/src/base/message_pump_libevent.cc&q=message_pump_libevent&exact_package=chromium&type=cs&l=175
Can we please track this for b2g?
tracking-b2g18: --- → ?
If this fix is low risk and we believe it's causing other amorphous issues, tracking.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.