public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/65696] New: ASAN reports global-buffer-overrun for local tagged types
@ 2015-04-08 11:16 demoonlit at panathenaia dot halfmoon.jp
  2020-05-08 15:01 ` [Bug ada/65696] " demoonlit at panathenaia dot halfmoon.jp
  2020-05-08 15:29 ` ebotcazou at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: demoonlit at panathenaia dot halfmoon.jp @ 2015-04-08 11:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65696
           Summary: ASAN reports global-buffer-overrun for local tagged
                    types
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: demoonlit at panathenaia dot halfmoon.jp

package pkg_a is
   type Root is tagged null record;
end pkg_a;

with pkg_a;
procedure main is
   type Derived is new pkg_a.Root with null record;
begin
   null;
end main;

% gnatmake main.adb -cargs -fsanitize=address -largs -lasan.1
gcc -c -fsanitize=address main.adb
gcc -c -fsanitize=address pkg_a.ads
gnatbind -x main.ali
gnatlink main.ali -lasan.1

% ./main 
=================================================================
==78928==ERROR: AddressSanitizer: unknown-crash on address 0x0001000174c8 at pc
0x10000303d bp 0x7fff5fbfed10 sp 0x7fff5fbfed08
READ of size 120 at 0x0001000174c8 thread T0
    #0 0x10000303c (main+0x10000303c)
    #1 0x1000023d4 (main+0x1000023d4)
    #2 0x1000019d7 (main+0x1000019d7)
    #3 0x0 (main+0x0)

0x000100017510 is located 0 bytes to the right of global variable
'pkg_a__rootR38s___UNC' from 'pkg_a.ads' (0x1000174c0) of size 80
SUMMARY: AddressSanitizer: unknown-crash ??:0 ??
Shadow bytes around the buggy address:
  0x100020002e40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100020002e50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100020002e60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100020002e70: 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9
  0x100020002e80: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
=>0x100020002e90: 00 00 f9 f9 f9 f9 f9 f9 00[00]00 00 00 00 00 00
  0x100020002ea0: 00 00 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x100020002eb0: 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x100020002ec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100020002ed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100020002ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==78928==ABORTING

Perhaps, a cause is the implicit code for making a child type's dispatching
table.
The size of copying of a parent type's predefined primitives to a child's is
Max_Predef_Prims (15), but the real number of a parent type's predefined
primitives seems 9.


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

* [Bug ada/65696] ASAN reports global-buffer-overrun for local tagged types
  2015-04-08 11:16 [Bug ada/65696] New: ASAN reports global-buffer-overrun for local tagged types demoonlit at panathenaia dot halfmoon.jp
@ 2020-05-08 15:01 ` demoonlit at panathenaia dot halfmoon.jp
  2020-05-08 15:29 ` ebotcazou at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: demoonlit at panathenaia dot halfmoon.jp @ 2020-05-08 15:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from yuta tomino <demoonlit at panathenaia dot halfmoon.jp> ---
I'm trying the released gcc-10.1, and confirmed that this is fixed.
Thank you.

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

* [Bug ada/65696] ASAN reports global-buffer-overrun for local tagged types
  2015-04-08 11:16 [Bug ada/65696] New: ASAN reports global-buffer-overrun for local tagged types demoonlit at panathenaia dot halfmoon.jp
  2020-05-08 15:01 ` [Bug ada/65696] " demoonlit at panathenaia dot halfmoon.jp
@ 2020-05-08 15:29 ` ebotcazou at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2020-05-08 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |10.0
             Status|NEW                         |RESOLVED

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
You're welcome.

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

end of thread, other threads:[~2020-05-08 15:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-08 11:16 [Bug ada/65696] New: ASAN reports global-buffer-overrun for local tagged types demoonlit at panathenaia dot halfmoon.jp
2020-05-08 15:01 ` [Bug ada/65696] " demoonlit at panathenaia dot halfmoon.jp
2020-05-08 15:29 ` ebotcazou 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).