public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/40839]  New: gfortran segmentation fault when a unit number is missing
@ 2009-07-23 15:33 Philippe dot Poilbarbe at cls dot fr
  2009-07-23 16:29 ` [Bug fortran/40839] " jakub at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Philippe dot Poilbarbe at cls dot fr @ 2009-07-23 15:33 UTC (permalink / raw)
  To: gcc-bugs

Compiling this code with gfortran (4.3.2 and 4.3.3, Linux and Solaris) produces
a segmentation fault in gfortran (internal error):
        write(fmt='(''STRING'')')
        end

Compile command: gfortran FilecontainingCode.f
Message:
f951: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

It is because the unit number has been forgotten.
With this code:
        write(*,fmt='(''STRING'')')
        end
it works


Gfortran from Mandriva 2009.0

Using built-in specs.
Target: i586-manbo-linux-gnu
Configured with: ../configure --prefix=/usr --libexecdir=/usr/lib
--with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-checking=release
--enable-languages=c,c++,ada,fortran,objc,obj-c++,java
--build=i586-manbo-linux-gnu --host=i586-manbo-linux-gnu --with-cpu=generic
--with-system-zlib --enable-threads=posix --enable-shared --enable-long-long
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--enable-java-awt=gtk --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-gtk-cairo
--disable-libjava-multilib --enable-ssp --disable-libssp --disable-werror
Thread model: posix
gcc version 4.3.2 (GCC)


-- 
           Summary: gfortran segmentation fault when a unit number is
                    missing
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Philippe dot Poilbarbe at cls dot fr


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


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

* [Bug fortran/40839] gfortran segmentation fault when a unit number is missing
  2009-07-23 15:33 [Bug fortran/40839] New: gfortran segmentation fault when a unit number is missing Philippe dot Poilbarbe at cls dot fr
@ 2009-07-23 16:29 ` jakub at gcc dot gnu dot org
  2009-07-23 18:10 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-07-23 16:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2009-07-23 16:29 -------
Created an attachment (id=18245)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18245&action=view)
gcc45-pr40839.patch

Patch I'm going to test.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED


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


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

* [Bug fortran/40839] gfortran segmentation fault when a unit number is missing
  2009-07-23 15:33 [Bug fortran/40839] New: gfortran segmentation fault when a unit number is missing Philippe dot Poilbarbe at cls dot fr
  2009-07-23 16:29 ` [Bug fortran/40839] " jakub at gcc dot gnu dot org
@ 2009-07-23 18:10 ` jakub at gcc dot gnu dot org
  2009-10-04 20:56 ` jvdelisle at gcc dot gnu dot org
  2009-10-04 21:12 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-07-23 18:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2009-07-23 18:09 -------
Subject: Bug 40839

Author: jakub
Date: Thu Jul 23 18:09:43 2009
New Revision: 150021

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=150021
Log:
        PR fortran/40839
        * io.c (gfc_resolve_dt): Add LOC argument.  Fail if
        dt->io_unit is NULL.  Return FAILURE after issuing error about
        negative UNIT number.
        (match_io_element): Don't segfault if current_dt->io_unit is NULL.
        * gfortran.h (gfc_resolve_dt): Adjust prototype.
        * resolve.c (resolve_code): Adjust caller.

        * gfortran.dg/pr40839.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr40839.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/io.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/40839] gfortran segmentation fault when a unit number is missing
  2009-07-23 15:33 [Bug fortran/40839] New: gfortran segmentation fault when a unit number is missing Philippe dot Poilbarbe at cls dot fr
  2009-07-23 16:29 ` [Bug fortran/40839] " jakub at gcc dot gnu dot org
  2009-07-23 18:10 ` jakub at gcc dot gnu dot org
@ 2009-10-04 20:56 ` jvdelisle at gcc dot gnu dot org
  2009-10-04 21:12 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-10-04 20:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2009-10-04 20:56 -------
Can this PR be closed?


-- 


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


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

* [Bug fortran/40839] gfortran segmentation fault when a unit number is missing
  2009-07-23 15:33 [Bug fortran/40839] New: gfortran segmentation fault when a unit number is missing Philippe dot Poilbarbe at cls dot fr
                   ` (2 preceding siblings ...)
  2009-10-04 20:56 ` jvdelisle at gcc dot gnu dot org
@ 2009-10-04 21:12 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-10-04 21:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2009-10-04 21:12 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2009-10-04 21:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-23 15:33 [Bug fortran/40839] New: gfortran segmentation fault when a unit number is missing Philippe dot Poilbarbe at cls dot fr
2009-07-23 16:29 ` [Bug fortran/40839] " jakub at gcc dot gnu dot org
2009-07-23 18:10 ` jakub at gcc dot gnu dot org
2009-10-04 20:56 ` jvdelisle at gcc dot gnu dot org
2009-10-04 21:12 ` jakub at gcc dot gnu dot org

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