help-rcs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ada/14543] New: Storage_Error on null slice, might be a regression.


From: bjorn_persson at sverige dot nu
Subject: [Bug ada/14543] New: Storage_Error on null slice, might be a regression.
Date: 12 Mar 2004 02:44:20 -0000

This program, when compiled with Gnat 3.3.2 and run on Fedora Core 1, raises
Storage_Error on line 7 (because of a segmentation fault):

procedure Null_Slice_Error is             --  1
                                          --  2
   procedure Proc (NullS : String) is     --  3
      type SA is access String;           --  4
      Point : SA := new String (1 .. 0);  --  5
   begin                                  --  6
      Point.all := NullS;                 --  7
   end Proc;                              --  8
                                          --  9
   S : String := "s";                     -- 10
begin                                     -- 11
   Proc(S(3 .. 1));                       -- 12
end Null_Slice_Error;                     -- 13

If I change 3 to 2 on line 12 there is no error.

$ gnatmake null_slice_error
gcc -c null_slice_error.adb
gnatbind -x null_slice_error.ali
gnatlink null_slice_error.ali
$ ./null_slice_error

raised STORAGE_ERROR : stack overflow (or erroneous memory access)
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit 
--host=i386-redhat-linux
Thread model: posix
gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1)

I have been told that the same bug occurs in Gnat 3.3.3 on Debian, but not in
GCC 3.1 (1252) on Mac OS X and not in Gnat 3.15p on an unspecified OS. I tried
to check with the 3.4-20040310 snapshot, but I had to give up on that. Sorry.

-- 
           Summary: Storage_Error on null slice, might be a regression.
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bjorn_persson at sverige dot nu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux


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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]