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

execute_command_line crashes on nonexisting command

Sergey_B_
Beginner
1,638 Views

The intrinsic 'execute_command_line' instruction (F2008) crashes on Intel Fortran for Linux 17.0.4 with segmentation fault if the command cannot be found. This is a strange behaviour. I am using the instruction to test if certain executable module can be  run based on the exitstat and cmdstat parameters, but it does not work this way with ifort.

Here is the test code:

program zzz

integer :: int_1 = 0, int_2 = 0
character(len=:), allocatable :: CMD
character(len=255) :: msg_out = "unknown"
CMD="zzz_idontexist"

call execute_command_line( CMD, wait=.TRUE., exitstat=int_1,   &
                           cmdstat=int_2 ,cmdmsg=msg_out )

print *, "Report: ", CMD, int_1, int_2, trim(msg_out)

end program zzz

Here is the output comparing it with GNU gfortran:

$ gfortran test_exec_cmd.f90 
$ ./a.out 
sh: 1: zzz_idontexist: not found
 Report: zzz_idontexist         127           0 unknown


$ ifort test_exec_cmd.f90 
$ ./a.out 
sh: 1: zzz_idontexist: not found
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source             
a.out              0000000000403144  Unknown               Unknown  Unknown
libpthread-2.19.s  00007F19EECFF330  Unknown               Unknown  Unknown
libc-2.19.so       00007F19EE9B292D  memset                Unknown  Unknown
a.out              0000000000402E92  Unknown               Unknown  Unknown
a.out              0000000000402B19  Unknown               Unknown  Unknown
a.out              000000000040299E  Unknown               Unknown  Unknown
libc-2.19.so       00007F19EE947F45  __libc_start_main     Unknown  Unknown
a.out              00000000004028A9  Unknown               Unknown  Unknown

$ ifort -v
ifort version 17.0.4

Strangely, the same code works on the Windows platform:

O:\WORK>ifort -o zzz.exe test_exec_cmd.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.143 Build 20161005
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:zzz.exe
-subsystem:console
test_exec_cmd.obj

O:\WORK>zzz.exe
'zzz_idontexist' is not recognized as an internal or external command,
operable program or batch file.
 Report: zzz_idontexist           1           0 unknown

O:\WORK>gfortran -o zzz.exe test_exec_cmd.f90

O:\WORK>zzz.exe
'zzz_idontexist' is not recognized as an internal or external command,
operable program or batch file.
 Report: zzz_idontexist           1           0 unknown

 

0 Kudos
19 Replies
Juergen_R_R
Valued Contributor I
1,638 Views

Actually, for me on Ubuntu 14.04 this example hangs with ifort 17.0.4 while with the ifort 18 beta I get a memory corruption

