AnonMiraj / fig

FIG (Fortran Intuitive Graphics)
MIT License
22 stars 2 forks source link

Segmentation faults #15

Closed johandweber closed 1 month ago

johandweber commented 1 month ago

When performing

fpm test

i get segementation faults for the tests circle.90 and rect.f90.

My compiler is gfortran 13.2 ( Linux x64).

Here is a backtrace:

Backtrace for this error:
#0  0x721f48623930 in ???
#1  0x721f48622a95 in ???
#2  0x721f4824298f in ???
        at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
#3  0x60664adea9a3 in __fig_canvas_MOD_fig_save_to_ppm_file
        at ././src/fig_canvas.f90:34
#4  0x60664ade354e in circle_test
        at test/circle.f90:1
#5  0x60664ade3663 in main
        at test/circle.f90:2

So it appears to be connected with fig_save_to_ppm_file.

johandweber commented 1 month ago

It appears to happen at

        if(present(optional_file_path)) then
          file_path=optional_file_path
         end if

I do not know why it enters the if construct. optional_file-path is not set in rect_test.f90.

AnonMiraj commented 1 month ago

Weird it works fine on my side, I will test it more later.

johandweber commented 1 month ago

Maybe a compiler bug. The problem does not occur when using Intel Fortran. I'll check with gfortran 14.

johandweber commented 1 month ago

The problem also occurs for gfortran 14.1.

AnonMiraj commented 1 month ago

I still cant reproduce the segfault (I use gfortran mainly too). have you tried deleting the build cache?

johandweber commented 1 month ago

fpm clean and deleting the build directory does not change the behavior for me.

But maybe you should currently not invest too much time in fixing a bug that does not occur for you.

AnonMiraj commented 1 month ago

I removed the related tests, and I think I'm going to handle the directories differently, so i am closing this issue.

johandweber commented 1 month ago

Now there are no longer segmentation fauls.