From: Jonathan Chambers Date: Thu, 1 Feb 2018 08:53:34 +0000 (+0300) Subject: Avoid SIGSEGV during GC_INIT on some Android devices X-Git-Tag: v8.0.0~383 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e73ff18487e2982f01dfc7913a62b77af7bc875;p=gc Avoid SIGSEGV during GC_INIT on some Android devices (part of commit 9379c66 from Unity-Technologies/bdwgc) Issue #173 (bdwgc). * include/gc.h [(HOST_ANDROID || __ANDROID__) && !GC_NOT_DLL] (GC_INIT_CONF_ROOTS): Define to empty unless IGNORE_DYNAMIC_LOADING; add comment. --- diff --git a/include/gc.h b/include/gc.h index 3f7c9d52..f206cf8c 100644 --- a/include/gc.h +++ b/include/gc.h @@ -1833,7 +1833,11 @@ GC_API int GC_CALL GC_get_force_unmap_on_gcollect(void); # define GC_DATAEND ((void *)((ulong)_end)) # define GC_INIT_CONF_ROOTS GC_add_roots(GC_DATASTART, GC_DATAEND) #elif (defined(HOST_ANDROID) || defined(__ANDROID__)) \ - && !defined(GC_NOT_DLL) + && !defined(GC_NOT_DLL) && defined(IGNORE_DYNAMIC_LOADING) + /* It causes the entire binary section of memory be pushed as a root. */ + /* This might be a bad idea though because on some Android devices */ + /* some of the binary data might become unmapped thus causing SIGSEGV */ + /* with code SEGV_MAPERR. */ # pragma weak _etext # pragma weak __data_start # pragma weak __dso_handle