Added SIGSEGV diagnostics with 3m
svn: r12806
This commit is contained in:
parent
1af924d8de
commit
653db9dcbe
|
@ -17,8 +17,21 @@
|
||||||
# include <signal.h>
|
# include <signal.h>
|
||||||
void fault_handler(int sn, struct siginfo *si, void *ctx)
|
void fault_handler(int sn, struct siginfo *si, void *ctx)
|
||||||
{
|
{
|
||||||
if (!designate_modified(si->si_addr))
|
void *p = si->si_addr;
|
||||||
|
if (si->si_code != SEGV_ACCERR) { /*SEGV_MAPERR*/
|
||||||
|
printf("SIGSEGV fault on %p\n", p);
|
||||||
abort();
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!designate_modified(p)) {
|
||||||
|
if (si->si_code == SEGV_ACCERR) {
|
||||||
|
printf("mprotect fault on %p\n", p);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("?? %i fault on %p\n", si->si_code, p);
|
||||||
|
}
|
||||||
|
abort();
|
||||||
|
}
|
||||||
# define NEED_SIGACTION
|
# define NEED_SIGACTION
|
||||||
# define USE_SIGACTON_SIGNAL_KIND SIGSEGV
|
# define USE_SIGACTON_SIGNAL_KIND SIGSEGV
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user