$ ./a.out 
sh: 1: zzz_idontexist: not found
*** buffer overflow detected ***: ./a.out terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7329f)[0x7ffa4b18329f]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7ffa4b21e83c]
/lib/x86_64-linux-gnu/libc.so.6(+0x10d710)[0x7ffa4b21d710]
/lib/x86_64-linux-gnu/libc.so.6(+0x10cc19)[0x7ffa4b21cc19]
/lib/x86_64-linux-gnu/libc.so.6(_IO_default_xsputn+0xbc)[0x7ffa4b18b61c]
/lib/x86_64-linux-gnu/libc.so.6(_IO_vfprintf+0x1cc5)[0x7ffa4b15b905]
/lib/x86_64-linux-gnu/libc.so.6(__vsprintf_chk+0x84)[0x7ffa4b21cca4]
/lib/x86_64-linux-gnu/libc.so.6(__sprintf_chk+0x7d)[0x7ffa4b21cbfd]
./a.out[0x425b20]
./a.out[0x403f49]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7ffa4b4e9330]
./a.out[0x4039ef]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7ffa4b4e9330]
./a.out[0x48abc7]
./a.out[0x402fc6]
./a.out[0x402c38]
./a.out[0x402a62]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7ffa4b131f45]
./a.out[0x402969]
======= Memory map: ========
00400000-004b6000 r-xp 00000000 08:07 50995430                           /home/reuter/Computing/fortran/a.out
006b5000-006ba000 rw-p 000b5000 08:07 50995430                           /home/reuter/Computing/fortran/a.out
006ba000-0070b000 rw-p 00000000 00:00 0                                  [stack:20286]
01356000-01377000 rw-p 00000000 00:00 0                                  [heap]
7ffa4acf6000-7ffa4acf9000 r-xp 00000000 08:01 1178394                    /lib/x86_64-linux-gnu/libdl-2.19.so
7ffa4acf9000-7ffa4aef8000 ---p 00003000 08:01 1178394                    /lib/x86_64-linux-gnu/libdl-2.19.so
7ffa4aef8000-7ffa4aef9000 r--p 00002000 08:01 1178394                    /lib/x86_64-linux-gnu/libdl-2.19.so
7ffa4aef9000-7ffa4aefa000 rw-p 00003000 08:01 1178394                    /lib/x86_64-linux-gnu/libdl-2.19.so
7ffa4aefa000-7ffa4af10000 r-xp 00000000 08:01 1177672                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffa4af10000-7ffa4b10f000 ---p 00016000 08:01 1177672                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffa4b10f000-7ffa4b110000 rw-p 00015000 08:01 1177672                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffa4b110000-7ffa4b2ce000 r-xp 00000000 08:01 1178390                    /lib/x86_64-linux-gnu/libc-2.19.so
7ffa4b2ce000-7ffa4b4ce000 ---p 001be000 08:01 1178390                    /lib/x86_64-linux-gnu/libc-2.19.so
7ffa4b4ce000-7ffa4b4d2000 r--p 001be000 08:01 1178390                    /lib/x86_64-linux-gnu/libc-2.19.so
7ffa4b4d2000-7ffa4b4d4000 rw-p 001c2000 08:01 1178390                    /lib/x86_64-linux-gnu/libc-2.19.so
7ffa4b4d4000-7ffa4b4d9000 rw-p 00000000 00:00 0 
7ffa4b4d9000-7ffa4b4f2000 r-xp 00000000 08:01 1178391                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7ffa4b4f2000-7ffa4b6f1000 ---p 00019000 08:01 1178391                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7ffa4b6f1000-7ffa4b6f2000 r--p 00018000 08:01 1178391                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7ffa4b6f2000-7ffa4b6f3000 rw-p 00019000 08:01 1178391                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7ffa4b6f3000-7ffa4b6f7000 rw-p 00000000 00:00 0 
7ffa4b6f7000-7ffa4b7fc000 r-xp 00000000 08:01 1178389                    /lib/x86_64-linux-gnu/libm-2.19.so
7ffa4b7fc000-7ffa4b9fb000 ---p 00105000 08:01 1178389                    /lib/x86_64-linux-gnu/libm-2.19.so
7ffa4b9fb000-7ffa4b9fc000 r--p 00104000 08:01 1178389                    /lib/x86_64-linux-gnu/libm-2.19.so
7ffa4b9fc000-7ffa4b9fd000 rw-p 00105000 08:01 1178389                    /lib/x86_64-linux-gnu/libm-2.19.so
7ffa4b9fd000-7ffa4ba20000 r-xp 00000000 08:01 1178398                    /lib/x86_64-linux-gnu/ld-2.19.so
7ffa4bbf2000-7ffa4bbf7000 rw-p 00000000 00:00 0 
7ffa4bc1c000-7ffa4bc1f000 rw-p 00000000 00:00 0 
7ffa4bc1f000-7ffa4bc20000 r--p 00022000 08:01 1178398                    /lib/x86_64-linux-gnu/ld-2.19.so
7ffa4bc20000-7ffa4bc21000 rw-p 00023000 08:01 1178398                    /lib/x86_64-linux-gnu/ld-2.19.so
7ffa4bc21000-7ffa4bc22000 rw-p 00000000 00:00 0 
7ffc42bbd000-7ffc42cde000 rw-p 00000000 00:00 0 
7ffc42d1b000-7ffc42d1d000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

 

0 Kudos
Sergey_B_
Beginner
1,638 Views

Do you have access to a previous version(s) of ifort? Is it a regression or an old bug? I guess this is a fairly new F2008 instruction and it could be poorly tested. Do they use  unit tests or something?

0 Kudos
Juergen_R_R
Valued Contributor I
1,638 Views

With Version 15.0.3.187 Build 20150407 it works, however it doesn't print out the last line!? With  16.0.3 20160415, the program also hangs for me. 

0 Kudos
Sergey_B_
Beginner
1,638 Views

It might be the bug is linked with the glibc. So here is the version at the above system:

$ ldd --version
ldd (Ubuntu EGLIBC 2.19-0ubuntu6.13) 2.19

Additionally, I was able to reproduce the bug on another system running Debian. Here the program just hangs when attempting to run the external program.

