From 5e73ff18487e2982f01dfc7913a62b77af7bc875 Mon Sep 17 00:00:00 2001 From: Jonathan Chambers Date: Thu, 1 Feb 2018 11:53:34 +0300 Subject: [PATCH] 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. --- include/gc.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/gc.h b/include/gc.h index 3f7c9d5..f206cf8 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 -- 2.7.4