public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/110314] New: Gnat failed assertion and Allocators with discriminant
@ 2023-06-19 19:50 franckbehaghel_gcc at protonmail dot com
  2023-06-20 16:43 ` [Bug ada/110314] " dkm at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: franckbehaghel_gcc at protonmail dot com @ 2023-06-19 19:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110314
           Summary: Gnat failed assertion and Allocators with discriminant
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: franckbehaghel_gcc at protonmail dot com
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

With checks enabled, Gnat failed to build this file.

$ cat main_assertion_failed.adb 
with Ada.Containers.Synchronized_Queue_Interfaces;
with Ada.Containers.Unbounded_Synchronized_Queues;

procedure main is 

package  Queue_Interfaces  is new Ada.Containers.Synchronized_Queue_Interfaces
(Integer);
package Synchronized_Queues is new Ada.Containers.Unbounded_Synchronized_Queues
( Queue_Interfaces => Queue_Interfaces);
subtype Queue is Synchronized_Queues.Queue; 
type Access_Type is access all  Queue;

Q1 : Access_Type := new Queue;
Q2 : Access_Type := new Queue;

begin  
   null;
end Main;



$ gnatmake main_assertion_failed.adb 
gcc -c main_assertion_failed.adb
+===========================GNAT BUG DETECTED==============================+
| 14.0.0 20230617 (experimental) (aarch64-unknown-linux-gnu) Assert_Failure
nlists.adb:172|
| Error detected at main_assertion_failed.adb:12:21                        |
| Compiling main_assertion_failed.adb                                      |
| Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact command that you entered.                              |
| Also include sources listed below.                                       |
+==========================================================================+




It fails also with Compiler Explorer (https://godbolt.org/) 
+===========================GNAT BUG DETECTED==============================+
| 14.0.0 20230619 (experimental) (x86_64-linux-gnu) Assert_Failure
nlists.adb:172|
| Error detected at example.adb:12:21                                      |
| Compiling <source>                                               |
| Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact command that you entered.                              |
| Also include sources listed below.                                       |
+==========================================================================+


regards,

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

* [Bug ada/110314] Gnat failed assertion and Allocators with discriminant
  2023-06-19 19:50 [Bug ada/110314] New: Gnat failed assertion and Allocators with discriminant franckbehaghel_gcc at protonmail dot com
@ 2023-06-20 16:43 ` dkm at gcc dot gnu.org
  2023-06-20 16:49 ` dkm at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dkm at gcc dot gnu.org @ 2023-06-20 16:43 UTC (permalink / raw)
  To: gcc-bugs

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

Marc Poulhiès <dkm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-06-20
     Ever confirmed|0                           |1

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

* [Bug ada/110314] Gnat failed assertion and Allocators with discriminant
  2023-06-19 19:50 [Bug ada/110314] New: Gnat failed assertion and Allocators with discriminant franckbehaghel_gcc at protonmail dot com
  2023-06-20 16:43 ` [Bug ada/110314] " dkm at gcc dot gnu.org
@ 2023-06-20 16:49 ` dkm at gcc dot gnu.org
  2023-06-20 20:28 ` franckbehaghel_gcc at protonmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dkm at gcc dot gnu.org @ 2023-06-20 16:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
This is new in 14, was OK when forking 13.

https://ada.godbolt.org/z/TvbPxYfnP

Currently bisecting.

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

* [Bug ada/110314] Gnat failed assertion and Allocators with discriminant
  2023-06-19 19:50 [Bug ada/110314] New: Gnat failed assertion and Allocators with discriminant franckbehaghel_gcc at protonmail dot com
  2023-06-20 16:43 ` [Bug ada/110314] " dkm at gcc dot gnu.org
  2023-06-20 16:49 ` dkm at gcc dot gnu.org
@ 2023-06-20 20:28 ` franckbehaghel_gcc at protonmail dot com
  2023-06-20 21:12 ` ebotcazou at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: franckbehaghel_gcc at protonmail dot com @ 2023-06-20 20:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Franck Behaghel <franckbehaghel_gcc at protonmail dot com> ---

>This is new in 14, was OK when forking 13.
>https://ada.godbolt.org/z/TvbPxYfnP
>Currently bisecting.

Marc,
Released version may have checks disabled :
If the file gcc/DEV-PHASE contains experimental, the configure script set
--enable-checking=yes
When releasing, gcc/DEV-PHASE is not experimental anymore.
Hence, gcc 13.1 may seem not affected in Compiler Explorer.


The stack trace :

gcc -wrapper gdb,--args -c main_assertion_failed.adb

(gdb) catch exception
Catchpoint 1: all Ada exceptions