Here is the glibc for Debian:

$ ldd --version
ldd (Debian GLIBC 2.19-18+deb8u10) 2.19

So, it seems there is a compiler bug.

0 Kudos
Sergey_B_
Beginner
1,638 Views

This bug is still there in ifort 18.0.0:

sh: 1: zzz_idontexist: not found
*** buffer overflow detected ***: ./a.out terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7329f)[0x7f8ca7b6229f]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f8ca7bfd83c]
/lib/x86_64-linux-gnu/libc.so.6(+0x10d710)[0x7f8ca7bfc710]
/lib/x86_64-linux-gnu/libc.so.6(+0x10cc19)[0x7f8ca7bfbc19]
/lib/x86_64-linux-gnu/libc.so.6(_IO_default_xsputn+0xbc)[0x7f8ca7b6a61c]
/lib/x86_64-linux-gnu/libc.so.6(_IO_vfprintf+0x1cc5)[0x7f8ca7b3a905]
/lib/x86_64-linux-gnu/libc.so.6(__vsprintf_chk+0x84)[0x7f8ca7bfbca4]
/lib/x86_64-linux-gnu/libc.so.6(__sprintf_chk+0x7d)[0x7f8ca7bfbbfd]
./a.out[0x425f18]
./a.out[0x403f33]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7f8ca7ec8330]
./a.out[0x427621]
./a.out[0x425e70]
./a.out[0x403f33]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7f8ca7ec8330]
./a.out[0x4039db]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7f8ca7ec8330]
./a.out[0x48b714]
./a.out[0x402fb2]
./a.out[0x402c28]
./a.out[0x402a5e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f8ca7b10f45]
./a.out[0x402969]
======= Memory map: ========
00400000-004b7000 r-xp 00000000 08:06 169988534                          /home/budaev/downloads/a.out
006b6000-006bb000 rw-p 000b6000 08:06 169988534                          /home/budaev/downloads/a.out
006bb000-0070c000 rw-p 00000000 00:00 0                                  [stack:3832]
0081b000-0083c000 rw-p 00000000 00:00 0                                  [heap]
7f8ca76d5000-7f8ca76d8000 r-xp 00000000 08:01 132009                     /lib/x86_64-linux-gnu/libdl-2.19.so
7f8ca76d8000-7f8ca78d7000 ---p 00003000 08:01 132009                     /lib/x86_64-linux-gnu/libdl-2.19.so
7f8ca78d7000-7f8ca78d8000 r--p 00002000 08:01 132009                     /lib/x86_64-linux-gnu/libdl-2.19.so
7f8ca78d8000-7f8ca78d9000 rw-p 00003000 08:01 132009                     /lib/x86_64-linux-gnu/libdl-2.19.so
7f8ca78d9000-7f8ca78ef000 r-xp 00000000 08:01 132209                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8ca78ef000-7f8ca7aee000 ---p 00016000 08:01 132209                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8ca7aee000-7f8ca7aef000 rw-p 00015000 08:01 132209                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8ca7aef000-7f8ca7cad000 r-xp 00000000 08:01 132005                     /lib/x86_64-linux-gnu/libc-2.19.so
7f8ca7cad000-7f8ca7ead000 ---p 001be000 08:01 132005                     /lib/x86_64-linux-gnu/libc-2.19.so
7f8ca7ead000-7f8ca7eb1000 r--p 001be000 08:01 132005                     /lib/x86_64-linux-gnu/libc-2.19.so
7f8ca7eb1000-7f8ca7eb3000 rw-p 001c2000 08:01 132005                     /lib/x86_64-linux-gnu/libc-2.19.so
7f8ca7eb3000-7f8ca7eb8000 rw-p 00000000 00:00 0 
7f8ca7eb8000-7f8ca7ed1000 r-xp 00000000 08:01 132006                     /lib/x86_64-linux-gnu/libpthread-2.19.so
7f8ca7ed1000-7f8ca80d0000 ---p 00019000 08:01 132006                     /lib/x86_64-linux-gnu/libpthread-2.19.so
7f8ca80d0000-7f8ca80d1000 r--p 00018000 08:01 132006                     /lib/x86_64-linux-gnu/libpthread-2.19.so
7f8ca80d1000-7f8ca80d2000 rw-p 00019000 08:01 132006                     /lib/x86_64-linux-gnu/libpthread-2.19.so
7f8ca80d2000-7f8ca80d6000 rw-p 00000000 00:00 0 
7f8ca80d6000-7f8ca81db000 r-xp 00000000 08:01 132004                     /lib/x86_64-linux-gnu/libm-2.19.so
7f8ca81db000-7f8ca83da000 ---p 00105000 08:01 132004                     /lib/x86_64-linux-gnu/libm-2.19.so
7f8ca83da000-7f8ca83db000 r--p 00104000 08:01 132004                     /lib/x86_64-linux-gnu/libm-2.19.so
7f8ca83db000-7f8ca83dc000 rw-p 00105000 08:01 132004                     /lib/x86_64-linux-gnu/libm-2.19.so
7f8ca83dc000-7f8ca83ff000 r-xp 00000000 08:01 132013                     /lib/x86_64-linux-gnu/ld-2.19.so
7f8ca85cf000-7f8ca85d4000 rw-p 00000000 00:00 0 
7f8ca85e9000-7f8ca85ea000 rw-p 00000000 00:00 0 
7f8ca85ea000-7f8ca85f3000 r--p 00000000 08:01 939405                     /opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin/locale/en_US/ifcore_msg.cat
7f8ca85f3000-7f8ca85fc000 r--p 00000000 08:01 939405                     /opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin/locale/en_US/ifcore_msg.cat
7f8ca85fc000-7f8ca85fe000 rw-p 00000000 00:00 0 
7f8ca85fe000-7f8ca85ff000 r--p 00022000 08:01 132013                     /lib/x86_64-linux-gnu/ld-2.19.so
7f8ca85ff000-7f8ca8600000 rw-p 00023000 08:01 132013                     /lib/x86_64-linux-gnu/ld-2.19.so
7f8ca8600000-7f8ca8601000 rw-p 00000000 00:00 0 
7ffe09599000-7ffe095bb000 rw-p 00000000 00:00 0 
7ffe095bd000-7ffe095bf000 r--p 00000000 00:00 0                          [vvar]
7ffe095bf000-7ffe095c1000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted

 

