public inbox for overseers@sourceware.org
 help / color / mirror / Atom feed
* Bug Reporting
@ 2015-04-14  0:19 Giorgian Borca-Tasciuc
  0 siblings, 0 replies; only message in thread
From: Giorgian Borca-Tasciuc @ 2015-04-14  0:19 UTC (permalink / raw)
  To: overseers

[-- Attachment #1: Type: text/plain, Size: 2990 bytes --]

Hello,
     I would like to make an account to be able to report a bug found
while using the gcc compiler collection.

Since I am unable to post the bug, I will place it here.
The problem is that when using gfortran to compile a simple program
(the source code for the program is attached) on the Raspberry Pi 2,
the compiler crashes, giving this error message:

bash-4.2$ gfortran-4.9 7.f95
f951: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.

Some version info from gfortran-4.9:

bash-4.2$ gfortran-4.9 --version
GNU Fortran (Raspbian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPY

Running the program uname -a to give some info:

bash-4.2$ uname -a
Linux raspberrypi 3.18.10-v7+ #774 SMP PREEMPT Wed Mar 25 14:10:30 GMT
2015 armv7l GNU/Linux

Running gfortran-4.9 in valgrind hints to an unsupported system call:
bash-4.2$ valgrind gfortran-4.9 7.f95
==5539== Memcheck, a memory error detector
==5539== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==5539== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==5539== Command: gfortran-4.9 7.f95
==5539==
--5539-- WARNING: unhandled syscall: 369
--5539-- You may be able to write your own handler.
--5539-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--5539-- Nevertheless we consider this a bug.  Please report
--5539-- it at http://valgrind.org/support/bug_reports.html.
--5539-- WARNING: unhandled syscall: 369
--5539-- You may be able to write your own handler.
--5539-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--5539-- Nevertheless we consider this a bug.  Please report
--5539-- it at http://valgrind.org/support/bug_reports.html.
f951: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
==5539==
==5539== HEAP SUMMARY:
==5539==     in use at exit: 41,873 bytes in 89 blocks
==5539==   total heap usage: 218 allocs, 129 frees, 52,452 bytes allocated
==5539==
==5539== LEAK SUMMARY:
==5539==    definitely lost: 5,337 bytes in 34 blocks
==5539==    indirectly lost: 16 bytes in 1 blocks
==5539==      possibly lost: 0 bytes in 0 blocks
==5539==    still reachable: 36,520 bytes in 54 blocks
==5539==         suppressed: 0 bytes in 0 blocks
==5539== Rerun with --leak-check=full to see details of leaked memory
==5539==
==5539== For counts of detected and suppressed errors, rerun with: -v
==5539== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Thank you for your time. I appriciate the GNU community's effort into
producing good compilers.

Giorgian

[-- Attachment #2: 7.f95 --]
[-- Type: application/octet-stream, Size: 3317 bytes --]


      module str
              type string
                      character(len=:), allocatable :: elems
                      integer :: length;
              contains
                      final :: delete
              end type string

              interface string
                      procedure :: constructstring
              end interface 

              interface assignment(=)
                      procedure :: chartostring
                      procedure :: stringtochar
              end interface

              interface operator(+)
                      procedure :: strconcat
              end interface

              interface len
                      procedure :: strlen
              end interface

      contains
              function constructstring(length) result(object) 
                      integer :: length
                      type(string) :: object

                      if (length > 80) then
                             object%length = 0
                             return
                      end if

                      allocate(character(len=length) :: &
                                        object%elems)
                      object%length = length
              end function constructstring

              subroutine chartostring(str, charvar)
                      type(string), intent(inout)  :: str
                      character(len=*), intent(in) :: charvar
                      integer :: i

                      integer :: charlen
                      charlen = len(charvar)
                      if (len(charvar) > str%length) then
                             deallocate(str%elems)
                             allocate(character(len=charlen) &
                                       :: str%elems)
                             str%length = charlen
                       end if

                      str%elems(1:) = charvar(1:)
              end subroutine chartostring

              subroutine stringtochar(charvar, str)
                       character(len=*), intent(inout) :: charvar
                       type(string), intent(in) :: str

                       charvar(1:) = str%elems(1:)
              end subroutine stringtochar

              subroutine delete(str)
                      type(string), intent(inout) :: str
                      deallocate(str%elems)
              end subroutine delete

              function strconcat(str1, str2) result(combined)
                      type(string), intent(in) :: str1, str2
                      type(string) :: combined

                      combined = string(str1%length + str2%length)
                      combined = str1%elems(1:) + str2%elems(1:)
              end function strconcat

              function strlen(str) result(length)
                      type(string), intent(in) :: str
                      integer :: length

                      length = str%length
              end function strlen
 
      end module str


      program main
              character(len=80) :: hello, world
              type(string) :: str1, str2

              hello = "Hello"
              world = "World"
              str1 = string(len(hello))
              str2 = string(len(world))
              str1 = str1 + str2
              print *, len(str1), str1%elems
      end program main

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-14  0:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-14  0:19 Bug Reporting Giorgian Borca-Tasciuc

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