On 12/26/2014 04:51 PM, 'Alexander Potapenko' via address-sanitizer wrote:
> How are you going to share the redzone size between all globals in the
> module? They vary depending on the original global size.

Ok, I didn't know that Clang uses adaptive global redzones. AFAIK GCC does not so it's much easier to just recompute them there.

> What sounds doable is moving |size_with_redzone| calculation to the
> runtime, but this might be too fragile.

Agree, that would also make redzone size computation a part of compiler-runtime ABI which is bad.

> Regarding |module_name| and |location|, I think we can do a better job here.
> My hypothesis is that there're unnecessarily many
> __asan_global_source_location structures because |line_no| and
> |column_no| are almost always unique.
> Thus it's better to pull them into __asan_global (we can probably even
> squeeze both fields into a single uptr, though we need to be accurate
> on 32-but systems).
> On the other hand, there're far less unique pairs of module names and
> source file names (aka |location->filename|), so it's natural to group
> them into a single struct:

Right.

>    uptr has_dynamic_init;   // The above suggestion still applies, we
> can store this flag in |size_with_redzone|

Either that or make this a dedicated int for flags?

>     __asan_global_module_filename *location;

Having an int offset here instead of full-blown pointer would save another 4 bytes + 24 for relocation. But perhaps that's niggling.

-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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to