Skip to content

Potential BUG in FLAP (varying size parameters) #48

@victorsndvg

Description

@victorsndvg

Hi Stefano,

we believe that we detected a BUG in FLAP. It is related to the management of (not required) varying size command-line parameters with a specified default value. In particular, the BUG is revealed whenever no value is specified thorough the command line. The code snippet (see the gist link) reproduces the BUG. When executing the program with no arguments, then the following error from the runtime system is obtained (We used the Intel compiler version 15.0.2.):

forrtl: severe (408): fort: (7): Attempt to use pointer VAL when it is not associated with a target

Image PC Routine Line Source
test_flap 00000000005EBDD0 Unknown Unknown Unknown
test_flap 000000000046450D data_type_command 1086 Data_Type_Command_Line_Interface.F90
test_flap 000000000058AB72 data_type_command 3030 Data_Type_Command_Line_Interface.F90
test_flap 0000000000406072 MAIN__ 47 test_flap.f90
test_flap 000000000040439E Unknown Unknown Unknown
libc.so.6 00007F0BC952C76D Unknown Unknown Unknown
test_flap 0000000000404289 Unknown Unknown Unknown

You can find the test program we have used in the following gist link:
https://gist.github.com/victorsndvg/39b86ab888fec8d27bbd#file-test_flap_varying_size-f90

I think that the problem is that cla%val is not allocated at the following line:
https://github.com/szaghi/FLAP/blob/master/src/Data_Type_Command_Line_Interface.F90#L1093

A workaround that we are using is to add:

if (present(def )) cla%val = def

inside the add subroutine at the following line:
https://github.com/szaghi/FLAP/blob/master/src/Data_Type_Command_Line_Interface.F90#L2317

What do you think?

Best regards,
Víctor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions