···2626 does with an unrecognised file.
2727 (David Allsopp, review by Antonin Décimo and Sébastien Hinderer)
28282929+- #13987: Remove a spurious TSan report in case of benign data race between
3030+ major GC read and write from the mutator (fixes #13427)
3131+ (Olivier Nicole, report by Thomas Leonard, review by Gabriel Scherer)
3232+2933- #13966: Enable "generalized polymorphic #install_printer"
3034 in the debugger
3135 (Pierre Boutillier and Gabriel Scherer, review by Florian Angeletti)
+14-13
runtime/major_gc.c
···11201120 mark_stack_prune(stk);
11211121}
1122112211231123+/* This function is used for reads that may race with a concurrent `caml_modify`
11241124+ from the mutator. Without this, TSan would flag it as a race (see section
11251125+ 3.2 of comment in tsan.c); however, we have decided that these races are
11261126+ benign. We therefore use this function instead, ensuring that the read is
11271127+ not seen by TSan. */
11281128+static CAMLno_tsan
11291129+#if defined(WITH_THREAD_SANITIZER)
11301130+Caml_noinline
11311131+#endif
11321132+value volatile_load_uninstrumented(volatile value* p) {
11331133+ return *p;
11341134+}
11351135+11231136Caml_inline void mark_stack_push_range(struct mark_stack* stk,
11241137 value_ptr start, value_ptr end)
11251138{
···11601173 end = (block_wsz < 8 ? block_wsz : 8);
1161117411621175 for (i = offset; i < end; i++) {
11631163- value v = Field(block, i);
11761176+ value v = volatile_load_uninstrumented(&Field(block, i));
1164117711651178 if (Is_markable(v))
11661179 break;
···12521265 }
12531266}
1254126712551255-static CAMLno_tsan
12561256-#if defined(WITH_THREAD_SANITIZER)
12571257-Caml_noinline
12581258-#endif
12591259-value volatile_load_uninstrumented(volatile value* p) {
12601260- return *p;
12611261-}
12621262-12631268Caml_noinline static intnat do_some_marking(struct mark_stack* stk,
12641269 intnat budget) {
12651270 prefetch_buffer_t pb = { .enqueued = 0, .dequeued = 0,
···13581363 for (; me.start < scan_end; me.start++) {
13591364 CAMLassert(budget >= 0);
1360136513611361- /* This load may race with a concurrent caml_modify. It does not
13621362- constitute a data race as this is a volatile load. However, TSan will
13631363- wrongly see a race here (see section 3.2 of comment in tsan.c). We
13641364- therefore make sure it is never TSan-instrumented. */
13651366 value child = volatile_load_uninstrumented(me.start);
1366136713671368 budget--;