0 Kudos
Steve_Lionel
Honored Contributor III
1,638 Views

Please report this through the Intel Online Service Center.

0 Kudos
Johannes_Rieke
New Contributor III
1,638 Views

Hi, in case that it is the glibc issue (version 2.24-9 and newer, however your's older 2.19-18+deb8u10), it is fixed not before PSXE 18 update 1 according to the link below. Update 1 is released, but I have not tested it. Maybe you give it a try or test to compile with -fPIC or set the LD_BIND_NOW=1 etc.

https://software.intel.com/en-us/articles/intel-compiler-not-compatible-with-glibc-224-9-and-newer

Best regards, Johannes

0 Kudos
Sergey_B_
Beginner
1,638 Views

Thanks for response. I have tried both your suggestions. With -fPIC it hangs completely, so I cannot even stop it with ^C.

$ ifort -fPIC test_zzz.f90 
$ ./a.out 
sh: 1: zzz_idontexist: not found
^C^C^C^C^C^Z
[2]+  Stopped                 ./a.out

LD_BIND_NOW also doesn't help.

I have not tried Update 1, will install it now and try.

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,638 Views

FWIW

Try:

CMD="zzz_idontexist" // CHAR(0)

Jim Dempsey

0 Kudos
Sergey_B_
Beginner
1,638 Views

Thanks, but CMD="zzz_idontexist" // char(0) doesn't help either. I will try to update 1 later.

0 Kudos
Johannes_Rieke
New Contributor III
1,638 Views

Hi, a happy New Year to all!

I installed PSXE 2018 update 1 today on my GNU/Linux system. The original code crashes also with 18.0.1.

$ ./a.out 
sh: 1: zzz_idontexist: not found
*** buffer overflow detected ***: ./a.out terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7329f)[0x7f449d3fa29f]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f449d49583c]
/lib/x86_64-linux-gnu/libc.so.6(+0x10d710)[0x7f449d494710]
/lib/x86_64-linux-gnu/libc.so.6(+0x10cc19)[0x7f449d493c19]
/lib/x86_64-linux-gnu/libc.so.6(_IO_default_xsputn+0xbc)[0x7f449d40261c]
/lib/x86_64-linux-gnu/libc.so.6(_IO_vfprintf+0x1cc5)[0x7f449d3d2905]
/lib/x86_64-linux-gnu/libc.so.6(__vsprintf_chk+0x84)[0x7f449d493ca4]
/lib/x86_64-linux-gnu/libc.so.6(__sprintf_chk+0x7d)[0x7f449d493bfd]
./a.out[0x4260b8]
./a.out[0x4040c3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7f449d760330]
./a.out[0x403b6b]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7f449d760330]
./a.out[0x48b8f7]
./a.out[0x40313a]
./a.out[0x402da8]
./a.out[0x402bde]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f449d3a8f45]
./a.out[0x402ae9]
======= Memory map: ========
00400000-004b7000 r-xp 00000000 08:01 2097193                            /home/xxx/Fortran_test/a.out
006b6000-006bb000 rw-p 000b6000 08:01 2097193                            /home/xxx/Fortran_test/a.out
006bb000-0070c000 rw-p 00000000 00:00 0                                  [stack:10654]
00cb6000-00cd7000 rw-p 00000000 00:00 0                                  [heap]
7f449cf6d000-7f449cf70000 r-xp 00000000 08:01 3015963                    /lib/x86_64-linux-gnu/libdl-2.19.so
7f449cf70000-7f449d16f000 ---p 00003000 08:01 3015963                    /lib/x86_64-linux-gnu/libdl-2.19.so
7f449d16f000-7f449d170000 r--p 00002000 08:01 3015963                    /lib/x86_64-linux-gnu/libdl-2.19.so
7f449d170000-7f449d171000 rw-p 00003000 08:01 3015963                    /lib/x86_64-linux-gnu/libdl-2.19.so
7f449d171000-7f449d187000 r-xp 00000000 08:01 293110                     /usr/local/gcc-7.2/lib64/libgcc_s.so.1
7f449d187000-7f449d386000 ---p 00016000 08:01 293110                     /usr/local/gcc-7.2/lib64/libgcc_s.so.1
7f449d386000-7f449d387000 rw-p 00015000 08:01 293110                     /usr/local/gcc-7.2/lib64/libgcc_s.so.1
7f449d387000-7f449d545000 r-xp 00000000 08:01 3015958                    /lib/x86_64-linux-gnu/libc-2.19.so
7f449d545000-7f449d745000 ---p 001be000 08:01 3015958                    /lib/x86_64-linux-gnu/libc-2.19.so
7f449d745000-7f449d749000 r--p 001be000 08:01 3015958                    /lib/x86_64-linux-gnu/libc-2.19.so
7f449d749000-7f449d74b000 rw-p 001c2000 08:01 3015958                    /lib/x86_64-linux-gnu/libc-2.19.so
7f449d74b000-7f449d750000 rw-p 00000000 00:00 0 
7f449d750000-7f449d769000 r-xp 00000000 08:01 3015959                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7f449d769000-7f449d968000 ---p 00019000 08:01 3015959                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7f449d968000-7f449d969000 r--p 00018000 08:01 3015959                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7f449d969000-7f449d96a000 rw-p 00019000 08:01 3015959                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7f449d96a000-7f449d96e000 rw-p 00000000 00:00 0 
7f449d96e000-7f449da73000 r-xp 00000000 08:01 3015951                    /lib/x86_64-linux-gnu/libm-2.19.so
7f449da73000-7f449dc72000 ---p 00105000 08:01 3015951                    /lib/x86_64-linux-gnu/libm-2.19.so
7f449dc72000-7f449dc73000 r--p 00104000 08:01 3015951                    /lib/x86_64-linux-gnu/libm-2.19.so
7f449dc73000-7f449dc74000 rw-p 00105000 08:01 3015951                    /lib/x86_64-linux-gnu/libm-2.19.so
7f449dc74000-7f449dc97000 r-xp 00000000 08:01 3015989                    /lib/x86_64-linux-gnu/ld-2.19.so
7f449de65000-7f449de6a000 rw-p 00000000 00:00 0 
7f449de93000-7f449de96000 rw-p 00000000 00:00 0 
7f449de96000-7f449de97000 r--p 00022000 08:01 3015989                    /lib/x86_64-linux-gnu/ld-2.19.so
7f449de97000-7f449de98000 rw-p 00023000 08:01 3015989                    /lib/x86_64-linux-gnu/ld-2.19.so
7f449de98000-7f449de99000 rw-p 00000000 00:00 0 
7ffc7bac4000-7ffc7bae6000 rw-p 00000000 00:00 0 
7ffc7bb49000-7ffc7bb4b000 r--p 00000000 00:00 0                          [vvar]
7ffc7bb4b000-7ffc7bb4d000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted

