Re: [Gc] glibc 2.19 lock elision bug

Thomas Schwinge <[email protected]> Tue, 23 Sep 2014 09:18:40 +0200
Newsgroups gmane.comp.programming.garbage-collection.boehmgc
Message-ID <[email protected]>
Hi!

On Sat, 19 Jul 2014 16:48:39 +0400, Ivan Maidanski <ivmai-JGs/[email protected]> wrote:
> Thank you for the patch.
> I reviewed it and applied several changes - see  https://github.com/ivmai/bdwgc/commit/757af8aa17ed107ff2915f93967087835c0100dc :

I've hit two issues (in GNU Hurd testing, but generally applicable), for
which I'm attaching patches.  Please tell if you'd rather have me submit
these as Github pull requests.

Adding the following include directive avoids an implicit declaration
warning:

commit 6b9b4eef2622a23856af47fb9aa0eebc159960e4
Author: Thomas Schwinge <[email protected]>
Date:   Mon Sep 22 13:34:30 2014 +0200

    Avoid compiler warning.
    
        ../master/misc.c: In function 'GC_init':
        ../master/misc.c:892:7: warning: implicit declaration of function 'GC_setup_mark_lock' [-Wimplicit-function-declaration]
    
    * misc.c: Include "private/pthread_support.h".
---
 misc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git misc.c misc.c
index 32cbe24..41bd3f4 100644
--- misc.c
+++ misc.c
@@ -14,6 +14,7 @@
  */
 
 #include "private/gc_pmark.h"
+#include "private/pthread_support.h"
 
 #include <stdio.h>
 #include <limits.h>

Guarding GC_setup_mark_lock usage with PARALLEL_MARK is required to avoid
an undefined reference in non-PARALLEL_MARK configurations:

commit 4c8e0dc234e671c4d64ffab9d4f94b6cd8cc2f63
Author: Thomas Schwinge <[email protected]>
Date:   Mon Sep 22 13:36:00 2014 +0200

    Refer to GC_setup_mark_lock only in PARALLEL_MARK code.
    
        ./.libs/libgc.so: undefined reference to `GC_setup_mark_lock'
    
    * misc.c (GC_init): Guard GC_setup_mark_lock usage.
---
 misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git misc.c misc.c
index 41bd3f4..721a999 100644
--- misc.c
+++ misc.c
@@ -889,7 +889,7 @@ GC_API void GC_CALL GC_init(void)
         /* else */ InitializeCriticalSection (&GC_allocate_ml);
      }
 #   endif /* GC_WIN32_THREADS */
-#   if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS)
+#   if defined(PARALLEL_MARK) && defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS)
       GC_setup_mark_lock();
 #   endif /* GC_PTHREADS */
 #   if (defined(MSWIN32) || defined(MSWINCE)) && defined(THREADS)


Grüße,
 Thomas

_______________________________________________
bdwgc mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/bdwgc
signature.asc (application/pgp-signature, 472 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJUIR7QAAoJEK3/DN1sMFFtMLwH/R3ziNvaX4ed+tTJaZ/cILvQ
zqjf40stVdujob9S3eLuTC6HHVtnAD8wDTy+BBbzDcRkONFL+6SRqzlI5p3jKsPS
0ZrJLcgHgSzarvQAlC186MmWya6RG8Wc0hMXWR6/cXx4w4W6D6X+N/q6kEGXFpQp
nlxQ3SXBtkH1vRpO+2qtJ7kCm3V3xpQ94yrtQNu3yRsAv5zUiz691kiUbOGAXNmA
U5QvEyXSZ8S5h6v1qOa6/o0Id2liiWYKCOQZeQQnxhua0znviCA156pLmdmoZ1oP
0nT+xX+tY1jSQ0He8k30OiaEvsFLRzvGUCe09LfP9guIVH0tQWwclYp2Y948SqI=
=gyhQ
-----END PGP SIGNATURE-----