Page MenuHomePhabricator

eio/fallback: avoid emitting monitor events if the backend is pending deletion
ClosedPublic

Authored by zmike on Jun 27 2018, 5:55 AM.

Details

Summary

emitting events if the delete_me flag is set may result in events being emitted
for an already-freed monitor, resulting in both invalid memory access and a
deadlock later on if eio_shutdown has been called at this point

this causes the monitoring thread to check the status of the backend during the
block where the main loop and thread are in sync, avoiding any data races which
could occur when checking the flag at another time, and also avoiding accessing
the internals of the Ecore_Thread which could also have been deallocated during
shutdown

fix T7086

Depends on D6448

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.
zmike created this revision.Jun 27 2018, 5:55 AM
zmike requested review of this revision.Jun 27 2018, 5:55 AM
ManMower added inline comments.Jun 27 2018, 10:41 AM
src/lib/eio/eio_monitor_poll.c
202

is out: now a dangling label?

zmike updated this revision to Diff 15332.Jun 27 2018, 10:42 AM
zmike edited the summary of this revision. (Show Details)

remove unused label

ManMower accepted this revision.Jun 27 2018, 10:44 AM
This revision is now accepted and ready to land.Jun 27 2018, 10:44 AM
Closed by commit rEFLddc31e75ac68: eio/fallback: avoid emitting monitor events if the backend is pending deletion (authored by zmike, committed by Marcel Hollerbach <mail@marcel-hollerbach.de>). · Explain WhyJun 28 2018, 9:12 AM
This revision was automatically updated to reflect the committed changes.