forked from enlightenment/enlightenment
E: little hack to handle valid SIGILL.
SVN revision: 78976
This commit is contained in:
parent
635d4636e4
commit
03d50e9546
|
@ -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
|
||||
|
|
|
@ -415,6 +415,9 @@ main(int argc, char **argv)
|
|||
|
||||
while (!done)
|
||||
{
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue