[前][次][番号順一覧][スレッド一覧]

ruby-changes:53348

From: shyouhei <ko1@a...>
Date: Tue, 6 Nov 2018 14:06:25 +0900 (JST)
Subject: [ruby-changes:53348] shyouhei:r65564 (trunk): annotate functions to blacklist MSAN

shyouhei	2018-11-06 14:06:20 +0900 (Tue, 06 Nov 2018)

  New Revision: 65564

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65564

  Log:
    annotate functions to blacklist MSAN
    
    In these functions we are intentionally reading memory address
    not owned by us.  These reads should not be diagnosed.
    
    See also [Bug #8680]
    See also https://travis-ci.org/ruby/ruby/jobs/451202718

  Modified files:
    trunk/gc.c
    trunk/internal.h
Index: internal.h
===================================================================
--- internal.h	(revision 65563)
+++ internal.h	(revision 65564)
@@ -68,6 +68,10 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/internal.h#L68
 # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) x
 #endif
 
+#ifndef NO_SANITIZE
+#define NO_SANITIZE(x, y)
+#endif
+
 #ifdef HAVE_VALGRIND_MEMCHECK_H
 # include <valgrind/memcheck.h>
 # ifndef VALGRIND_MAKE_MEM_DEFINED
Index: gc.c
===================================================================
--- gc.c	(revision 65563)
+++ gc.c	(revision 65564)
@@ -864,7 +864,7 @@ static void gc_sweep_continue(rb_objspac https://github.com/ruby/ruby/blob/trunk/gc.c#L864
 
 static inline void gc_mark(rb_objspace_t *objspace, VALUE ptr);
 static void gc_mark_ptr(rb_objspace_t *objspace, VALUE ptr);
-static void gc_mark_maybe(rb_objspace_t *objspace, VALUE ptr);
+NO_SANITIZE("memory", static void gc_mark_maybe(rb_objspace_t *objspace, VALUE ptr));
 static void gc_mark_children(rb_objspace_t *objspace, VALUE ptr);
 
 static int gc_mark_stacked_objects_incremental(rb_objspace_t *, size_t count);
@@ -872,7 +872,7 @@ static int gc_mark_stacked_objects_all(r https://github.com/ruby/ruby/blob/trunk/gc.c#L872
 static void gc_grey(rb_objspace_t *objspace, VALUE ptr);
 
 static inline int gc_mark_set(rb_objspace_t *objspace, VALUE obj);
-static inline int is_pointer_to_heap(rb_objspace_t *objspace, void *ptr);
+NO_SANITIZE("memory", static inline int is_pointer_to_heap(rb_objspace_t *objspace, void *ptr));
 
 static void   push_mark_stack(mark_stack_t *, VALUE);
 static int    pop_mark_stack(mark_stack_t *, VALUE *);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]