fpm icon indicating copy to clipboard operation
fpm copied to clipboard

fpm tests failing to run/compile

Open banana-bred opened this issue 9 months ago • 2 comments

Description

Trying to package and compile fpm v0.12.0 with gfortran version 15.1.1 gives me the following backtrace (debug options added to compilation for the sake of this issue) when running fpm test in the fpm source folder:

==> Starting check()...
[  0%]        fpm_backend_console.f90

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7a9efd3545ff in ???
#1  0x7a9efd3b9c95 in ???
#2  0x609cb5b7b630 in __fpm_compile_commands_MOD_cct_register
        at _bootstrap/fpm.F90:29821
#3  0x609cb5c565d1 in __fpm_compiler_MOD_compile_fortran
        at _bootstrap/fpm.F90:38265
#4  0x609cb5d475b0 in build_target
        at _bootstrap/fpm.F90:47701
#5  0x609cb5d4a61e in __fpm_backend_MOD_build_package
        at _bootstrap/fpm.F90:47495
#6  0x609cb5d4fc1f in __fpm_MOD_cmd_run
        at _bootstrap/fpm.F90:48347
#7  0x609cb5d94b74 in MAIN__
        at _bootstrap/fpm.F90:49117
#8  0x609cb5d9510a in main
        at _bootstrap/fpm.F90:49050


I see that the binaries are built wth gfortran 12. Is this related ? Please let me know what other info I can provide.

Running fpm test with the linux binary from the 0.12.0 release, I get:

[ 98%] Compiling...
test/fpm_test/main.f90:49:34:

   49 |                 call run_selected(suite(is)%collect, test_name, error_unit, stat)
      |                                  1
Error: Interface mismatch in dummy procedure ‘collect’ at (1): ALLOCATABLE mismatch in argument '_formal_0'
compilation terminated due to -fmax-errors=1.
<ERROR> Compilation failed for object " test_fpm_test_main.f90.o "
<ERROR> stopping due to failed compilation
STOP 1

Expected Behaviour

Expected fpm test to run without error

Version of fpm

v0.12.0 (gfortran 15), v0.12.0 binary release

Platform and Architecture

Linux x86_64

Additional Information

No response

banana-bred avatar May 19 '25 03:05 banana-bred

Thank you for reporting this @banana-bred - looks related to this issue with test-drive: https://github.com/fortran-lang/test-drive/issues/49

Yes, we don't build fpm with gfortran-15 yet but this issue needs to be addressed somehow.

perazz avatar May 19 '25 06:05 perazz

This issue seems to be a bug in gfortran-15 when using -Wall which adds an option for extra interface checks rather than warnings.

Ref:

  • https://github.com/grimme-lab/mctc-lib/issues/83
  • https://github.com/dftd4/dftd4/issues/294

awvwgk avatar May 19 '25 06:05 awvwgk

Closed by #1150

perazz avatar Sep 10 '25 16:09 perazz