Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26735 Discussions

Seg fault on optional pointer argument

Berggren__Bo
Beginner
137 Views

Using a pointer to an integer array as an optional argument cause a segmentation fault (ifort 18.0.3.222 Build 20180410, CentOS 7.5).

See attached code for an example.

$> ifort -c opt_args.f90 
$> ifort -o test_opt_args test_opt_args.f90 opt_args.o
$> ./test_opt_args 
 get_vals(x, y, p)
   x:            1
   y:            2
   p:            1           2           3           4
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source             
test_opt_args      000000000040405D  Unknown               Unknown  Unknown
libpthread-2.17.s  00007FA2832F76D0  Unknown               Unknown  Unknown
test_opt_args      0000000000403196  Unknown               Unknown  Unknown
test_opt_args      0000000000402E85  Unknown               Unknown  Unknown
test_opt_args      0000000000402B1E  Unknown               Unknown  Unknown
libc-2.17.so       00007FA282F3D445  __libc_start_main     Unknown  Unknown
test_opt_args      0000000000402A29  Unknown               Unknown  Unknown

 

0 Kudos
3 Replies
Juergen_R_R
Valued Contributor I
137 Views

Confirmed, this works with gfortran 5 and 9, and with nagfor 6.2 and pgfortran 18.5. And it works with ifort v17, so this is a regression in v18 and v19beta. Could you submit a bug report via the support center?

Berggren__Bo
Beginner
137 Views

I cannot submit a ticket even though I have a valid license. There must be something wrong with my account.

Can you submit it for me?

Juergen_R_R
Valued Contributor I
137 Views

I would but off for summer vacation now. Not in front of a computer. Maybe the Intel stuff picks it up...

Reply