From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39432 invoked by alias); 23 Oct 2015 08:10:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 39406 invoked by uid 89); 23 Oct 2015 08:10:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 23 Oct 2015 08:10:13 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id CEE5719CBA0; Fri, 23 Oct 2015 08:10:11 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-53.ams2.redhat.com [10.36.116.53]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9N8A9FW021135 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 23 Oct 2015 04:10:11 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id t9N8A8Nl013216; Fri, 23 Oct 2015 10:10:08 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id t9N8A6hS013215; Fri, 23 Oct 2015 10:10:06 +0200 Date: Fri, 23 Oct 2015 08:10:00 -0000 From: Jakub Jelinek To: Ilya Verbin Cc: Thomas Schwinge , Kirill Yukhin , gcc-patches@gcc.gnu.org Subject: Re: [PATCH 0/4] OpenMP 4.0 offloading to Intel MIC Message-ID: <20151023081006.GX478@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20141021171323.GA47586@msticlxl57.ims.intel.com> <87k31jzye3.fsf@kepler.schwinge.homeip.net> <20151022182637.GC63867@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151022182637.GC63867@msticlxl57.ims.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg02381.txt.bz2 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