aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-11-07 20:56:57 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-11-07 20:56:57 +0000
commit03d50e9546ced3f7c135cad6617f4e397a024fce (patch)
tree29c1a998293c74c835c12c2eca1e0a02d50bc067 /src
parentupdating portuguese translations (diff)
downloadenlightenment-03d50e9546ced3f7c135cad6617f4e397a024fce.tar.gz
E: little hack to handle valid SIGILL.
SVN revision: 78976
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_signals.c19
-rw-r--r--src/bin/e_start_main.c22
2 files changed, 32 insertions, 9 deletions
diff --git a/src/bin/e_signals.c b/src/bin/e_signals.c
index b095b5207..2927fee45 100644
--- a/src/bin/e_signals.c
+++ b/src/bin/e_signals.c
@@ -71,12 +71,19 @@ e_sigseg_act(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__
EAPI void
e_sigill_act(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__)
{
- _e_x_composite_shutdown();
- ecore_x_pointer_ungrab();
- ecore_x_keyboard_ungrab();
- ecore_x_ungrab();
- ecore_x_sync();
- e_alert_show();
+ // In case of a sigill in Enlightenment, Enlightenment start will catch the sigill and continue,
+ // because evas cpu detection use that behaviour. But if we get a SIGILL after that, we endup in
+ // this sig handler. So E start remember the SIGILL, and we will commit succide with a USR1, followed
+ // by a SEGV.
+ kill(getpid(), SIGUSR1);
+ kill(getpid(), SIGSEGV);
+ pause();
+ /* _e_x_composite_shutdown(); */
+ /* ecore_x_pointer_ungrab(); */
+ /* ecore_x_keyboard_ungrab(); */
+ /* ecore_x_ungrab(); */
+ /* ecore_x_sync(); */
+ /* e_alert_show(); */
}
EAPI void
diff --git a/src/bin/e_start_main.c b/src/bin/e_start_main.c
index dc751e460..4fed2b147 100644
--- a/src/bin/e_start_main.c
+++ b/src/bin/e_start_main.c
@@ -415,7 +415,10 @@ main(int argc, char **argv)
while (!done)
{
- result = waitpid(child, &status, 0);
+ Eina_Bool remember_sigill = EINA_FALSE;
+ Eina_Bool remember_sigusr1 = EINA_FALSE;
+
+ result = waitpid(child, &status, 0);
if (result == child)
{
@@ -431,9 +434,22 @@ main(int argc, char **argv)
back = r == 0 &&
sig.si_signo != SIGTRAP ? sig.si_signo : 0;
+ if (sig.si_signo == SIGUSR1)
+ {
+ if (remember_sigill)
+ remember_sigusr1 = EINA_TRUE;
+ }
+ else if (sig.si_signo == SIGILL)
+ {
+ remember_sigill = EINA_TRUE;
+ }
+ else
+ {
+ remember_sigill = EINA_FALSE;
+ }
+
if (r != 0 ||
(sig.si_signo != SIGSEGV &&
- sig.si_signo != SIGILL &&
sig.si_signo != SIGFPE &&
sig.si_signo != SIGBUS &&
sig.si_signo != SIGABRT))
@@ -470,7 +486,7 @@ main(int argc, char **argv)
snprintf(buffer, 4096,
backtrace_str ? "%s/enlightenment/utils/enlightenment_alert %i %i %s" : "%s/enlightenment/utils/enlightenment_alert %i %i %s",
eina_prefix_lib_get(pfx),
- sig.si_signo,
+ sig.si_signo == SIGSEGV && remember_sigusr1 ? SIGILL : sig.si_signo,
child,
backtrace_str);
r = system(buffer);