jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fc0d2cb6a744c76f11925d9e25edac12c75574e2

commit fc0d2cb6a744c76f11925d9e25edac12c75574e2
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Tue Aug 29 13:33:49 2017 +0900

    access: Fix crash in ecore
    
    We use a temporary file for espeak (the accessibility text-to-speech
    engine we use), and then we remove and close the file. But the fd was
    not reset to -1 which meant that later on the previous fd was closed
    again (this is kinda weird), but that fd was now invalid. Or rather it
    was reused by ecore animator, closing the read-end of the pipe
    (timer_fd_read). This caused SIGPIPE in the animator code.
    
    Thanks strace and gdb for helping me figure out this. :)
    
    @fix
---
 src/modules/elementary/access_output/mod.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/modules/elementary/access_output/mod.c 
b/src/modules/elementary/access_output/mod.c
index e304c2ecae..ce8c47d570 100644
--- a/src/modules/elementary/access_output/mod.c
+++ b/src/modules/elementary/access_output/mod.c
@@ -30,6 +30,7 @@ _exe_del(void *data EINA_UNUSED, int type EINA_UNUSED, void 
*event)
              free(tmpf);
              tmpf = NULL;
              close(tmpfd);
+             tmpfd = -1;
           }
         espeak = NULL;
         if (cb_func) cb_func(cb_data);
@@ -91,7 +92,8 @@ out_read_done(void)
      {
         // FIXME: espeak supporets -v XX for voice locale. should provide this
         // based on actual lang/locale
-        close(tmpfd);
+        if (tmpfd >= 0) close(tmpfd);
+        tmpfd = -1;
         snprintf(buf, sizeof(buf), "espeak -p 2 -s 120 -k 10 -m -f %s", tmpf);
         espeak = ecore_exe_pipe_run(buf,
                                     ECORE_EXE_NOT_LEADER,
@@ -113,6 +115,7 @@ out_cancel(void)
         free(tmpf);
         tmpf = NULL;
         close(tmpfd);
+        tmpfd = -1;
      }
 }
 

-- 


Reply via email to