From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99895 invoked by alias); 6 Dec 2018 22:22:56 -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 99884 invoked by uid 89); 6 Dec 2018 22:22:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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:22:54 +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 1gV22l-0004Fz-TS from Julian_Brown@mentor.com ; Thu, 06 Dec 2018 14:22:51 -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:22:47 +0000 Date: Thu, 06 Dec 2018 22:22: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: <20181206222246.1cceb504@squid.athome> In-Reply-To: References: <432c2e58-7bf6-1f7e-457f-32813207b282@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00410.txt.bz2 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. Julian