But Jim's hints works for 18.0.1:

program zzz
  use iso_c_binding, only: C_NULL_CHAR
  integer :: int_1 = 0, int_2 = 0
  character(len=:), allocatable :: CMD
  character(len=255) :: msg_out = "unknown"
  CMD="zzz_idontexist"//C_NULL_CHAR
  call execute_command_line( CMD, wait=.true., exitstat=int_1,&
                               cmdstat=int_2 ,cmdmsg=msg_out )    
  print *, "Report: ", CMD, int_1, int_2, trim(msg_out)
end program zzz
$ ./a.out 
sh: 1: zzz_idontexist: not found
 Report: zzz_idontexist           0         124 
 Invalid command supplied to EXECUTE_COMMAND_LINE
$ ifort --version
ifort (IFORT) 18.0.1 20171018
Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.

I think this is still a bug in ifort. BTW: gfortran 7.2 runs without appending c_null_char.

 

0 Kudos
Sergey_B_
Beginner
1,638 Views

Thanks. Please how could I post a bug? When I try to log in to Online Service Center, it passes me to "Create a Support Account" where the name, email etc and "Next" button are greyed and non-functional. I have used a Contact account support link but they didn't respond. Thanks!

 

 

 

0 Kudos
Sergey_B_
Beginner
1,638 Views

