memcpy warnings on 3.5.0

Jason Evans jasone at canonware.com
Tue Jan 28 23:00:09 PST 2014


On Jan 28, 2014, at 7:49 PM, Eduardo Silva <edsiper at gmail.com> wrote:
> are these warnings relevants ?
> 
> In function ‘memcpy’,
>     inlined from ‘je_prof_boot0’ at src/prof.c:1289:8:
> /usr/include/x86_64-linux-gnu/bits/string3.h:51:3: warning: call to __builtin___memcpy_chk will always overflow destination buffer [enabled by default]
>    return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
>    ^
> In file included from /usr/include/string.h:638:0,
>                  from include/jemalloc/internal/jemalloc_internal.h:41,
>                  from src/prof.c:2:
> In function ‘memcpy’,
>     inlined from ‘je_prof_boot0’ at src/prof.c:1289:8:
> /usr/include/x86_64-linux-gnu/bits/string3.h:51:3: warning: call to __builtin___memcpy_chk will always overflow destination buffer [enabled by default]
>    return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));

My guess is that you don’t have heap profiling enabled (—enable-prof), and that the compiler is complaining about what is effectively dead code.  An easy solution is to protect the memcpy() with a conditional:

	if (config_prof)

I’ll make a note to do something like this in order to silence the warnings.

Thanks,
Jason


More information about the jemalloc-discuss mailing list