[PATCH] D43318: [asan] Be more careful and verbose when allocating dynamic shadow memory

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 24 08:40:36 PST 2018


fjricci added inline comments.


================
Comment at: lib/asan/asan_mac.cc:75
     uptr new_max_vm = RoundDownTo(largest_gap_found << SHADOW_SCALE, alignment);
+    if (new_max_vm < max_occupied_vm) {
+      Report("Unable to find a memory range for dynamic shadow.\n");
----------------
george.karpenkov wrote:
> kubamracek wrote:
> > george.karpenkov wrote:
> > > I don't quite understand semantics here.
> > > `max_occupied_vm` to me means "maximal size of occupied virtual memory".
> > > Then why it's a problem if a new maximal size is smaller? Shouldn't it be a problem if it's larger?
> > `max_occupied_vm` is the largest address that it already occupied by something. We're trying to restrict the VM space with `new_max_vm` being the new VM limit. This check is to make sure we don't restrict too much (which would overwrite memory that is already used).
> > 
> > Suggestions for better name of `max_occupied_vm`?
> `largest_occupied_vm`? Almost the same, but at least to me does quite have same connotation, but that's a not important nit.. In any case, maybe this should be explained in a doxygen comment for `FindAvailableMemoryRange`?
`max_occupied_addr` or `max_occupied_vm_addr`, perhaps?


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D43318





More information about the llvm-commits mailing list