public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/59029] New: ICE with builtin function and -fsanitize=address
@ 2013-11-06 20:04 reichelt at gcc dot gnu.org
  2013-11-06 20:13 ` [Bug sanitizer/59029] " reichelt at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-11-06 20:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59029
           Summary: ICE with builtin function and -fsanitize=address
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org

The following code snippet compiled with "-fsanitize=address -O" triggers an
ICE
since GCC 4.8.0 (when the address-sanitizer was introduced):

========================================
inline int foo(int* p)
{
  return __sync_fetch_and_add(p, 1);
}

void bar()
{
  foo(0);
}
========================================

bug.c: In function 'bar':
bug.c:6:6: internal compiler error: in get_mem_refs_of_builtin_call, at
asan.c:722
 inline int foo(int* p)
      ^
0x987d46 get_mem_refs_of_builtin_call
        ../../gcc/gcc/asan.c:722
0x98adb5 has_stmt_been_instrumented_p
        ../../gcc/gcc/asan.c:801
0x98adb5 transform_statements
        ../../gcc/gcc/asan.c:1919
0x98be62 asan_instrument
        ../../gcc/gcc/asan.c:2271
0x98be62 execute
        ../../gcc/gcc/asan.c:2311
Please submit a full bug report, [etc.]

In addition, the error location of the ICE is broken: the caret points to the
first line of the file whereas the reported line number is 6.


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

* [Bug sanitizer/59029] ICE with builtin function and -fsanitize=address
  2013-11-06 20:04 [Bug sanitizer/59029] New: ICE with builtin function and -fsanitize=address reichelt at gcc dot gnu.org
@ 2013-11-06 20:13 ` reichelt at gcc dot gnu.org
  2013-11-07  6:07 ` y.gribov at samsung dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-11-06 20:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
The broken caret diagnostic seems to be a general problem of today's build.
I'll open a separate bug report for this.


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

* [Bug sanitizer/59029] ICE with builtin function and -fsanitize=address
  2013-11-06 20:04 [Bug sanitizer/59029] New: ICE with builtin function and -fsanitize=address reichelt at gcc dot gnu.org
  2013-11-06 20:13 ` [Bug sanitizer/59029] " reichelt at gcc dot gnu.org
@ 2013-11-07  6:07 ` y.gribov at samsung dot com
  2013-11-07 10:06 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: y.gribov at samsung dot com @ 2013-11-07  6:07 UTC (permalink / raw)
  To: gcc-bugs

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

Yury Gribov <y.gribov at samsung dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |y.gribov at samsung dot com

--- Comment #2 from Yury Gribov <y.gribov at samsung dot com> ---
Created attachment 31177
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31177&action=edit
Draft patch

Aha, looks like the ICE is caused by destination address being INTEGER_CST
instead of ADDR_EXPR. Attached patch seems to fix this (tested on x86_64).

@Volker: could you add your testcase to Asan testsuite?

-Y


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

* [Bug sanitizer/59029] ICE with builtin function and -fsanitize=address
  2013-11-06 20:04 [Bug sanitizer/59029] New: ICE with builtin function and -fsanitize=address reichelt at gcc dot gnu.org
  2013-11-06 20:13 ` [Bug sanitizer/59029] " reichelt at gcc dot gnu.org
  2013-11-07  6:07 ` y.gribov at samsung dot com
@ 2013-11-07 10:06 ` mpolacek at gcc dot gnu.org
  2013-11-07 10:11 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-11-07 10:06 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-07
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |4.8.4
     Ever confirmed|0                           |1


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

* [Bug sanitizer/59029] ICE with builtin function and -fsanitize=address
  2013-11-06 20:04 [Bug sanitizer/59029] New: ICE with builtin function and -fsanitize=address reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-11-07 10:06 ` mpolacek at gcc dot gnu.org
@ 2013-11-07 10:11 ` jakub at gcc dot gnu.org
  2013-11-07 12:08 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-07 10:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Yury Gribov from comment #2)
> Created attachment 31177 [details]
> Draft patch
> 
> Aha, looks like the ICE is caused by destination address being INTEGER_CST
> instead of ADDR_EXPR. Attached patch seems to fix this (tested on x86_64).
> 
> @Volker: could you add your testcase to Asan testsuite?

Patch preapproved with the testcase and correct ChangeLog, just add
/* { dg-do compile } */

