[PATCH] Generalize stackdepot.
Evgeniy Stepanov
eugenis at google.com
Wed May 21 01:17:15 PDT 2014
================
Comment at: lib/msan/msan.cc:284
@@ +283,3 @@
+ int use_count = h.use_count();
+ if (use_count > __msan::flags()->origin_history_per_stack_limit)
+ return id;
----------------
Dmitry Vyukov wrote:
> Isn't it all in __msan namespace?
right
================
Comment at: lib/msan/msan.cc:566
@@ -519,1 +565,3 @@
+ bool inserted = ChainedOriginDepotPut(idx, Origin::kStackRoot, &id);
+ CHECK(inserted); // All first time stack origins are unique.
*id_ptr = id;
----------------
Dmitry Vyukov wrote:
> Isn't it subject to races? What if two threads trigger this alloca for the first time?
Yeah, we may have duplicate entries for stack origins.
================
Comment at: lib/msan/msan_allocator.cc:108
@@ -107,1 +107,3 @@
+ ChainedOriginDepotPut(stack_id, Origin::kHeapRoot, &id);
+ __msan_set_origin(allocated, size, Origin(id, 1).raw_id());
}
----------------
Dmitry Vyukov wrote:
> Origin(id, 1)
> can't we start depth from 0 here? that would enlarge the maximum chain depth by 1.
The idea here is to reserve depth value of 0 for unlimited history length for this single origin. Not sure we need that, but adding it later would reduce max history length by 1 and may break existing users.
http://reviews.llvm.org/D3790
More information about the llvm-commits
mailing list