On Mon, Jul 17, 2017 at 10:25 AM, 'Alexander Potapenko' via address-sanitizer <address-sanitizer@googlegroups.com> wrote: > On Sat, Jul 15, 2017 at 4:39 PM, Yuri Gribov <tetra2...@gmail.com> wrote: >> Hi all, >> >> From reading the original feature request in >> https://github.com/google/sanitizers/issues/8 it seems that adaptive >> redzones were mainly meant for catching overflows in arrays of large >> objects e.g. >> >> struct { >> int a[10]; >> int x; >> } a[100]; >> a[101].x = 0; // Skips redzone >> >> Current adaptation only considers size of array as a whole so would >> add similarly big redzone for same-sized >> >> int a[1100]; >> >> even though risk of large overflow offset here seems to be much lower. >> >> Has anyone considered selecting redzone based on array element size >> rather than array size? Firstly this would allow more intelligent >> redzone selection (current approach does not guarantee that generated >> redzone will cover one array element) and also reduce memory pressure >> (which is important for "embedded" targets). > > I totally agree that for compound type arrays the redzone size must be > based on the array element size. > > Not sure if we need to reduce the redzone size for big arrays of > scalars, as e.g. char arrays are sometimes used as opaque storage for > compound types.
Good point. > Do you have any evidence how big is the memory overhead caused by > redzones in this case? Not yet, this is something we'll need to investigate (my question was mainly whether it makes sense to investigate this). -Y -- You received this message because you are subscribed to the Google Groups "address-sanitizer" group. To unsubscribe from this group and stop receiving emails from it, send an email to address-sanitizer+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.