M_system icon indicating copy to clipboard operation
M_system copied to clipboard

demo_system_dir fail `Substring out of bounds: upper bound (7) of 'wildtext' exceeds string length (6)`

Open epagone opened this issue 9 months ago • 0 comments

$ fpm new --app m_system-bug
$ cd m_system-bug/
$ cat fpm.toml
...
[dependencies]
M_system = {git = "https://github.com/urbanjost/M_system.git"}
$ cat app/main.f90 
program main
  use M_system, only : system_dir
  implicit none
  write(*, "(a)") system_dir(pattern="*.f90")
end program main
$ fpm run --compiler gfortran-11 --profile debug 
 + mkdir -p build/dependencies
Initialised empty Git repository in ...
remote: Enumerating objects: 595, done.
remote: Counting objects: 100% (595/595), done.
remote: Compressing objects: 100% (298/298), done.
remote: Total 595 (delta 352), reused 435 (delta 285), pack-reused 0
Receiving objects: 100% (595/595), 1.76 MiB | 6.63 MiB/s, done.
Resolving deltas: 100% (352/352), done.
From https://github.com/urbanjost/M_system
 * branch            HEAD       -> FETCH_HEAD
C-M_system.c                           done.
M_system.F90                           done.
libm_system-bug.a                      done.
main.f90                               done.
m_system-bug                           done.
[100%] Project compiled successfully.
At line 5477 of file build/dependencies/M_system/src/M_system.F90
Fortran runtime error: Substring out of bounds: upper bound (7) of 'wildtext' exceeds string length (6)

Error termination. Backtrace:
#0  0x7fb0edcfd970 in ???
#1  0x7fb0edcfe4f9 in ???
#2  0x7fb0edcfeaf6 in ???
#3  0x55f9db9e87db in matchw
	at build/dependencies/M_system/src/M_system.F90:5477
#4  0x55f9db9e9eab in __m_system_MOD_system_dir
	at build/dependencies/M_system/src/M_system.F90:5420
#5  0x55f9db9e77e9 in MAIN__
	at app/main.f90:4
#6  0x55f9db9e789f in main
	at app/main.f90:2
<ERROR> Execution for object " m_system-bug " returned exit code  2
<ERROR> *cmd_run*:stopping due to failed executions
STOP 2
$ gfortran-11 -v
Using built-in specs.
COLLECT_GCC=gfortran-11
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-2ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-PfdVzN/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-PfdVzN/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-2ubuntu1~20.04) 

Unfortunately, I cannot test at the moment other versions of gfortran or ifort, ifx

epagone avatar Sep 26 '23 22:09 epagone