Catchpoint 1, ADA.ASSERTIONS.ASSERTION_ERROR (nlists.adb:172) at
<__gnat_debug_raise_exception> (e=0x2b80988 <ada.assertions.assertion_error>,
message=...) at /opt/gcc/gcc/ada/libgnat/s-excdeb.adb:38
38      /opt/gcc/gcc/ada/libgnat/s-excdeb.adb: No such file or directory.
(gdb) bt
#0  <__gnat_debug_raise_exception> (e=0x2b80988
<ada.assertions.assertion_error>, message=...) at
/opt/gcc/gcc/ada/libgnat/s-excdeb.adb:38
#1  0x0000000000cd3a2c in ada.exceptions.complete_occurrence
(x=x@entry=0x33089e0) at /opt/gcc/gcc/ada/libgnat/a-except.adb:1013
#2  0x0000000000cd495c in ada.exceptions.complete_and_propagate_occurrence
(x=x@entry=0x33089e0) at /opt/gcc/gcc/ada/libgnat/a-except.adb:1024
#3  0x0000000000cd49a4 in <__gnat_raise_exception> (e=0x2b80988
<ada.assertions.assertion_error>, message=...) at
/opt/gcc/gcc/ada/libgnat/a-except.adb:1061
#4  0x0000000000cd700c in system.assertions.raise_assert_failure (msg=...) at
/opt/gcc/gcc/ada/libgnat/s-assert.adb:44
#5  0x0000000000a90840 in nlists.append (node=19969, to=to@entry=-99989077) at
/opt/gcc/gcc/ada/nlists.adb:172
#6  0x0000000000b7ee34 in sem_ch4.analyze_allocator (n=853) at
/opt/gcc/gcc/ada/sem_ch4.adb:615
#7  0x0000000000ae6d80 in sem.analyze (n=n@entry=853) at
/opt/gcc/gcc/ada/sem.adb:149
#8  0x0000000000b728e4 in sem_ch3.analyze_object_declaration (n=n@entry=852) at
/opt/gcc/gcc/ada/sem_ch3.adb:4445
#9  0x0000000000ae6d5c in sem.analyze (n=n@entry=852) at
/opt/gcc/gcc/ada/sem.adb:359
#10 0x0000000000b591d0 in sem_ch3.analyze_declarations (l=-99999982) at
/opt/gcc/gcc/ada/sem_ch3.adb:2707
#11 0x0000000000ba3c48 in sem_ch6.analyze_subprogram_body_helper (n=0) at
/opt/gcc/gcc/ada/sem_ch6.adb:4631
#12 sem_ch6.analyze_subprogram_body (n=n@entry=814) at
/opt/gcc/gcc/ada/sem_ch6.adb:2245
#13 0x0000000000ae6ed4 in sem.analyze (n=n@entry=814) at
/opt/gcc/gcc/ada/sem.adb:564
#14 0x0000000000b10628 in sem_ch10.analyze_compilation_unit (n=n@entry=798) at
/opt/gcc/gcc/ada/sem_ch10.adb:930
#15 0x0000000000ae6a28 in sem.analyze (n=n@entry=798) at
/opt/gcc/gcc/ada/sem.adb:185
#16 0x0000000000ae7f44 in sem.semantics.do_analyze () at
/opt/gcc/gcc/ada/sem.adb:1476
#17 sem.semantics (comp_unit=798) at /opt/gcc/gcc/ada/sem.adb:1672
#18 0x0000000000a6636c in frontend () at /opt/gcc/gcc/ada/frontend.adb:425
#19 0x0000000000ce2420 in gnat1drv () at /opt/gcc/gcc/ada/gnat1drv.adb:1236
#20 0x0000000000883c00 in gnat_parse_file () at
/opt/gcc/gcc/ada/gcc-interface/misc.cc:118
#21 0x000000000128ba10 in compile_file () at /opt/gcc/gcc/toplev.cc:444
#22 0x00000000008594c4 in do_compile (no_backend=false) at
/opt/gcc/gcc/toplev.cc:2126



It seems to failed because gnat add the same "discriminant node" into 2
differents "nlists" which do not supports its.

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

* [Bug ada/110314] Gnat failed assertion and Allocators with discriminant
  2023-06-19 19:50 [Bug ada/110314] New: Gnat failed assertion and Allocators with discriminant franckbehaghel_gcc at protonmail dot com
                   ` (2 preceding siblings ...)
  2023-06-20 20:28 ` franckbehaghel_gcc at protonmail dot com
@ 2023-06-20 21:12 ` ebotcazou at gcc dot gnu.org
  2023-06-25 13:37 ` franckbehaghel_gcc at protonmail dot com
  2023-06-25 13:39 ` franckbehaghel_gcc at protonmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-06-20 21:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu.org

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Yes, assertions are enabled in the front-end only in development builds.

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

* [Bug ada/110314] Gnat failed assertion and Allocators with discriminant
  2023-06-19 19:50 [Bug ada/110314] New: Gnat failed assertion and Allocators with discriminant franckbehaghel_gcc at protonmail dot com
                   ` (3 preceding siblings ...)
  2023-06-20 21:12 ` ebotcazou at gcc dot gnu.org
@ 2023-06-25 13:37 ` franckbehaghel_gcc at protonmail dot com
  2023-06-25 13:39 ` franckbehaghel_gcc at protonmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: franckbehaghel_gcc at protonmail dot com @ 2023-06-25 13:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Franck Behaghel <franckbehaghel_gcc at protonmail dot com> ---
Created attachment 55399
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55399&action=edit
patch

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

* [Bug ada/110314] Gnat failed assertion and Allocators with discriminant
  2023-06-19 19:50 [Bug ada/110314] New: Gnat failed assertion and Allocators with discriminant franckbehaghel_gcc at protonmail dot com
                   ` (4 preceding siblings ...)
  2023-06-25 13:37 ` franckbehaghel_gcc at protonmail dot com
@ 2023-06-25 13:39 ` franckbehaghel_gcc at protonmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: franckbehaghel_gcc at protonmail dot com @ 2023-06-25 13:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Franck Behaghel <franckbehaghel_gcc at protonmail dot com> ---
Marc,

Could you consider and review this patch ?

Regards,

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

end of thread, other threads:[~2023-06-25 13:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-19 19:50 [Bug ada/110314] New: Gnat failed assertion and Allocators with discriminant franckbehaghel_gcc at protonmail dot com
2023-06-20 16:43 ` [Bug ada/110314] " dkm at gcc dot gnu.org
2023-06-20 16:49 ` dkm at gcc dot gnu.org
2023-06-20 20:28 ` franckbehaghel_gcc at protonmail dot com
2023-06-20 21:12 ` ebotcazou at gcc dot gnu.org
2023-06-25 13:37 ` franckbehaghel_gcc at protonmail dot com
2023-06-25 13:39 ` franckbehaghel_gcc at protonmail dot com

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