Bug 24005 - Ambiguous INTERFACE leads to seg fault
Summary: Ambiguous INTERFACE leads to seg fault
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.0.3
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-21 22:40 UTC by kargls
Modified: 2005-09-29 18:23 UTC (History)
1 user (show)

See Also:
Host: freebsd-*-amd64
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
ambiguous INTERFACE code (220 bytes, text/plain)
2005-09-21 22:41 UTC, kargls
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kargls 2005-09-21 22:40:16 UTC
The mpfun90 package will cause gfortran to seg fault during
compilation.  The problem appears to be due to an ambiguous
interface.  I'll attach a cutdowen version of the code.
Comment 1 kargls 2005-09-21 22:41:22 UTC
Created attachment 9788 [details]
ambiguous INTERFACE code
Comment 2 kargls 2005-09-21 22:44:18 UTC
The code checker at www.lahey.com come shows

Compiling program unit y at line 1:
Compiling program unit z at line 17:
  2278-W: "SOURCE.F90", line 22: Specific procedures (f) and (f) do not ensure
that generic reference (ambiguous) is unambiguous.
Encountered 0 errors, 1 warning, 0 informations in file SOURCE.F90.
Compiling file SOURCE.F90.
Comment 3 kargls 2005-09-21 22:45:36 UTC
GDB suggests that we are passing a NULL pointer to strcmp.  Here's the backtrace.

#0  0x0000000200dda110 in strcmp () from /lib/libc.so.6
#1  0x0000000000419c0b in check_interface1 (p=0xbb6680, q=0xbb66a0, 
    generic_flag=1, 
    interface_name=0x7fffffffe290 "generic interface 'ambiguous'")
    at ../../gcc41/gcc/fortran/interface.c:929
#2  0x000000000041a136 in check_sym_interfaces (sym=Variable "sym" is not available.
)
    at ../../gcc41/gcc/fortran/interface.c:967
#3  0x0000000000446dee in traverse_ns (st=0xbe77c0, 
    func=0x41a0d0 <check_sym_interfaces>)
    at ../../gcc41/gcc/fortran/symbol.c:2313
#4  0x0000000000446dd6 in traverse_ns (st=0xbe7180, 
    func=0x41a0d0 <check_sym_interfaces>)
    at ../../gcc41/gcc/fortran/symbol.c:2316
#5  0x0000000000419cc8 in gfc_check_interfaces (ns=0xc10800)
    at ../../gcc41/gcc/fortran/interface.c:1016
#6  0x000000000043ebe1 in gfc_resolve (ns=0xc10800)
    at ../../gcc41/gcc/fortran/resolve.c:5070
#7  0x00000000004369ca in gfc_parse_file ()
    at ../../gcc41/gcc/fortran/parse.c:2626
#8  0x000000000044eb3a in gfc_be_parse_file (set_yydebug=Variable "set_yydebug"
is not available.
)
    at ../../gcc41/gcc/fortran/f95-lang.c:256
#9  0x000000000071adae in toplev_main (argc=Variable "argc" is not available.
) at ../../gcc41/gcc/toplev.c:990
Comment 4 GCC Commits 2005-09-22 22:46:07 UTC
Subject: Bug 24005

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	kargl@gcc.gnu.org	2005-09-22 22:45:43

Modified files:
	gcc/fortran    : ChangeLog interface.c 

Log message:
	PR fortran/24005
	* interface.c (check_interface1): Fix NULL dereference.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.566&r2=1.567
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/interface.c.diff?cvsroot=gcc&r1=1.19&r2=1.20

Comment 5 GCC Commits 2005-09-22 22:47:59 UTC
Subject: Bug 24005

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	kargl@gcc.gnu.org	2005-09-22 22:47:45

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: interface_1.f90 

Log message:
	PR fortran/24005
	gfortran.dg/interface_1.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6099&r2=1.6100
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/interface_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 6 GCC Commits 2005-09-29 18:10:45 UTC
Subject: Bug 24005

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	kargl@gcc.gnu.org	2005-09-29 18:10:33

Modified files:
	gcc/fortran    : ChangeLog interface.c 

Log message:
	PR fortran/24005
	* interface.c (check_interface1): Fix NULL dereference.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.120&r2=1.335.2.121
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/interface.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.15.2.1&r2=1.15.2.2

Comment 7 GCC Commits 2005-09-29 18:22:36 UTC
Subject: Bug 24005

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	kargl@gcc.gnu.org	2005-09-29 18:22:21

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: interface_1.f90 

Log message:
	PR fortran/24005
	gfortran.dg/interface_1.f90: 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.415&r2=1.5084.2.416
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/interface_1.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.8.1

Comment 8 kargls 2005-09-29 18:23:51 UTC
Backport from 4.1.0 to 4.0.3.