From patchwork Sat Sep 14 10:49:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 1162325 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-509003-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="gqcyE9f6"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Vq5q2BgZz9s7T for ; Sat, 14 Sep 2019 20:50:04 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=btmGsRqW9Egl+HhfeCKlzJTvk7grYWqychy028iQ/x/uiyC8S3 6IOU3L65JGypid32PdFz5HFFZlxGql/8NJkCC7tJx+5/3ITu6HrhqWqQPpUpBYz1 0svMonFZzcgHB2HVwA7+yy/WDXGpUmOUtYV52/Ds4gdpdVjNOLOmf7SV4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=qYaHwPlRI3Y5AL1DOtLz2ymMnm8=; b=gqcyE9f6mtjyAfc2ESVN a3v2shcSpL5EQlibVEe8qrDyKxIz0t9LAfjLf3sIvdNpmIEI97xDUypQaiv//vzi RTjBgNrxEaToIx2kQ/YvZwwIG7JK1vACz8+feYbVTJBHjTmvHtGOYUOBvkIRxTVe Prp16TxbSlcS+oVqF+McpU4= Received: (qmail 25367 invoked by alias); 14 Sep 2019 10:49:56 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 25352 invoked by uid 89); 14 Sep 2019 10:49:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=burnus, sk:tobias, Tobias, Burnus X-HELO: esa1.mentor.iphmx.com Received: from esa1.mentor.iphmx.com (HELO esa1.mentor.iphmx.com) (68.232.129.153) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 14 Sep 2019 10:49:53 +0000 IronPort-SDR: MEtg2HURvFurkfYOO77O48U9D5psbA7bHudlVVw5v131GMLkvsZ3v8zjgkuMJg9buuYMje/iKP 7FvuB1kfdiMMjVXa0zlHUH6zkeZPoYqwm285pQxZzQxzTu56yPV6Kka+tG2RyYkNiwbZ1Hqy2+ SE1hz5mQ0wDn9zGGFXtzwoRyl2ahPrVxMQjEIqfP/VNUHrRCbpp4jw46WWIA3mkj/Dlr5mRfya 0mtGMISz//U+2mSRQHlrkpRZ6Xk1Pe/npCP/qhBWKVQhBigIgGNs2lsSJk6J7sXPSoZxaOZBO7 hK4= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 14 Sep 2019 02:49:49 -0800 IronPort-SDR: znSdkqtcStj9vqMfUDKlkdq0mL99RcQq+DDsaZ3fNDF+7+IzKa9pXI+Vy3i1YnQd0ZmYG2ZjqI LMm/igIV/asqiMaTk3yzHChOcGjLZDgSEHGQ3JOFz/mdCxPjsMLpU3Bi3o3bN+4WvnuXdA2OA9 ihq3w45ZylHao6Rau47V+iDFdOFc1u4rb6DgowQHQKL1NBLcy99nIwszTJR5ucdmt4VbT1VyAF fOEVDYnbm8woki82ZpDpiOD0GkPpj1SbLhOyom+nmeW3+nrpQ6OBDicDjAVHi1CPQfX0W7HV7m wMs= To: From: Tobias Burnus Subject: [patch, committed][og9][openacc-gcc-9-branch] Fix segfault with plugin-gcn under libgomp Message-ID: Date: Sat, 14 Sep 2019 12:49:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi all, exactly the same as for plugin-hsa on the trunk: https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00718.html Only a different file (which is only in this branch). Tobias commit 392044a8db285d9aea0a280983ce7c5014a4e99c Author: Tobias Burnus Date: Thu Sep 12 18:07:53 2019 +0200 libgomp plugin-gcn - init string libgomp/ 2019-09-13 Tobias Burnus * plugin/plugin-gcn.c (hsa_warn, hsa_fatal, hsa_error): Ensure string is initialized. diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc index 355e406d4e3..14ed4e0ec2c 100644 --- a/libgomp/ChangeLog.openacc +++ b/libgomp/ChangeLog.openacc @@ -1,3 +1,8 @@ +2019-09-13 Tobias Burnus + + * plugin/plugin-gcn.c (hsa_warn, hsa_fatal, hsa_error): Ensure + string is initialized. + 2019-09-10 Julian Brown * plugin/plugin-gcn.c (GOMP_hsa_kernel_dispatch): Remove diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c index f7e3554f297..b8ec96391f7 100644 --- a/libgomp/plugin/plugin-gcn.c +++ b/libgomp/plugin/plugin-gcn.c @@ -489,7 +489,7 @@ hsa_warn (const char *str, hsa_status_t status) if (!debug) return; - const char *hsa_error_msg; + const char *hsa_error_msg = "[unknown]"; hsa_fns.hsa_status_string_fn (status, &hsa_error_msg); fprintf (stderr, "GCN warning: %s\nRuntime message: %s\n", str, @@ -502,7 +502,7 @@ hsa_warn (const char *str, hsa_status_t status) static void hsa_fatal (const char *str, hsa_status_t status) { - const char *hsa_error_msg; + const char *hsa_error_msg = "[unknown]"; hsa_fns.hsa_status_string_fn (status, &hsa_error_msg); GOMP_PLUGIN_fatal ("GCN fatal error: %s\nRuntime message: %s\n", str, hsa_error_msg); @@ -514,7 +514,7 @@ hsa_fatal (const char *str, hsa_status_t status) static bool hsa_error (const char *str, hsa_status_t status) { - const char *hsa_error_msg; + const char *hsa_error_msg = "[unknown]"; hsa_fns.hsa_status_string_fn (status, &hsa_error_msg); GOMP_PLUGIN_error ("GCN fatal error: %s\nRuntime message: %s\n", str, hsa_error_msg);