43 fprintf(stderr,
"[Terminating with signal %i]\n", sig);
50 if (old_handler !=
sigsegv_handler && old_handler != SIG_ERR && old_handler != SIG_DFL) {
52 fprintf(stderr,
"GBK_install_SIGSEGV_handler: Did not install SIGSEGV handler (there's already another one installed)\n");
65 volatile bool segv_occurred =
false;
66 volatile long found_key;
83 error =
GBS_global_string(
"ARBDB memory manager error: Cannot access address %p", address);
85 else if (key && found_key != key) {
86 error =
GBS_global_string(
"ARBDB memory manager error: object at address %p has wrong type (found: 0x%lx, expected: 0x%lx)",
87 address, found_key, key);
108 return reinterpret_cast<size_t>(&i);
115 volatile bool segv_occurred =
false;
126 volatile int trapped;
139 segv_occurred =
true;
151 return segv_occurred;
172 void TEST_catched_exception() {
184 struct throw_on_destroy {
186 throw_on_destroy(
int i) : j(i) {}
187 ~throw_on_destroy() {
if (j == 666)
throw(667); }
190 void TEST_throw_during_throw() {
191 throw_on_destroy tod(666);
198 void TEST_modify_std_terminate() {
199 std::set_terminate(TEST_catched_exception);
bool GBK_running_on_valgrind()
#define implicated(hypothesis, conclusion)
#define INSTALL_SIGHANDLER(sig, handler, context)
#define ARB_CRASH_CODE(sig)
#define RUNNING_ON_VALGRIND
bool GBK_raises_SIGSEGV(void(*cb)(void))
const char * GBS_global_string(const char *templat,...)
size_t GBK_getNonfreeableAddress()
#define TEST_PUBLISH(testfunction)
#define TEST_EXPECT(cond)
static jmp_buf return_after_segv
static void error(const char *msg)
void GBK_install_SIGSEGV_handler(bool dump_backtrace)
fputs(TRACE_PREFIX, stderr)
static bool dump_backtrace_on_sigsegv
void GBK_dump_backtrace(FILE *out, const char *message)
GB_ERROR GBK_test_address(long *address, long key)
#define UNINSTALL_SIGHANDLER(sig, handler, old_handler, context)
static bool suppress_sigsegv
static __ATTR__NORETURN void sigsegv_handler(int sig)