jpeg pushed a commit to branch master.
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date: Tue Dec 29 20:29:36 2015 +0900
Eo: Prevent shutdown from actually doing anything
Currently, eo_shutdown can't work.
Every Eo_Class ID is stored inside its class_get() function as a
static variable. This means any call to class_get() after eo_shutdown()
(even if eo_init was done properly) will lead to using an invalid ref
for the class id. In other words, the class is not valid anymore,
and objects can't be created.
Resetting the pointer to NULL would be possible, if we passed it
during the class creation. But this would lead to potential crashes
if a class was created from a now dlclosed library.
The only solution I can envision here is to check that class_get
actually returns a valid ref with the right class name. Most likely
the performance impact is not acceptable.
This fixes make check for me (with systemd module for ecore).
src/lib/eo/eo.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index fd1fc2a..ef4a625 100644
@@ -1849,10 +1849,21 @@ eo_shutdown(void)
_Eo_Class **cls_itr = _eo_classes;
+ const char *s;
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(_eo_init_count > 0, EINA_FALSE);
if (--_eo_init_count > 0)
+ /* We can't actually shutdown Eo for similar reasons that closing a
+ * shared library is risky: all Eo_Class IDs are stored inside their
+ * classname_get() function and can't be safely reset to NULL. */
+ if (!(s = getenv("EO_SHUTDOWN_ENABLE")) || (atoi(s) != 1))
+ _eo_init_count = 1;
+ return EINA_TRUE;
@@ -1872,7 +1883,10 @@ eo_shutdown(void)
if (_eo_call_stack_key != 0)
+ _eo_call_stack_key = 0;