]> granicus.if.org Git - gc/commitdiff
Fix missing SIGBUS handler setup for kFreeBSD
authorIvan Maidanski <ivmai@mail.ru>
Fri, 6 Apr 2018 06:13:03 +0000 (09:13 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 17 Apr 2018 20:26:00 +0000 (23:26 +0300)
Issue #184 (bdwgc).

* os_dep.c [MPROTECT_VDB && !DARWIN && !MSWIN32 && !MSWINCE && FREEBSD
&& __GLIBC__] (GC_mprotect_dirty_init): Call sigaction(SIGBUS).

os_dep.c

index 1209f7d5f7e37a0d90bd76bf5258307b7dff6d33..45ffe44aac6e1ae2832fe85a389bb9fccc35138b 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -3340,7 +3340,7 @@ GC_INNER void GC_remove_protection(struct hblk *h, word nblocks,
         GC_VERBOSE_LOG_PRINTF("Replaced other SIGSEGV handler\n");
       }
 #   if defined(HPUX) || defined(LINUX) || defined(HURD) \
-       || (defined(FREEBSD) && defined(SUNOS5SIGS))
+       || (defined(FREEBSD) && (defined(__GLIBC__) || defined(SUNOS5SIGS)))
       sigaction(SIGBUS, &act, &oldact);
       if ((oldact.sa_flags & SA_SIGINFO) != 0) {
         GC_old_bus_handler = oldact.sa_sigaction;