]> granicus.if.org Git - gc/commitdiff
Fix 'ACCESS_VIOLATION in marker' GC warning on Win32 async thread start
authorIvan Maidanski <ivmai@mail.ru>
Wed, 2 Oct 2019 21:23:31 +0000 (00:23 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 2 Oct 2019 21:23:31 +0000 (00:23 +0300)
(fix of commit 38d07c167)

* mark.c [WRAP_MARK_SOME && (MSWIN32 || MSWINCE) && GC_WIN32_THREADS
&& !GC_PTHREADS] (GC_mark_some): If GC_started_thread_while_stopped()
then goto handle_thr_start instead of handle_ex.
* mark.c [WRAP_MARK_SOME && GC_WIN32_THREADS && !GC_PTHREADS]
(GC_mark_some): Define handle_thr_start label right after WARN() call.

mark.c

diff --git a/mark.c b/mark.c
index 0a1d13941c38296b5a01a0aa88851b085721fe7a..e6f0915909a00bd159d07908801b36c24bf20af5 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -493,7 +493,8 @@ static void alloc_mark_stack(size_t);
         /* to the exception case; our results are invalid and we have   */
         /* to start over.  This cannot be prevented since we can't      */
         /* block in DllMain.                                            */
-        if (GC_started_thread_while_stopped()) goto handle_ex;
+        if (GC_started_thread_while_stopped())
+          goto handle_thr_start;
 #     endif
      rm_handler:
       return ret_val;
@@ -530,7 +531,7 @@ static void alloc_mark_stack(size_t);
           goto handle_ex;
 #     if defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS)
         if (GC_started_thread_while_stopped())
-          goto handle_ex;
+          goto handle_thr_start;
 #     endif
     rm_handler:
       /* Uninstall the exception handler.       */
@@ -571,6 +572,9 @@ handle_ex:
           warned_gc_no = GC_gc_no;
         }
       }
+#   if defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS)
+      handle_thr_start:
+#   endif
       /* We have bad roots on the stack.  Discard mark stack.   */
       /* Rescan from marked objects.  Redetermine roots.        */
 #     ifdef REGISTER_LIBRARIES_EARLY