E: little hack to handle valid SIGILL.

SVN revision: 78976
This commit is contained in:
Cedric BAIL 2012-11-07 20:56:57 +00:00
parent 635d4636e4
commit 03d50e9546
2 changed files with 32 additions and 9 deletions

View File

@ -71,12 +71,19 @@ e_sigseg_act(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__
EAPI void EAPI void
e_sigill_act(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__) e_sigill_act(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__)
{ {
_e_x_composite_shutdown(); // In case of a sigill in Enlightenment, Enlightenment start will catch the sigill and continue,
ecore_x_pointer_ungrab(); // because evas cpu detection use that behaviour. But if we get a SIGILL after that, we endup in
ecore_x_keyboard_ungrab(); // this sig handler. So E start remember the SIGILL, and we will commit succide with a USR1, followed
ecore_x_ungrab(); // by a SEGV.
ecore_x_sync(); kill(getpid(), SIGUSR1);
e_alert_show(); 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 EAPI void

View File

@ -415,7 +415,10 @@ main(int argc, char **argv)
while (!done) 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) if (result == child)
{ {
@ -431,9 +434,22 @@ main(int argc, char **argv)
back = r == 0 && back = r == 0 &&
sig.si_signo != SIGTRAP ? sig.si_signo : 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 || if (r != 0 ||
(sig.si_signo != SIGSEGV && (sig.si_signo != SIGSEGV &&
sig.si_signo != SIGILL &&
sig.si_signo != SIGFPE && sig.si_signo != SIGFPE &&
sig.si_signo != SIGBUS && sig.si_signo != SIGBUS &&
sig.si_signo != SIGABRT)) sig.si_signo != SIGABRT))
@ -470,7 +486,7 @@ main(int argc, char **argv)
snprintf(buffer, 4096, snprintf(buffer, 4096,
backtrace_str ? "%s/enlightenment/utils/enlightenment_alert %i %i %s" : "%s/enlightenment/utils/enlightenment_alert %i %i %s", backtrace_str ? "%s/enlightenment/utils/enlightenment_alert %i %i %s" : "%s/enlightenment/utils/enlightenment_alert %i %i %s",
eina_prefix_lib_get(pfx), eina_prefix_lib_get(pfx),
sig.si_signo, sig.si_signo == SIGSEGV && remember_sigusr1 ? SIGILL : sig.si_signo,
child, child,
backtrace_str); backtrace_str);
r = system(buffer); r = system(buffer);