From: "Martin Liška" <mliska@suse.cz>
To: Jakub Jelinek <jakub@redhat.com>, David Malcolm <dmalcolm@redhat.com>
Cc: Marek Polacek <polacek@redhat.com>,
GCC Patches <gcc-patches@gcc.gnu.org>,
jit@gcc.gnu.org
Subject: Re: Fix build of jit (was Re: [PATCH, RFC] Introduce -fsanitize=use-after-scope (v3))
Date: Fri, 01 Jan 2016 00:00:00 -0000 [thread overview]
Message-ID: <e986acd9-dfe1-871c-c74c-f3fba7a0f282@suse.cz> (raw)
In-Reply-To: <20161107161741.GN3541@tucnak.redhat.com>
On 11/07/2016 05:17 PM, Jakub Jelinek wrote:
> On Mon, Nov 07, 2016 at 11:07:13AM -0500, David Malcolm wrote:
>> The patch (r241896) introduced an error in the build of the jit:
>>
>> ../../src/gcc/jit/jit-builtins.c:62:1: error: invalid conversion from
>> âintâ to âgcc::jit::built_in_attributeâ [-fpermissive]
>> };
>> ^
>>
>> which seems to be due to the "0" for ATTRS in:
>>
>> --- a/gcc/sanitizer.def
>> +++ b/gcc/sanitizer.def
>> @@ -165,6 +165,10 @@ DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT,
>> DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_AFTER_DYNAMIC_INIT,
>> "__asan_after_dynamic_init",
>> BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
>> +DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_CLOBBER_N, "__asan_poison_stack_memory",
>> + BT_FN_VOID_PTR_PTRMODE, 0)
>> +DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_UNCLOBBER_N, "__asan_unpoison_stack_memory",
>> + BT_FN_VOID_PTR_PTRMODE, 0)
>
> I believe the 0 here is a bug, I'd think we should be using something like
> ATTR_TMPURE_NOTHROW_LEAF_LIST that we are using __asan_load* - the functions
> aren't going to throw, nor call anything in the current TU. Not 100% sure
> about the TMPURE, after all they do write/read memory (the shadow one).
> So maybe ATTR_NOTHROW_LEAF_LIST instead for now? Martin?
Yes, 0 is bug. I'm inclining to ATTR_NOTHROW_LEAF_LIST as __asan_{un}poison_stack_memory
modifies global memory. It would be more safe. I'm also going to change it for ASAN_MARK
internal function (where ECF_TM_PURE is currently selected).
I'm testing patch for that.
Martin
>
>> Is the attached patch OK as a fix? (assuming testing passes) Or should
>> these builtins have other attrs? (sorry, am not very familiar with the
>> sanitizer code).
>
> Jakub
>
next prev parent reply other threads:[~2016-11-08 9:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20161027172358.GN3541@tucnak.redhat.com>
[not found] ` <782727c2-9173-24ab-4e4c-07918dc16bf6@suse.cz>
[not found] ` <20161101145350.GS3541@tucnak.redhat.com>
[not found] ` <3f0181a4-e1b2-406f-7cf1-e63e9e9824fe@suse.cz>
[not found] ` <20161102095926.GM3541@tucnak.redhat.com>
[not found] ` <20161102101053.GN3541@tucnak.redhat.com>
[not found] ` <20161102142028.GQ5939@redhat.com>
[not found] ` <8ac49efe-83af-933b-2aa5-f4b22972fa6a@suse.cz>
[not found] ` <20161102143511.GV3541@tucnak.redhat.com>
[not found] ` <e04b1ac8-e3ff-b13f-4006-bf961af6d2ea@suse.cz>
[not found] ` <20161104093254.GS3541@tucnak.redhat.com>
[not found] ` <0e0fd0f9-1c7d-ac9e-8dfc-9349611b5efe@suse.cz>
[not found] ` <59fde5a4-3633-5fc8-daa0-ed485d75a5db@suse.cz>
2016-01-01 0:00 ` David Malcolm
2016-01-01 0:00 ` Jakub Jelinek
2016-01-01 0:00 ` Martin Liška [this message]
2016-01-01 0:00 ` Jakub Jelinek
2016-01-01 0:00 ` [PATCH] use-after-scope fallout Martin Liška
2016-01-01 0:00 ` David Malcolm
2016-01-01 0:00 ` Jakub Jelinek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e986acd9-dfe1-871c-c74c-f3fba7a0f282@suse.cz \
--to=mliska@suse.cz \
--cc=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=jit@gcc.gnu.org \
--cc=polacek@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).