Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Potential BUG in FLAP (varying size parameters) #48

Closed
victorsndvg opened this issue Aug 19, 2015 · 2 comments
Closed

Potential BUG in FLAP (varying size parameters) #48

victorsndvg opened this issue Aug 19, 2015 · 2 comments
Labels

Comments

@victorsndvg
Copy link

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.

@szaghi
Copy link
Owner

szaghi commented Aug 19, 2015

Hi victor,
I am sorry, but I am out of office for 2 weeks, thus I cannot check the details of the bug. It seems really a bug and your patch is nice, please make a pull request thus I can easily accept it to fix the bug, with my smartphone/tablet I can only interact by means of github :-(

@szaghi
Copy link
Owner

szaghi commented Sep 11, 2015

Added the workaround.

@szaghi szaghi closed this as completed Sep 11, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants