On Mon, Mar 19, 2018 at 06:44:39PM +0300, Maxim Ostapenko wrote:
> as noted in bugzilla, ASan inserts redzones forĀ  `.LDFCM*' variables and
> breaks internal ABI between GCC and libstdc++ because libstdc++ tries to
> obtain a pointer to `typeinfo for (anonymous namespace)::SomeRandomType'
> from a constant offset from `.LDFCM*' labels and hits these redzones. This
> can be trivially fixed by not sanitizing `.LDFCM*' variables (and other
> debug variables) at all.

I don't like very much adding an extra argument for such so frequently used
function to handle a corner case.
Wouldn't just:
  /* Don't instrument this decl with -fsanitize=*address.  */
  unsigned int save_flag_sanitize = flag_sanitize;
  flag_sanitize &= ~(SANITIZE_ADDRESS | SANITIZE_USER_ADDRESS
                     | SANITIZE_KERNEL_ADDRESS);
  assemble_variable (decl, 1, 1, 1);
  flag_sanitize = save_flag_sanitize;
DTRT?

        Jakub

Reply via email to