Bug 20950 - [4.0 only] segfault in INQUIRE asking for SEQUENTIAL status
Summary: [4.0 only] segfault in INQUIRE asking for SEQUENTIAL status
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: unknown
: P2 normal
Target Milestone: 4.0.1
Assignee: Not yet assigned to anyone
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2005-04-11 15:40 UTC by Francois-Xavier Coudert
Modified: 2005-04-27 18:16 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-04-18 07:40:41


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francois-Xavier Coudert 2005-04-11 15:40:45 UTC
$ cat fc112.f 
      character*20 c
      inquire (33, sequential = c)
      print *, c
      end
$ ./bin/gfortran -static fc112.f && ./a.out
zsh: segmentation fault  ./a.out

With gdb:
Program received signal SIGSEGV, Segmentation fault.
inquire_via_unit (u=0x0) at ../../../gcc/libgfortran/io/inquire.c:92
92            else


Patch will follow soon.
Comment 1 CVS Commits 2005-04-18 07:34:44 UTC
Subject: Bug 20950

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	fxcoudert@gcc.gnu.org	2005-04-18 07:34:33

Modified files:
	gcc/testsuite  : ChangeLog 
	libgfortran    : ChangeLog 
	libgfortran/io : inquire.c 
Added files:
	gcc/testsuite/gfortran.dg: pr20950.f 

Log message:
	PR libfortran/20950
	* io/inquire.c (inquire_via_unit): Check for the gfc_unit being
	NULL when setting ioparm.sequential.
	* gfortran.dg/pr20950.f: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5363&r2=1.5364
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/pr20950.f.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.196&r2=1.197
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/inquire.c.diff?cvsroot=gcc&r1=1.10&r2=1.11

Comment 2 Francois-Xavier Coudert 2005-04-18 07:40:40 UTC
Patch commited to mainline. Waiting for 4.0 to reopen.
Comment 3 CVS Commits 2005-04-27 18:15:57 UTC
Subject: Bug 20950

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	fxcoudert@gcc.gnu.org	2005-04-27 18:15:39

Modified files:
	gcc/testsuite  : ChangeLog 
	libgfortran    : ChangeLog 
	libgfortran/io : inquire.c 
Added files:
	gcc/testsuite/gfortran.dg: pr20950.f 

Log message:
	PR libfortran/20950
	
	* io/inquire.c (inquire_via_unit): Check for the gfc_unit being
	NULL when setting ioparm.sequential.
	
	* gfortran.dg/pr20950.f: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.142&r2=1.5084.2.143
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/pr20950.f.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.163.2.19&r2=1.163.2.20
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/inquire.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.9.8.1&r2=1.9.8.2

Comment 4 Francois-Xavier Coudert 2005-04-27 18:16:32 UTC
Patch commited to 4.0. Fixed.
Comment 5 eschenb@informatik.uni-frankfurt.de 2005-04-28 03:58:34 UTC
Subject: Re:  [4.0 only] segfault in INQUIRE asking
	for SEQUENTIAL status

Was heißt hier Nutte, man muß ja sehen, wo man bleibt, da wird man ja wohl mal
quer durch dei Stadt rumhuren dürfen *gggg*

;-) - Nich zu ernst nehmen *ggg*


Zitat von cvs-commit at gcc dot gnu dot org <gcc-bugzilla@gcc.gnu.org>:

>
> ------- Additional Comments From cvs-commit at gcc dot gnu dot org
> 2005-04-27 18:15 -------
> Subject: Bug 20950
>
> CVSROOT:	/cvs/gcc
> Module name:	gcc
> Branch: 	gcc-4_0-branch
> Changes by:	fxcoudert@gcc.gnu.org	2005-04-27 18:15:39
>
> Modified files:
> 	gcc/testsuite  : ChangeLog
> 	libgfortran    : ChangeLog
> 	libgfortran/io : inquire.c
> Added files:
> 	gcc/testsuite/gfortran.dg: pr20950.f
>
> Log message:
> 	PR libfortran/20950
>
> 	* io/inquire.c (inquire_via_unit): Check for the gfc_unit being
> 	NULL when setting ioparm.sequential.
>
> 	* gfortran.dg/pr20950.f: New test.
>
> Patches:
> http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.142&r2=1.5084.2.143
> http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/pr20950.f.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.4.1
> http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.163.2.19&r2=1.163.2.20
> http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/inquire.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.9.8.1&r2=1.9.8.2
>
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20950
>