This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 0/4] OpenMP 4.0 offloading to Intel MIC
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ilya Verbin <iverbin at gmail dot com>
- Cc: Thomas Schwinge <thomas at codesourcery dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 23 Oct 2015 10:10:06 +0200
- Subject: Re: [PATCH 0/4] OpenMP 4.0 offloading to Intel MIC
- Authentication-results: sourceware.org; auth=none
- References: <20141021171323 dot GA47586 at msticlxl57 dot ims dot intel dot com> <87k31jzye3 dot fsf at kepler dot schwinge dot homeip dot net> <20151022182637 dot GC63867 at msticlxl57 dot ims dot intel dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Oct 22, 2015 at 09:26:37PM +0300, Ilya Verbin wrote:
> On Mon, Dec 22, 2014 at 13:01:40 +0100, Thomas Schwinge wrote:
> > By chance (when tracking down a different problem), I've found the
> > following. Would you please check whether that's a real problem in
> > liboffloadmic, or its libgomp plugin, or just a mis-diagnosis by
> > Valgrind?
> >
> > ==21327== Syscall param write(buf) points to uninitialised byte(s)
>
> Finally we have investigated this :) Valgrind warns about uninitialized bytes,
> inserted into the struct for alignment. It's possible to avoid the warning by
> the patch bellow. Should I commit it, or just leave it as is?
Or use calloc instead of malloc, or add two uint8_t padding fields after the
two uint8_t fields and initialize them too. Though, as you have some
padding after the name, I think calloc is best.
> diff --git a/liboffloadmic/runtime/offload_host.cpp b/liboffloadmic/runtime/offload_host.cpp
> index d04233f..66c2a01 100644
> --- a/liboffloadmic/runtime/offload_host.cpp
> +++ b/liboffloadmic/runtime/offload_host.cpp
> @@ -2425,6 +2425,7 @@ bool OffloadDescriptor::setup_misc_data(const char *name)
> misc_data_size);
> if (m_func_desc == NULL)
> LIBOFFLOAD_ERROR(c_malloc);
> + memset (m_func_desc, 0, m_func_desc_size + misc_data_size);
> m_func_desc->console_enabled = console_enabled;
> m_func_desc->timer_enabled = offload_report_enabled &&
> (timer_enabled || offload_report_level);
>
>
> -- Ilya
Jakub