From 323f293ab538ffc7431f6598736963a834c4f880 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 7 Jan 2014 17:49:29 +0900 Subject: [PATCH] eio - protect against posible segv on rename with eio this MIGHT fix T45 but i can't reproduce to confirm, but reading a backtrace indicates this could have been the issue. it looks like there is room for a dangling pointer anyway, so fix. stable release - cherry-pick me! --- src/lib/eio/eio_monitor.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/eio/eio_monitor.c b/src/lib/eio/eio_monitor.c index 247fe7c..53581a4 100644 --- a/src/lib/eio/eio_monitor.c +++ b/src/lib/eio/eio_monitor.c @@ -201,7 +201,11 @@ _eio_monitor_rename(Eio_Monitor *monitor, const char *newpath) const char *tmp; /* destroy old state */ - if (monitor->exist) eio_file_cancel(monitor->exist); + if (monitor->exist) + { + eio_file_cancel(monitor->exist); + monitor->exist = NULL; + } if (monitor->backend) { @@ -218,11 +222,15 @@ _eio_monitor_rename(Eio_Monitor *monitor, const char *newpath) eina_stringshare_del(tmp); /* That means death (cmp pointer and not content) */ + /* this - i think, is wrong. if the paths are the same, we should just + * re-stat anyway. imagine the file was renamed and then replaced? + * disable this as this was part of a possible crash due to eio. if (tmp == monitor->path) { _eio_monitor_error(monitor, -1); return; } + */ EINA_REFCOUNT_REF(monitor); /* as we spawn a thread for this monitor, we need to refcount specifically for it */ -- 2.7.4