public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/55435] New: [asan] implement an attribute to disable asan instrumentation for a particular function
@ 2012-11-22  3:28 konstantin.s.serebryany at gmail dot com
  2012-11-23  9:03 ` [Bug sanitizer/55435] " jakub at gcc dot gnu.org
  2012-11-23 16:51 ` jakub at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: konstantin.s.serebryany at gmail dot com @ 2012-11-22  3:28 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55435

             Bug #: 55435
           Summary: [asan] implement an attribute to disable asan
                    instrumentation for a particular function
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: konstantin.s.serebryany@gmail.com
                CC: dnovillo@google.com, dseketel@redhat.com,
                    dvyukov@google.com, hjl.tools@gmail.com,
                    jakub@redhat.com, wmi@gcc.gnu.org


The clang implementation of asan has
__attribute__((no_address_safety_analysis)): 

(http://clang.llvm.org/docs/AddressSanitizer.html#no_address_safety_analysis)
====
Some code should not be instrumented by AddressSanitizer. One may use the
function attribute no_address_safety_analysis to disable instrumentation of a
particular function. This attribute may not be supported by other compilers, so
we suggest to use it together with __has_feature(address_sanitizer). Note:
currently, this attribute will be lost if the function is inlined.
====

The gcc implementation needs a similar attribute (preferably, with the same
syntax and semantics)

One example where this attribute is used: V8 stack profiler which touches
random bytes on the stack.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug sanitizer/55435] [asan] implement an attribute to disable asan instrumentation for a particular function
  2012-11-22  3:28 [Bug other/55435] New: [asan] implement an attribute to disable asan instrumentation for a particular function konstantin.s.serebryany at gmail dot com
@ 2012-11-23  9:03 ` jakub at gcc dot gnu.org
  2012-11-23 16:51 ` jakub at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-23  9:03 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55435

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-23 09:02:34 UTC ---
Author: jakub
Date: Fri Nov 23 09:02:28 2012
New Revision: 193748

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193748
Log:
    PR sanitizer/55435
    * c-common.c (handle_no_address_safety_analysis_attribute): New
    function.
    (c_common_attribute_table): Add no_address_safety_analysis.

    * asan.c (gate_asan): Don't instrument functions with
    no_address_safety_analysis attribute.
    (gate_asan_O0): Use !optimize && gate_asan ().
    * doc/extend.texi (no_address_safety_analysis): Document new
    function attribute.

    * c-c++-common/asan/attrib-1.c: New test.

Added:
    trunk/gcc/testsuite/c-c++-common/asan/attrib-1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/asan.c
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/doc/extend.texi
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug sanitizer/55435] [asan] implement an attribute to disable asan instrumentation for a particular function
  2012-11-22  3:28 [Bug other/55435] New: [asan] implement an attribute to disable asan instrumentation for a particular function konstantin.s.serebryany at gmail dot com
  2012-11-23  9:03 ` [Bug sanitizer/55435] " jakub at gcc dot gnu.org
@ 2012-11-23 16:51 ` jakub at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-23 16:51 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55435

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.8.0

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-23 16:50:55 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-23 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-22  3:28 [Bug other/55435] New: [asan] implement an attribute to disable asan instrumentation for a particular function konstantin.s.serebryany at gmail dot com
2012-11-23  9:03 ` [Bug sanitizer/55435] " jakub at gcc dot gnu.org
2012-11-23 16:51 ` jakub at gcc dot gnu.org

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).