--- Comment #16 from Dominik Vogt <vogt at linux dot> ---
There's nothing wrong with applying that change, but it does not fix the
problem.  I'm still debugging this and have it narrowed down to being related
with functions that use alloca() and call another function using varargs.

This code extracted from gencfn-macros:
#include <stdarg.h>
#include <stdio.h>
#include <string.h>

char *gs;

char * concat_copy2 (const char *first, ...)
  va_list args;
  va_start (args, first);
    char *end = gs;
    const char *arg;

    for (arg = first; arg ; arg = va_arg (args, const char *))
        unsigned long length = strlen (arg);
        memcpy (end, arg, length);
        end += length;
    *end = '\000';
  va_end (args);

  return gs;

bool contains (char *k)
  fprintf(stderr, "!!!contains: %p '%s'\n", (void *)&k, (char *)k);
  return false;

int main(int argc, char **argv)
  char *tmp;

  gs = (char *) __builtin_alloca(14);
  tmp = concat_copy2 ("BUILT_IN_", "blab", 0);

  return contains(tmp) ? 0 : 1;

This somehow overwrites the string concatenated in tmp/gs with some pointer.

Reply via email to