public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/99179] New: asan failures with -Os on x86_64-apple-darwin20
@ 2021-02-20 13:27 dominiq at lps dot ens.fr
  2021-02-20 20:25 ` [Bug sanitizer/99179] " iains at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-02-20 13:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99179

            Bug ID: 99179
           Summary: asan failures with -Os on x86_64-apple-darwin20
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dominiq at lps dot ens.fr
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    iains at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org,
                    marxin at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-apple-darwin20
            Target: x86_64-apple-darwin20
             Build: x86_64-apple-darwin20

The following asan tests fail with -Os on x86_64-apple-darwin20

FAIL: c-c++-common/asan/alloca_big_alignment.c   -Os  output pattern test
FAIL: c-c++-common/asan/alloca_detect_custom_size.c   -Os  output pattern test
FAIL: c-c++-common/asan/alloca_overflow_partial.c   -Os  output pattern test
FAIL: c-c++-common/asan/alloca_overflow_right.c   -Os  output pattern test
FAIL: c-c++-common/asan/alloca_underflow_left.c   -Os  output pattern test

With -Os the output is

WRITE of size 1 at 0x7ffee72a5f8a thread T0
    #0 0x108959dfc in foo(int, int) alloca_big_alignment.c:10
    #1 0x108959e3b in main alloca_big_alignment.c:15

while it is

WRITE of size 1 at 0x7ffeedd4ef8a thread T0
    #0 0x101eb0def in foo(int, int) alloca_big_alignment.c:11
    #1 0x101eb0e04 in main alloca_big_alignment.c:15

with the other options: alloca_big_alignment.c:10 versus
alloca_big_alignment.c:11

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

* [Bug sanitizer/99179] asan failures with -Os on x86_64-apple-darwin20
  2021-02-20 13:27 [Bug sanitizer/99179] New: asan failures with -Os on x86_64-apple-darwin20 dominiq at lps dot ens.fr
@ 2021-02-20 20:25 ` iains at gcc dot gnu.org
  2021-03-17 19:24 ` iains at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2021-02-20 20:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99179

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-02-20
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---

So - it's some mismatch in the debug output / consumption I guess.

If I re-run the tests using the llvm-symbolizer from LLVM-11 (so at the same
revision as the imported libsanitizer), then the -Os cases pass.

NOTE: GCC emits the ELF ABI for Darwin (the Mach-O ABI was not implemented by
when the sanitizer was added, and it's Yet Another thing on the TODO to fix
that).

so it could be that the system tool (atos) is expecting Mach-o ABI but the
llvm-symbolizer is more tolerant.

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

* [Bug sanitizer/99179] asan failures with -Os on x86_64-apple-darwin20
  2021-02-20 13:27 [Bug sanitizer/99179] New: asan failures with -Os on x86_64-apple-darwin20 dominiq at lps dot ens.fr
  2021-02-20 20:25 ` [Bug sanitizer/99179] " iains at gcc dot gnu.org
@ 2021-03-17 19:24 ` iains at gcc dot gnu.org
  2021-03-18  9:51 ` [Bug sanitizer/99179] asan failures with -Os on x86_64-apple-darwin iains at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2021-03-17 19:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99179

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
I did some more checking on this.

1) It seems that something we produce in the unwind info for alloca is not
compatible with atos.

2) The objects all pass "dwarfdump --verify"

3) If I run the objects under lldb, breakpoints set by line number seem to work
properly.

4) If I use a recent llvm-symbolizer (ASAN_SYMBOLIZER_PATH=) the tests work.

5) the tests also work with clang / libsanitizer.

so, perhaps we have some subtle problem with the unwind information we produce
with -Os (and when there's an alloca or stack adjustment) - but I don't see
this as something I can address for GCC11 (even if it's fixable).

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

* [Bug sanitizer/99179] asan failures with -Os on x86_64-apple-darwin
  2021-02-20 13:27 [Bug sanitizer/99179] New: asan failures with -Os on x86_64-apple-darwin20 dominiq at lps dot ens.fr
  2021-02-20 20:25 ` [Bug sanitizer/99179] " iains at gcc dot gnu.org
  2021-03-17 19:24 ` iains at gcc dot gnu.org
@ 2021-03-18  9:51 ` iains at gcc dot gnu.org
  2022-05-06  8:30 ` jakub at gcc dot gnu.org
  2023-05-08 12:21 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2021-03-18  9:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99179

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|x86_64-apple-darwin20       |x86_64-apple-darwin
              Build|x86_64-apple-darwin20       |x86_64-apple-darwin
            Summary|asan failures with -Os on   |asan failures with -Os on
                   |x86_64-apple-darwin20       |x86_64-apple-darwin
   Target Milestone|---                         |12.0
               Host|x86_64-apple-darwin20       |x86_64-apple-darwin

--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> ---
for the record this occurs for all Darwin variants that currently support
libsanitizer.

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

* [Bug sanitizer/99179] asan failures with -Os on x86_64-apple-darwin
  2021-02-20 13:27 [Bug sanitizer/99179] New: asan failures with -Os on x86_64-apple-darwin20 dominiq at lps dot ens.fr
                   ` (2 preceding siblings ...)
  2021-03-18  9:51 ` [Bug sanitizer/99179] asan failures with -Os on x86_64-apple-darwin iains at gcc dot gnu.org
@ 2022-05-06  8:30 ` jakub at gcc dot gnu.org
  2023-05-08 12:21 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-06  8:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99179

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.0                        |12.2

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 12.1 is being released, retargeting bugs to GCC 12.2.

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

* [Bug sanitizer/99179] asan failures with -Os on x86_64-apple-darwin
  2021-02-20 13:27 [Bug sanitizer/99179] New: asan failures with -Os on x86_64-apple-darwin20 dominiq at lps dot ens.fr
                   ` (3 preceding siblings ...)
  2022-05-06  8:30 ` jakub at gcc dot gnu.org
@ 2023-05-08 12:21 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-05-08 12:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99179

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.3                        |12.4

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 12.3 is being released, retargeting bugs to GCC 12.4.

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

end of thread, other threads:[~2023-05-08 12:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-20 13:27 [Bug sanitizer/99179] New: asan failures with -Os on x86_64-apple-darwin20 dominiq at lps dot ens.fr
2021-02-20 20:25 ` [Bug sanitizer/99179] " iains at gcc dot gnu.org
2021-03-17 19:24 ` iains at gcc dot gnu.org
2021-03-18  9:51 ` [Bug sanitizer/99179] asan failures with -Os on x86_64-apple-darwin iains at gcc dot gnu.org
2022-05-06  8:30 ` jakub at gcc dot gnu.org
2023-05-08 12:21 ` rguenth 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).