summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-06-22 09:29:21 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-06-22 10:07:49 +0900
commit9639fab82bb910dc8e97ed41aa6385631c4c084e (patch)
tree868a0d470e99fcc3e64e59fbd009cabfb0ca3987
parentc23c410912b78c2097003aada98b33b5e7b9ce9e (diff)
Revert "Revert "eina debug - fix segv if an app is compiled with -pg for profiling""
This reverts commit 0d91088d0fe00ab64e1e852551e850d403e9db37. It also includes a workaround for OSX where RT signals aren't supported due to kernel age (too old a fork of freebsd). fixes D6310 and T7029
-rw-r--r--src/lib/eina/eina_debug_bt.c60
1 files changed, 59 insertions, 1 deletions
diff --git a/src/lib/eina/eina_debug_bt.c b/src/lib/eina/eina_debug_bt.c
index 2a2234f245..f38dcd481a 100644
--- a/src/lib/eina/eina_debug_bt.c
+++ b/src/lib/eina/eina_debug_bt.c
@@ -37,7 +37,65 @@
37 37
38#ifndef _WIN32 38#ifndef _WIN32
39# include <signal.h> 39# include <signal.h>
40# define SIG SIGPROF 40// realtime signals guarantee a minimum of 8, so SIGRTMIN + 7 would be valid
41// at a minimum, so let's choose + 6 ... second last of the minimum set.
42// SIGRTMAX of course is defined too... note the manual pages for sigation say
43// that it calls rt_sigaction transparently for us so... no need for anything
44// else special
45# ifdef SIGRTMIN
46# define SIG (SIGRTMIN + 6)
47# else
48// OSX seems to not support posix RT signals... too old a kernel. so be partly
49// broken on OSX in that a HUP signal will maybe cause a crash... but compiling
50// with -pg would have guaranteed always caused a crash before anyway.
51// given OSX only supports "old-style" signals like:
52//
53// #define SIGHUP 1 /* hangup */
54// #define SIGINT 2 /* interrupt */
55// #define SIGQUIT 3 /* quit */
56// #define SIGILL 4 /* illegal instruction (not reset when caught) */
57// #define SIGTRAP 5 /* trace trap (not reset when caught) */
58// #define SIGABRT 6 /* abort() */
59// #if (defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE))
60// # define SIGPOLL 7 /* pollable event ([XSR] generated, not supported) */
61// #else /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
62// # define SIGIOT SIGABRT /* compatibility */
63// # define SIGEMT 7 /* EMT instruction */
64// #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
65// #define SIGFPE 8 /* floating point exception */
66// #define SIGKILL 9 /* kill (cannot be caught or ignored) */
67// #define SIGBUS 10 /* bus error */
68// #define SIGSEGV 11 /* segmentation violation */
69// #define SIGSYS 12 /* bad argument to system call */
70// #define SIGPIPE 13 /* write on a pipe with no one to read it */
71// #define SIGALRM 14 /* alarm clock */
72// #define SIGTERM 15 /* software termination signal from kill */
73// #define SIGURG 16 /* urgent condition on IO channel */
74// #define SIGSTOP 17 /* sendable stop signal not from tty */
75// #define SIGTSTP 18 /* stop signal from tty */
76// #define SIGCONT 19 /* continue a stopped process */
77// #define SIGCHLD 20 /* to parent on child stop or exit */
78// #define SIGTTIN 21 /* to readers pgrp upon background tty read */
79// #define SIGTTOU 22 /* like TTIN for output if (tp->t_local&LTOSTOP) */
80// #if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
81// # define SIGIO 23 /* input/output possible signal */
82// #endif
83// #define SIGXCPU 24 /* exceeded CPU time limit */
84// #define SIGXFSZ 25 /* exceeded file size limit */
85// #define SIGVTALRM 26 /* virtual time alarm */
86// #define SIGPROF 27 /* profiling time alarm */
87// #if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
88// # define SIGWINCH 28 /* window size changes */
89// # define SIGINFO 29 /* information request */
90// #endif
91// #define SIGUSR1 30 /* user defined signal 1 */
92// #define SIGUSR2 31 /* user defined signal 2 */
93//
94// (excerpt from OSX's signal.h - found at:
95// http://github.com/st3fan/osx-10.9/blob/master/xnu-2422.1.72/bsd/sys/signal.h
96// pasting here due to how difficult it was to find a signal list for OSX)
97# define SIG SIGHUP
98# endif
41#endif 99#endif
42 100
43static Eina_Semaphore _wait_for_bts_sem; 101static Eina_Semaphore _wait_for_bts_sem;