public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/63494] New: internal compiler error: Bus error, and out of memory allocating ...
@ 2014-10-09  5:23 jwmwalrus at gmail dot com
  2014-10-15  8:57 ` [Bug fortran/63494] " dominiq at lps dot ens.fr
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jwmwalrus at gmail dot com @ 2014-10-09  5:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63494
           Summary: internal compiler error: Bus error, and out of memory
                    allocating ...
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jwmwalrus at gmail dot com

With the code below I get two errors while compiling. One with the
preprocessor, and one without.

module my_lrstring
    implicit none
    private
    save

    type :: lrStringType
        character(:), allocatable :: left
        character(:), allocatable :: right
    end type

    type, public :: lrString
        type(lrStringType), allocatable, private :: storage(:)
    contains
        procedure :: getRight
    end type

contains
    pure function getRight(this, left) result(right)
        character(:), allocatable :: right
        class(lrString), intent(IN) :: this
        character(*), intent(IN) :: left
        integer :: i, j
        character(:), allocatable :: text

        right = ''
        j = INDEX(this%storage(i)%right, '{}')
        text = this%storage(i)%right(j+2:)
    end function
end module my_lrstring



The output I get is:

$ gfortran-5.0 -c -g -x f95-cpp-input -Dmy_lrstring=my_lrstring_dbg
my_lrstring.f90
f951: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-snapshot/README.Bugs> for instructions.

$ gfortran -c -g my_lrstring.f90

f951: out of memory allocating 20501133024 bytes after a total of 692224 bytes



The compiler and system information is:

$ lsb_release -rd
Description:    Debian GNU/Linux testing (jessie)
Release:    testing

$ gfortran-5.0 -v
Using built-in specs.
COLLECT_GCC=gfortran-5.0
COLLECT_LTO_WRAPPER=/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/5.0.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 20140903-1'
--with-bugurl=file:///usr/share/doc/gcc-snapshot/README.Bugs
--enable-languages=c,ada,c++,java,go,fortran,objc,obj-c++
--prefix=/usr/lib/gcc-snapshot --enable-shared --enable-linker-build-id
--disable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify
--enable-plugin --with-system-zlib --disable-browser-plugin
--enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5.0-snap-amd64/jre
--enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5.0-snap-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5.0-snap-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --with-arch-32=i586 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--disable-werror --enable-checking=yes --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.0.0 20140904 (experimental) [trunk revision 214924] (Debian
20140903-1) 

$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 31147
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65536
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 31147
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited


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

* [Bug fortran/63494] internal compiler error: Bus error, and out of memory allocating ...
  2014-10-09  5:23 [Bug fortran/63494] New: internal compiler error: Bus error, and out of memory allocating jwmwalrus at gmail dot com
@ 2014-10-15  8:57 ` dominiq at lps dot ens.fr
  2015-01-03 10:03 ` [Bug fortran/63494] ICE with deferred-character-length component janus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-10-15  8:57 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-10-15
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
On x86_64-apple-darwin13 without preprocessor I get the following ICE

f951: internal compiler error: Segmentation fault: 11

The backtrace is

  * frame #0: 0x0000000141f93520 libgmp.10.dylib`__gmpz_init_set + 16
    frame #1: 0x0000000100031a02 f951`gfc_copy_shape(__mpz_struct (*) [1], int)
+ 82
    frame #2: 0x0000000100031ae2 f951`gfc_copy_expr(gfc_expr*) + 194
    frame #3: 0x000000010008fa9b f951`gfc_resolve_substring_charlen(gfc_expr*)
+ 171
    frame #4: 0x000000010008d316 f951`gfc_resolve_expr(gfc_expr*) + 1526
    frame #5: 0x000000010009457e f951`gfc_resolve_code(gfc_code*,
gfc_namespace*) + 782
    frame #6: 0x0000000100097300 f951`resolve_codes(gfc_namespace*) + 304
    frame #7: 0x0000000100097208 f951`resolve_codes(gfc_namespace*) + 56
    frame #8: 0x00000001000973ed f951`gfc_resolve(gfc_namespace*) (.part.48) +
61
    frame #9: 0x000000010008191b f951`gfc_parse_file() + 779
    frame #10: 0x00000001000c5266 f951`gfc_be_parse_file() + 38
    frame #11: 0x0000000100998cce f951`compile_file() + 46
    frame #12: 0x000000010099b3bf f951`toplev_main(int, char**) + 2991


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

