This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, libgomp] Fix segfault with plugin-hsa
- From: Martin Jambor <mjambor at suse dot cz>
- To: Jakub Jelinek <jakub at redhat dot com>, Tobias Burnus <tobias at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Cc:
- Date: Wed, 11 Sep 2019 14:06:59 +0200
- Subject: Re: [patch, libgomp] Fix segfault with plugin-hsa
- References: <edd363c3-c51e-ef82-7bf3-7413443be7c4@codesourcery.com> <20190911094856.GH2120@tucnak>
Hi,
On Wed, Sep 11 2019, Jakub Jelinek wrote:
> On Wed, Sep 11, 2019 at 11:30:17AM +0200, Tobias Burnus wrote:
>> when playing around with offloading, I got an hsa initialization error
>> (/dev/... lacked write permission) and the library call returned with an
>> error status – but hsa_fns.hsa_status_string_fn didn't set the message to
>> the string variable.
>>
>> Hence, the string variable was uninitialized and libgomp crashed when
>> printing the error message; "[unknown]" is not the best HSA run-time
>> message, but at least the primary message is shown and there is no crash :-)
>
> LGTM, but give Martin (CCed) as the author a chance to chime in.
Looks good to me too. Thanks.
Martin
>
>> 2019-09-11 Tobias Burnus <tobias@codesourcery.com>
>>
>> * plugin/plugin-hsa.c (hsa_warn, hsa_fatal, hsa_error): Ensure
>> string is initialized.