Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28703 Discussions

fortcom segfault when 'use'ing a library in a module

wim_van_hoydonck
Beginner
649 Views
Hi there,

I get a compiler error when 'use'ing one of the libraries of FoX (fortran xml library). The compilation may or may not succeed depending on the position of the USE statement inside the module.

If it is located in the subroutine inside the module, the compilation does not succeed. If it is located in the first part of the module, the compilation is successful.


To reproduce the problem, download the latest release of the Fortran xml library.

Download it, extract it and compile the library (this should work without problems):

$ wget http://source.uszla.me.uk/FoX/FoX-3.1.2-full.tar.gz
$ tar -xzf FoX-3.1.2-full.tar.gz
$ cd FoX-3.1.2/
$ ./configure FC=ifort
$ make

Add the following file (test.f90) in the top-level directory of the FoX directory:

$ cat test.f90
module test
!use FoX_dom
implicit none
contains
subroutine bugtest ()
! comment next line and uncomment line 2 to make this module compile
use FoX_dom
implicit none
character(len=*) , parameter :: xml_file = "test.xml"
type(Node) , pointer :: doc_ptr
type(NodeList) , pointer :: test_list_ptr
integer :: i , test
doc_ptr => parseFile( xml_file )
test_list_ptr => getElementsByTagName( doc_ptr , "test" )
print *, getLength( test_list_ptr )
end subroutine bugtest
end module test
!======================================


Compile it as follows:

$ ifort -o tst.o -c -I./objs/finclude test.f90

And you get:

fortcom: Severe: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.

compilation aborted for test.f90 (code 3)

Now, uncomment line 2 and comment line 7 and recompile.

Compilation finishes successfully.


Can anyone confirm this?

Greetings,

Wim
0 Kudos
6 Replies
wim_van_hoydonck
Beginner
649 Views
Oh yes,

It also compiles if the last line in the subroutine is removed.
Then, it doesn't matter where the USE statement is located.

So, the function call "getLength()" seems to cause some problems...


Wim
0 Kudos
wim_van_hoydonck
Beginner
649 Views

Intel Customer Support doesn't seem to understand the problem, so can anyone try (and confirm) the following (which also triggers the compiler error for me):

$ wget http://users.pandora.be/tuinbels/bugs/ifort-error.tgz
$ tar -xzf ifort-error.tgz
$ ifort -o tst.o -c -I. test.f90
fortcom: Severe: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.

compilation aborted for test.f90 (code 3)


The archive contains (some of the) mod files from the FoX library, compiled on linux x86_64, together with a test file that triggers the compiler bug.

Greetings,

Wim
0 Kudos
Steven_L_Intel1
Employee
649 Views
I'll take a look.

What's the support case number?
0 Kudos
Steven_L_Intel1
Employee
649 Views
I can reproduce it.
0 Kudos
wim_van_hoydonck1
649 Views
the issue number is 471178

Thanks for looking into it.
0 Kudos
Steven_L_Intel1
Employee
649 Views
A workaround, other than the one you found, is to disable the PRIVATE statement in FoX_dom.f90.
0 Kudos
Reply