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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-03-01
     Ever confirmed|0                           |1

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
The expected behavior is that a Storage_Error be raised in response to the
stack overflow and that it be caught by the handler attached to the OBJ_DCL
block:

          END OBJ_DCL;

          EXCEPTION

               WHEN STORAGE_ERROR =>
                    COMMENT ("STORAGE_ERROR RAISED WHEN DECLARING " &
                             "TWO PACKED BOOLEAN ARRAYS WITH " &
                             "INTEGER'LAST + 3 COMPONENTS");
               WHEN CONSTRAINT_ERROR =>
                    COMMENT ("CONSTRAINT_ERROR RAISED WHEN DECLARING " &
                             "TWO PACKED BOOLEAN ARRAYS WITH " &
                             "INTEGER'LAST + 3 COMPONENTS");
               WHEN OTHERS =>
                    FAILED ("SOME EXCEPTION RAISED - 3");

If you remove the handler like in the reduced testcase, the Storage_Error
cannot be caught and will terminate the program as per the language semantics.

However, on s390 stack overflow detection is emulated (by _gnat_stack_check) at
the moment so this cannot really work.

The first thing to do is to change Stack_Check_Probes to True in
system-linux-s390.ads and system-linux-s390x.ads to enable real stack checking.
 You may have to enhance the back-end as a result, see the Standard Names
subsection of the Machine Descriptions section of the internal manual.

Reply via email to