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?


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

Reply via email to