Nilorea Library signals api test.
Nilorea Library signals api test
- Author
- Castagnier Mickael
- Version
- 1.0
- Date
- 04/12/2019
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include <errno.h>
#include <signal.h>
#include <assert.h>
#include <libgen.h>
int main(
int argc,
char* argv[]) {
(void)argc;
return 0;
}
assert(false);
}
int a = 1;
int b = 0;
return a / b;
}
int* p = (int*)0x12345678;
*p = 0;
}
#pragma GCC diagnostic push
#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic ignored "-Winfinite-recursion"
#endif
int foo = 0;
(void)foo;
return rand() % 1000;
}
#pragma GCC diagnostic pop
int a = 1;
int b = 1;
int c = 1;
while (a == 1) {
b = c;
c = a;
a = b;
}
}
raise(SIGILL);
}
void cause_calamity(void)
void illegal_instruction(void)
void cause_segfault(void)
#define n_log(__LEVEL__,...)
Logging function wrapper to get line and func.
#define LOG_DEBUG
debug-level messages
#define LOG_STDERR
internal, default LOG_TYPE
void set_log_level(const int log_level)
Set the global log level value ( static int LOG_LEVEL )
void set_signal_handler(const char *progname)
Install a signal handler for progname.
Signals general handling with stack printing, from https://gist.github.com/jvranish/4441299.