int
foo ()
{
  return __sync_fetch_and_add ((int *) 0, 1);
}

to testsuite/c-c++-common/asan/pr59029.c ?


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

* [Bug sanitizer/59029] ICE with builtin function and -fsanitize=address
  2013-11-06 20:04 [Bug sanitizer/59029] New: ICE with builtin function and -fsanitize=address reichelt at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-11-07 10:11 ` jakub at gcc dot gnu.org
@ 2013-11-07 12:08 ` jakub at gcc dot gnu.org
  2013-11-07 12:34 ` y.gribov at samsung dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-07 12:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to ygribov from comment #4)
> URL: http://gcc.gnu.org/viewcvs?rev=204508&root=gcc&view=rev
> Log:
> Allow integer literals as addresses in instrumented builtins.

Note, patches should still go to gcc-patches, even when you just say in subject
[committed] and in the description that it has been preapproved in the PR.
> gcc/
> 	PR sanitizer/59029
> 	* gcc/asan.c (get_mem_refs_of_builtin_call): Allow
> 	integer literals as addresses in instrumented builtins.

The gcc/ prefix shouldn't be there.
>From gcc-bugs-return-433830-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Nov 07 12:12:06 2013
Return-Path: <gcc-bugs-return-433830-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11690 invoked by alias); 7 Nov 2013 12:12:05 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 11660 invoked by uid 48); 7 Nov 2013 12:12:01 -0000
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59033] cannot control inherited constructors access
Date: Thu, 07 Nov 2013 12:12:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: paolo.carlini at oracle dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-59033-4-YSuOFJAejV@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59033-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59033-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-11/txt/msg00607.txt.bz2
Content-length: 444

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY033

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Closing then.


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

* [Bug sanitizer/59029] ICE with builtin function and -fsanitize=address
  2013-11-06 20:04 [Bug sanitizer/59029] New: ICE with builtin function and -fsanitize=address reichelt at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2013-11-07 12:08 ` jakub at gcc dot gnu.org
@ 2013-11-07 12:34 ` y.gribov at samsung dot com
  2014-01-22 14:14 ` y.gribov at samsung dot com
  2014-01-22 19:23 ` reichelt at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: y.gribov at samsung dot com @ 2013-11-07 12:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Yury Gribov <y.gribov at samsung dot com> ---
(In reply to Jakub Jelinek from comment #5)
> Note, patches should still go to gcc-patches, even when you just say in
> subject
> [committed] and in the description that it has been preapproved in the PR.

Got it. Done.

> The gcc/ prefix shouldn't be there.

Right, my bad...

-Y


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

* [Bug sanitizer/59029] ICE with builtin function and -fsanitize=address
  2013-11-06 20:04 [Bug sanitizer/59029] New: ICE with builtin function and -fsanitize=address reichelt at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2013-11-07 12:34 ` y.gribov at samsung dot com
@ 2014-01-22 14:14 ` y.gribov at samsung dot com
  2014-01-22 19:23 ` reichelt at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: y.gribov at samsung dot com @ 2014-01-22 14:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Yury Gribov <y.gribov at samsung dot com> ---
Volker, could you close this bug if gcc trunk works for you?


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

* [Bug sanitizer/59029] ICE with builtin function and -fsanitize=address
  2013-11-06 20:04 [Bug sanitizer/59029] New: ICE with builtin function and -fsanitize=address reichelt at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2014-01-22 14:14 ` y.gribov at samsung dot com
@ 2014-01-22 19:23 ` reichelt at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-01-22 19:23 UTC (permalink / raw)
  To: gcc-bugs

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

Volker Reichelt <reichelt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
Fixed on trunk by Yury's patch.


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

end of thread, other threads:[~2014-01-22 19:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-06 20:04 [Bug sanitizer/59029] New: ICE with builtin function and -fsanitize=address reichelt at gcc dot gnu.org
2013-11-06 20:13 ` [Bug sanitizer/59029] " reichelt at gcc dot gnu.org
2013-11-07  6:07 ` y.gribov at samsung dot com
2013-11-07 10:06 ` mpolacek at gcc dot gnu.org
2013-11-07 10:11 ` jakub at gcc dot gnu.org
2013-11-07 12:08 ` jakub at gcc dot gnu.org
2013-11-07 12:34 ` y.gribov at samsung dot com
2014-01-22 14:14 ` y.gribov at samsung dot com
2014-01-22 19:23 ` reichelt 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).