From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103385 invoked by alias); 6 Dec 2018 22:26:31 -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 103373 invoked by uid 89); 6 Dec 2018 22:26:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Dec 2018 22:26:29 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gV26F-0004Vi-IP from Julian_Brown@mentor.com ; Thu, 06 Dec 2018 14:26:27 -0800 Received: from squid.athome (137.202.0.90) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Thu, 6 Dec 2018 22:26:23 +0000 Date: Thu, 06 Dec 2018 22:26:00 -0000 From: Julian Brown To: Thomas Schwinge CC: Chung-Lin Tang , , , Jakub Jelinek Subject: Re: [PATCH 0/6, OpenACC, libgomp] Async re-work Message-ID: <20181206222621.16ec00f0@squid.athome> In-Reply-To: <20181206222246.1cceb504@squid.athome> References: <432c2e58-7bf6-1f7e-457f-32813207b282@mentor.com> <20181206222246.1cceb504@squid.athome> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00411.txt.bz2 On Thu, 6 Dec 2018 22:22:46 +0000 Julian Brown wrote: > On Thu, 6 Dec 2018 21:42:14 +0100 > Thomas Schwinge wrote: > > > [...] > > ..., where the "Invalid read of size 8" happens, and which > > eventually would try to "free (tgt)" again, via > > libgomp/target.c:gomp_unmap_tgt: > > > > attribute_hidden void > > gomp_unmap_tgt (struct target_mem_desc *tgt) > > { > > /* Deallocate on target the tgt->tgt_start .. tgt->tgt_end > > region. */ if (tgt->tgt_end) > > gomp_free_device_memory (tgt->device_descr, tgt->to_free); > > > > free (tgt->array); > > free (tgt); > > } > > > > Is the "free (tgt)" in libgomp/target.c:gomp_unmap_vars_async wrong, > > or something else? > > It might be worth trying this with the refcounting changes in the > attach/detach patch. ...oh, also make sure you have this patch in the series you're testing with: https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01973.html else your "wait" will be ignored, IIUC. Julian