Page MenuHomePhabricator

elementary: fix potential race condition by using Eina_Future attached to the object.
ClosedPublic

Authored by cedric on Thu, Jul 11, 4:23 PM.

Details

Summary

I get some random segfault in elementary test suite pointing to this code. Most likely
we do not properly destroy the timer during destruction. Could be because we initiate
a delay while destruction is going on or something like that. Anyway, it is easier and
more robust to get it fixed by linking the lifetime of the timeout to the lifetime of
the widget as future allow us to do easily.

Depends on D9297

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
cedric created this revision.Thu, Jul 11, 4:23 PM
cedric requested review of this revision.Thu, Jul 11, 4:23 PM

Looks correct, but can you elaborate in the commit message why it is needed?

cedric planned changes to this revision.Fri, Jul 12, 8:57 AM
cedric updated this revision to Diff 23345.Fri, Jul 12, 12:58 PM
cedric edited the summary of this revision. (Show Details)

Rebase and take comment into account.

Okay, maybe i am not seeing it, but as i see it the future is not either getting cleaned up in the objects invalidator either, so even if it does not crash directly for you, you might still get a crash i think ?

Okay, maybe i am not seeing it, but as i see it the future is not either getting cleaned up in the objects invalidator either, so even if it does not crash directly for you, you might still get a crash i think ?

The future are automatically cancelled (all of them) by Eo on invalidate and you can not create a future on an invalidated object either. There is no need for added code on the object to handle this case.

Nice! now i saw it. I still need to get used to this.

bu5hm4n accepted this revision.Mon, Jul 15, 12:36 PM
This revision is now accepted and ready to land.Mon, Jul 15, 12:36 PM
Closed by commit rEFL477611f01460: elementary: fix potential race condition by using Eina_Future attached to the… (authored by cedric, committed by Marcel Hollerbach <mail@marcel-hollerbach.de>). · Explain WhyWed, Jul 17, 12:59 PM
This revision was automatically updated to reflect the committed changes.