I checked the intel fortran 18.0.1, and it occurred that the Jim's hint does work, but only if C_NULL_CHAR is imported from the ISO C module

CMD="zzz_idontexist"//C_NULL_CHAR

If, however, just intrinsic null char is added

CMD="zzz_idontexist"//char(0)

it still crashes with buffer overflow:

$ ./a.out
sh: 1: zzz_idontexist: not found
*** buffer overflow detected ***: ./a.out terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7329f)[0x7fdc576c429f]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7fdc5775f87c]
/lib/x86_64-linux-gnu/libc.so.6(+0x10d750)[0x7fdc5775e750]
/lib/x86_64-linux-gnu/libc.so.6(+0x10cc59)[0x7fdc5775dc59]
/lib/x86_64-linux-gnu/libc.so.6(_IO_default_xsputn+0xbc)[0x7fdc576cc61c]
/lib/x86_64-linux-gnu/libc.so.6(_IO_vfprintf+0x1cc5)[0x7fdc5769c905]
/lib/x86_64-linux-gnu/libc.so.6(__vsprintf_chk+0x84)[0x7fdc5775dce4]
/lib/x86_64-linux-gnu/libc.so.6(__sprintf_chk+0x7d)[0x7fdc5775dc3d]
./a.out[0x426fa8]

......

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,638 Views

iso_c_binding.f90 defines C_NULL_CHAR as ACHAR(0), not CHAR(0).

The two should be equivalent. I do not know the effect when the host character set is not ASCII.

Jim Dempsey

0 Kudos
Sergey_B_
Beginner
1,638 Views

With the recent ifort, both char(0) and achar(0) result in crashing. But C_NULL_CHAR does not.It's strange.With gfortran everything works.

Hence here is the obvious workaround

call execute_command_line( CMD//C_NULL_CHAR,              &
                           wait=.true., exitstat=int_1,   &
	                   cmdstat=int_2 ,cmdmsg=msg_out ) 

Sergey

0 Kudos
Devorah_H_Intel
Moderator
1,638 Views

Sergey B. wrote:

Thanks. Please how could I post a bug? When I try to log in to Online Service Center, it passes me to "Create a Support Account" where the name, email etc and "Next" button are greyed and non-functional. I have used a Contact account support link but they didn't respond. Thanks!

Sergey,

Please use this link to submit the bug report https://supporttickets.intel.com/?lang=en-US

Thank you!

0 Kudos
Sergey_B_
Beginner
1,638 Views

When going this link I am stuck at the 'Create a Support Account' form, here First Name etc fields are greyed out and not editable while the 'Next Step' is also greyed. This occurs in a latest Firefox:

login-greyed.png

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,638 Views

Sergey,

I've experienced a similar situation with the registration web page. Maybe my experience relates to your situation. In my case I have two Intel accounts: 1) The one I registered the products with, and 2) The one I use for IDZ forum posts.

When I am logged in to the the IDZ site (user 2), and then navigate using the hyperlinks, the registration site shows I am not logged in. I cannot recall if the banner shows Sign Out as your screenshot shows.

If you have two accounts, I suggest signing out, then signing in again.

Jim Dempsey

0 Kudos
Devorah_H_Intel
Moderator
1,638 Views

Sergey, 

I have sent you a message regarding your account login issue.

0 Kudos
Reply