caffeine icon indicating copy to clipboard operation
caffeine copied to clipboard

Build failures and test suite failures with gfortran 15.1

Open bonachea opened this issue 9 months ago • 5 comments

Caffeine currently fails to build with the newly released gfortran 15.1.0

Initially the problem is build errors in the GASNet dependent library, but these can be bypassed by setting CFLAGS=-Wno-incompatible-pointer-types before install.sh.

That workaround setting is sufficient for me to fully build Caffeine, but the test suite fails at runtime, with what might be a Veggies defect.

Here is output from Caffeine fpm test:

[100%] Project compiled successfully.
 + build/gfortran_EC47EB7D39BCE50E/test/main 
Running Tests


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

Backtrace for this error:
#0  0x743309a4532f in ???
        at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
#1  0x743309aadd55 in __GI___libc_free
        at ./malloc/malloc.c:3375
#2  0x5c1a12590dde in __veggies_simple_test_collection_m_MOD_description
        at build/dependencies/veggies/src/veggies/simple_test_collection_m.f90:76
#3  0x5c1a1256a191 in __veggies_test_item_m_MOD_description
        at build/dependencies/veggies/src/veggies/test_item_m.f90:49
#4  0x5c1a12590bbe in __veggies_simple_test_collection_m_MOD_description
        at build/dependencies/veggies/src/veggies/simple_test_collection_m.f90:76
#5  0x5c1a1256a191 in __veggies_test_item_m_MOD_description
        at build/dependencies/veggies/src/veggies/test_item_m.f90:49
#6  0x5c1a12565792 in __veggies_run_tests_m_MOD_run_tests
        at build/dependencies/veggies/src/veggies/run_tests_m.f90:45
#7  0x5c1a1253a172 in run
        at test/main.F90:119
#8  0x5c1a125362ee in MAIN__
        at test/main.F90:13
#9  0x5c1a125362ee in main
        at test/main.F90:8
Segmentation fault

bonachea avatar Apr 25 '25 22:04 bonachea

@bonachea It looks like the test suite doesn't fail at runtime, but that when compiling the tests, the seg fault happens. Is that true?

Do you have gfortran-15 installed locally? Or did you discover this in CI? If you have it locally, could you run a different veggies test suite, maybe even the test suite of veggies itself, with gfortran-15?

ktras avatar Apr 25 '25 22:04 ktras

It looks like the test suite doesn't fail at runtime, but that when compiling the tests, the seg fault happens. Is that true?

No, if you look at the first two lines in my output snippet you'll see this is definitely after the test executable has finished building and started executing.

The crash happens early inside our call veggies::run_tests(). It apparently crashes while gathering up the textual display of tests it plans to run. I've confirmed via debugger that the crash occurs before the first test code runs (and hence before the first call to prif_init).

We have gfortran 15.1 installed on our internal Linux cluster and I've been poking it there. I have not yet tried running any other non-Caffeine Veggies tests.

bonachea avatar Apr 25 '25 22:04 bonachea

The self-check test suite for Veggies v1.1.3 (which is what Caffeine currently uses) crashes in a similar way:

[100%]                   veggies-test  done.
[100%] Project compiled successfully.
 + build/gfortran_25073594A1126DE6/test/veggies-test 
Running Tests


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

Backtrace for this error:
#0  0x762e74e4532f in ???
        at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
#1  0x762e74eadd55 in __GI___libc_free
        at ./malloc/malloc.c:3375
#2  0x582a3ef34e63 in __veggies_simple_test_collection_m_MOD_description
        at ././src/veggies/simple_test_collection_m.f90:76
#3  0x582a3eec97a7 in __veggies_test_item_m_MOD_description
        at ././src/veggies/test_item_m.f90:49
#4  0x582a3ef34b51 in __veggies_simple_test_collection_m_MOD_description
        at ././src/veggies/simple_test_collection_m.f90:76
#5  0x582a3eec97a7 in __veggies_test_item_m_MOD_description
        at ././src/veggies/test_item_m.f90:49
#6  0x582a3eebb7b8 in __veggies_run_tests_m_MOD_run_tests
        at ././src/veggies/run_tests_m.f90:45
#7  0x582a3ed87b8c in run
        at test/main.f90:143
#8  0x582a3ed87de3 in MAIN__
        at test/main.f90:5
#9  0x582a3ed87e35 in main
        at test/main.f90:5
Segmentation fault
<ERROR> Execution for object " veggies-test " returned exit code  139
<ERROR> *cmd_run*:stopping due to failed executions
STOP 139

Using the tip of veggies:main I also get a similar result:

[100%]                   veggies-test  done.
[100%] Project compiled successfully.
 + build/gfortran_B5AED96D9DADBF0A/test/veggies-test 
Running Tests


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

Backtrace for this error:
#0  0x77037924532f in ???
        at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
#1  0x7703792add55 in __GI___libc_free
        at ./malloc/malloc.c:3375
#2  0x61d32d47132e in __veggies_simple_test_collection_m_MOD_description
        at ././src/veggies/simple_test_collection_m.f90:77
#3  0x61d32d3c7ddf in __veggies_test_item_m_MOD_description
        at ././src/veggies/test_item_m.f90:49
#4  0x61d32d47101c in __veggies_simple_test_collection_m_MOD_description
        at ././src/veggies/simple_test_collection_m.f90:77
#5  0x61d32d3c7ddf in __veggies_test_item_m_MOD_description
        at ././src/veggies/test_item_m.f90:49
#6  0x61d32d3b97f9 in __veggies_run_tests_m_MOD_run_tests
        at ././src/veggies/run_tests_m.f90:53
#7  0x61d32d1d26ec in run
        at test/main.f90:207
#8  0x61d32d1d2943 in MAIN__
        at test/main.f90:5
#9  0x61d32d1d2995 in main
        at test/main.f90:5
Segmentation fault
<ERROR> Execution for object " veggies-test " returned exit code  139
<ERROR> *cmd_run*:stopping due to failed executions
STOP 139

So this defect is definitely independent of Caffeine and also occurs in the latest Veggies.

bonachea avatar Apr 25 '25 23:04 bonachea

@bonachea Okay, thanks, so it is runtime. Also, thanks for checking with the test suite of Veggies. One of us should open a bug report on the Veggies repo. Let me know if you are too busy and want me to use the above messages to open it myself.

ktras avatar Apr 25 '25 23:04 ktras