2012-06-20 23:19:43 -07:00
|
|
|
/*
|
|
|
|
* NOTE TO FreeBSD users. Install libexecinfo from
|
2005-03-18 09:02:47 -08:00
|
|
|
* ports/devel/libexecinfo and add -lexecinfo to LDFLAGS
|
|
|
|
* to add backtrace support.
|
2005-01-27 02:14:22 -08:00
|
|
|
*/
|
|
|
|
#include "e.h"
|
2009-03-26 19:23:13 -07:00
|
|
|
|
2015-11-02 23:01:42 -08:00
|
|
|
#ifdef HAVE_WAYLAND
|
2017-02-28 05:40:00 -08:00
|
|
|
# ifdef USE_MODULE_WL_DRM
|
|
|
|
# include <Ecore_Drm2.h>
|
2015-11-23 12:02:52 -08:00
|
|
|
# endif
|
fix tty problem when enlightenment(drm-backend) is killed by SIGSEGV
Summary:
When enlightenment is working as wayland display server, enlightenment
changes KDSETMODE to KD_GRAPHICS in _ecore_drm_tty_setup(). However,
when enlightenment is killed by SIGSEGV, it doesn't changes KDSETMODE
to KD_TEXT because englightenment process doesn't call ecore_drm_tty_close().
When enlightenment is killed by SIGSEGV, it should get drm devices with
ecore_drm_device_get_list(), and will call ecore_drm_launcher_disconnect(),
and ecore_drm_launcher_disconnect will call ecore_drm_tty_close() internally.
Change-Id: I425488eb4489709cc968b77bd4bc48a4aa4ae30c
Reviewers: zmike, cedric, raster, gwanglim, devilhorns
Reviewed By: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2160
2015-03-17 06:33:55 -07:00
|
|
|
#endif
|
|
|
|
|
2009-11-11 13:04:21 -08:00
|
|
|
#ifdef HAVE_EXECINFO_H
|
2012-06-20 23:19:43 -07:00
|
|
|
# include <execinfo.h>
|
2009-11-11 13:04:21 -08:00
|
|
|
#endif
|
|
|
|
|
2009-03-26 19:23:13 -07:00
|
|
|
static volatile Eina_Bool _e_x_composite_shutdown_try = 0;
|
2010-08-18 11:32:48 -07:00
|
|
|
|
fix tty problem when enlightenment(drm-backend) is killed by SIGSEGV
Summary:
When enlightenment is working as wayland display server, enlightenment
changes KDSETMODE to KD_GRAPHICS in _ecore_drm_tty_setup(). However,
when enlightenment is killed by SIGSEGV, it doesn't changes KDSETMODE
to KD_TEXT because englightenment process doesn't call ecore_drm_tty_close().
When enlightenment is killed by SIGSEGV, it should get drm devices with
ecore_drm_device_get_list(), and will call ecore_drm_launcher_disconnect(),
and ecore_drm_launcher_disconnect will call ecore_drm_tty_close() internally.
Change-Id: I425488eb4489709cc968b77bd4bc48a4aa4ae30c
Reviewers: zmike, cedric, raster, gwanglim, devilhorns
Reviewed By: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2160
2015-03-17 06:33:55 -07:00
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2009-03-26 19:23:13 -07:00
|
|
|
static void
|
|
|
|
_e_x_composite_shutdown(void)
|
|
|
|
{
|
2011-07-25 02:40:18 -07:00
|
|
|
// Ecore_X_Display *dpy;
|
2009-03-26 19:23:13 -07:00
|
|
|
Ecore_X_Window root;
|
|
|
|
|
2012-11-14 01:57:11 -08:00
|
|
|
if (_e_x_composite_shutdown_try) return; /* we failed :-( */
|
2009-03-26 19:23:13 -07:00
|
|
|
_e_x_composite_shutdown_try = 1;
|
|
|
|
|
2011-07-25 02:40:18 -07:00
|
|
|
// dpy = ecore_x_display_get();
|
|
|
|
root = ecore_x_window_root_first_get();
|
2009-03-26 19:23:13 -07:00
|
|
|
|
|
|
|
/* ignore errors, we really don't care at this point */
|
|
|
|
ecore_x_composite_unredirect_subwindows(root, ECORE_X_COMPOSITE_UPDATE_MANUAL);
|
|
|
|
_e_x_composite_shutdown_try = 0;
|
|
|
|
}
|
fix tty problem when enlightenment(drm-backend) is killed by SIGSEGV
Summary:
When enlightenment is working as wayland display server, enlightenment
changes KDSETMODE to KD_GRAPHICS in _ecore_drm_tty_setup(). However,
when enlightenment is killed by SIGSEGV, it doesn't changes KDSETMODE
to KD_TEXT because englightenment process doesn't call ecore_drm_tty_close().
When enlightenment is killed by SIGSEGV, it should get drm devices with
ecore_drm_device_get_list(), and will call ecore_drm_launcher_disconnect(),
and ecore_drm_launcher_disconnect will call ecore_drm_tty_close() internally.
Change-Id: I425488eb4489709cc968b77bd4bc48a4aa4ae30c
Reviewers: zmike, cedric, raster, gwanglim, devilhorns
Reviewed By: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2160
2015-03-17 06:33:55 -07:00
|
|
|
#endif
|
2005-03-30 19:21:58 -08:00
|
|
|
|
2012-11-09 13:54:12 -08:00
|
|
|
#if 0
|
2009-07-11 09:27:37 -07:00
|
|
|
#define _e_write_safe(fd, buf) _e_write_safe_int(fd, buf, sizeof(buf))
|
2010-08-18 11:32:48 -07:00
|
|
|
|
2009-07-11 09:27:37 -07:00
|
|
|
static void
|
|
|
|
_e_write_safe_int(int fd, const char *buf, size_t size)
|
|
|
|
{
|
|
|
|
while (size > 0)
|
|
|
|
{
|
2012-11-14 01:57:11 -08:00
|
|
|
ssize_t done = write(fd, buf, size);
|
|
|
|
if (done >= 0)
|
|
|
|
{
|
|
|
|
buf += done;
|
|
|
|
size -= done;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((errno == EAGAIN) || (errno == EINTR))
|
|
|
|
continue;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
perror("write");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2009-07-11 09:27:37 -07:00
|
|
|
}
|
|
|
|
}
|
2012-11-14 01:57:11 -08:00
|
|
|
|
2012-11-09 13:54:12 -08:00
|
|
|
#endif
|
2009-07-11 09:27:37 -07:00
|
|
|
|
2015-07-09 12:01:50 -07:00
|
|
|
static void
|
|
|
|
_e_crash(void)
|
2005-04-11 13:25:52 -07:00
|
|
|
{
|
2015-11-02 23:01:42 -08:00
|
|
|
#ifdef HAVE_WAYLAND
|
2015-07-09 12:11:13 -07:00
|
|
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
fix tty problem when enlightenment(drm-backend) is killed by SIGSEGV
Summary:
When enlightenment is working as wayland display server, enlightenment
changes KDSETMODE to KD_GRAPHICS in _ecore_drm_tty_setup(). However,
when enlightenment is killed by SIGSEGV, it doesn't changes KDSETMODE
to KD_TEXT because englightenment process doesn't call ecore_drm_tty_close().
When enlightenment is killed by SIGSEGV, it should get drm devices with
ecore_drm_device_get_list(), and will call ecore_drm_launcher_disconnect(),
and ecore_drm_launcher_disconnect will call ecore_drm_tty_close() internally.
Change-Id: I425488eb4489709cc968b77bd4bc48a4aa4ae30c
Reviewers: zmike, cedric, raster, gwanglim, devilhorns
Reviewed By: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2160
2015-03-17 06:33:55 -07:00
|
|
|
{
|
2017-02-28 05:40:00 -08:00
|
|
|
# ifdef USE_MODULE_WL_DRM
|
2016-05-11 07:02:22 -07:00
|
|
|
if (!strstr(ecore_evas_engine_name_get(e_comp->ee), "drm")) return;
|
|
|
|
Ecore_Drm2_Device *dev;
|
|
|
|
|
|
|
|
dev = ecore_evas_data_get(e_comp->ee, "device");
|
|
|
|
if (dev)
|
|
|
|
{
|
|
|
|
ecore_drm2_outputs_destroy(dev);
|
|
|
|
ecore_drm2_device_close(dev);
|
|
|
|
ecore_drm2_device_free(dev);
|
|
|
|
}
|
|
|
|
ecore_drm2_shutdown();
|
|
|
|
# endif
|
2015-07-09 12:11:13 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifndef HAVE_WAYLAND_ONLY
|
2009-03-26 19:23:13 -07:00
|
|
|
_e_x_composite_shutdown();
|
2005-06-15 23:29:32 -07:00
|
|
|
ecore_x_pointer_ungrab();
|
|
|
|
ecore_x_keyboard_ungrab();
|
|
|
|
ecore_x_ungrab();
|
|
|
|
ecore_x_sync();
|
2012-10-31 23:23:49 -07:00
|
|
|
e_alert_show();
|
2015-02-25 00:15:41 -08:00
|
|
|
#endif
|
2005-01-27 02:14:22 -08:00
|
|
|
}
|
|
|
|
|
2015-07-09 12:01:50 -07:00
|
|
|
/* a tricky little devil, requires e and it's libs to be built
|
|
|
|
* with the -rdynamic flag to GCC for any sort of decent output.
|
|
|
|
*/
|
|
|
|
E_API void
|
|
|
|
e_sigseg_act(int x EINA_UNUSED, siginfo_t *info EINA_UNUSED, void *data EINA_UNUSED)
|
|
|
|
{
|
|
|
|
_e_crash();
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2015-03-18 15:09:09 -07:00
|
|
|
e_sigill_act(int x EINA_UNUSED, siginfo_t *info EINA_UNUSED, void *data EINA_UNUSED)
|
2005-06-14 22:06:45 -07:00
|
|
|
{
|
2015-06-16 13:10:21 -07:00
|
|
|
// 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 end up in
|
|
|
|
// this sig handler. So E start remember the SIGILL, and we will commit suicide with a USR1, followed
|
2012-11-07 12:56:57 -08:00
|
|
|
// 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(); */
|
2005-06-14 22:06:45 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2015-03-18 15:09:09 -07:00
|
|
|
e_sigfpe_act(int x EINA_UNUSED, siginfo_t *info EINA_UNUSED, void *data EINA_UNUSED)
|
2005-06-14 22:06:45 -07:00
|
|
|
{
|
2015-07-09 12:01:50 -07:00
|
|
|
_e_crash();
|
2005-06-14 22:06:45 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2015-03-18 15:09:09 -07:00
|
|
|
e_sigbus_act(int x EINA_UNUSED, siginfo_t *info EINA_UNUSED, void *data EINA_UNUSED)
|
2005-06-14 22:06:45 -07:00
|
|
|
{
|
2015-07-09 12:01:50 -07:00
|
|
|
_e_crash();
|
2005-06-14 22:06:45 -07:00
|
|
|
}
|
2006-04-01 20:18:18 -08:00
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2015-03-18 15:09:09 -07:00
|
|
|
e_sigabrt_act(int x EINA_UNUSED, siginfo_t *info EINA_UNUSED, void *data EINA_UNUSED)
|
2006-04-01 20:18:18 -08:00
|
|
|
{
|
2015-07-09 12:01:50 -07:00
|
|
|
_e_crash();
|
2006-04-01 20:18:18 -08:00
|
|
|
}
|