* [Bug fortran/63494] ICE with deferred-character-length component
  2014-10-09  5:23 [Bug fortran/63494] New: internal compiler error: Bus error, and out of memory allocating jwmwalrus at gmail dot com
  2014-10-15  8:57 ` [Bug fortran/63494] " dominiq at lps dot ens.fr
@ 2015-01-03 10:03 ` janus at gcc dot gnu.org
  2015-01-04  3:14 ` bdavis at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: janus at gcc dot gnu.org @ 2015-01-03 10:03 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|WAITING                     |NEW
                 CC|                            |janus at gcc dot gnu.org
            Summary|internal compiler error:    |ICE with
                   |Bus error, and out of       |deferred-character-length
                   |memory allocating ...       |component

--- Comment #2 from janus at gcc dot gnu.org ---
I get an ICE on the following reduced and slightly modified test case:


  implicit none

  type :: lrStringType
    character(:), allocatable :: right
  end type

  type :: lrString
    type(lrStringType), allocatable :: storage(:)
  end type

contains

  pure subroutine getRight(this)
    type(lrString), intent(IN) :: this
    character(:), allocatable :: text

    text = this%storage(1)%right(2:)
  end subroutine

end


$ gfortran-5.0 c0.f90 
f951: internal compiler error: Speicherzugriffsfehler
0xa2e19f crash_signal
    /home/jweil/gcc/gcc50/trunk/gcc/toplev.c:359
0x5f06a4 gfc_copy_ref(gfc_ref*)
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/expr.c:651
0x5f0368 gfc_copy_expr(gfc_expr*)
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/expr.c:395
0x646987 gfc_resolve_substring_charlen(gfc_expr*)
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/resolve.c:4530
0x64420d gfc_resolve_expr(gfc_expr*)
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/resolve.c:6203
0x64adb4 gfc_resolve_code(gfc_code*, gfc_namespace*)
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/resolve.c:10003
0x64d6fa resolve_codes
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/resolve.c:14908
0x64d607 resolve_codes
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/resolve.c:14894
0x64d7e2 gfc_resolve
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/resolve.c:14936
0x638e2a resolve_all_program_units
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/parse.c:4886
0x638e2a gfc_parse_file()
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/parse.c:5129
0x677f35 gfc_be_parse_file
    /home/jweil/gcc/gcc50/trunk/gcc/fortran/f95-lang.c:222


When removing the PURE attribute, I get:

f951: out of memory allocating 30704883504 bytes after a total of 561152 bytes


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

* [Bug fortran/63494] ICE with deferred-character-length component
  2014-10-09  5:23 [Bug fortran/63494] New: internal compiler error: Bus error, and out of memory allocating jwmwalrus at gmail dot com
  2014-10-15  8:57 ` [Bug fortran/63494] " dominiq at lps dot ens.fr
  2015-01-03 10:03 ` [Bug fortran/63494] ICE with deferred-character-length component janus at gcc dot gnu.org
@ 2015-01-04  3:14 ` bdavis at gcc dot gnu.org
  2015-01-04 10:20 ` janus at gcc dot gnu.org
  2015-09-10 10:04 ` dominiq at lps dot ens.fr
  4 siblings, 0 replies; 6+ messages in thread
From: bdavis at gcc dot gnu.org @ 2015-01-04  3:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Bud Davis <bdavis at gcc dot gnu.org> ---
my comment sounded snarky; not intended. I did not know that you were also
reducing this test case !!!

This page was 'stale' in my browser when i added the comment.



--bud


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

* [Bug fortran/63494] ICE with deferred-character-length component
  2014-10-09  5:23 [Bug fortran/63494] New: internal compiler error: Bus error, and out of memory allocating jwmwalrus at gmail dot com
                   ` (2 preceding siblings ...)
  2015-01-04  3:14 ` bdavis at gcc dot gnu.org
@ 2015-01-04 10:20 ` janus at gcc dot gnu.org
  2015-09-10 10:04 ` dominiq at lps dot ens.fr
  4 siblings, 0 replies; 6+ messages in thread
From: janus at gcc dot gnu.org @ 2015-01-04 10:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from janus at gcc dot gnu.org ---
(In reply to Bud Davis from comment #4)
> my comment sounded snarky; not intended.

No worries!


> I did not know that you were also
> reducing this test case !!!

Your version is indeed more concise, but note that mine gives a somewhat
different error.


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

* [Bug fortran/63494] ICE with deferred-character-length component
  2014-10-09  5:23 [Bug fortran/63494] New: internal compiler error: Bus error, and out of memory allocating jwmwalrus at gmail dot com
                   ` (3 preceding siblings ...)
  2015-01-04 10:20 ` janus at gcc dot gnu.org
@ 2015-09-10 10:04 ` dominiq at lps dot ens.fr
  4 siblings, 0 replies; 6+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-09-10 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Fixed by the patch at https://gcc.gnu.org/ml/fortran/2015-07/msg00166.html.
Marked as duplicate of pr65766.

*** This bug has been marked as a duplicate of bug 65766 ***


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

end of thread, other threads:[~2015-09-10 10:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-09  5:23 [Bug fortran/63494] New: internal compiler error: Bus error, and out of memory allocating jwmwalrus at gmail dot com
2014-10-15  8:57 ` [Bug fortran/63494] " dominiq at lps dot ens.fr
2015-01-03 10:03 ` [Bug fortran/63494] ICE with deferred-character-length component janus at gcc dot gnu.org
2015-01-04  3:14 ` bdavis at gcc dot gnu.org
2015-01-04 10:20 ` janus at gcc dot gnu.org
2015-09-10 10:04 ` dominiq at lps dot ens.fr

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