Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Version 3.9.0] Infinite loop in slasq3 #384

Closed
Peter9606 opened this issue Jan 21, 2020 · 7 comments
Closed

[Version 3.9.0] Infinite loop in slasq3 #384

Peter9606 opened this issue Jan 21, 2020 · 7 comments

Comments

@Peter9606
Copy link

When input parameters to "slasq3" follows below pattern:
i0 =3, n0=16, pp=1,desig=0.2f, qmax=0.2f, nfail=4,iter=1, ndiv = 2, ieee = 0, ttype = -1
this function falls into infinite loop in-between code line 332 ~ 362.
100% reproduce.

@martin-frbg
Copy link
Collaborator

Do you think this used to work in earlier versions ? AFAIK none of the slasq functions was modified since at least 3.7.0. From your description it is looping as TAU never gets small enough ?

@Peter9606
Copy link
Author

Do you think this used to work in earlier versions ? AFAIK none of the slasq functions was modified since at least 3.7.0. From your description it is looping as TAU never gets small enough ?

Sorry, I only verified on 3.9.0 so far for this is the only version at hand.

@martin-frbg
Copy link
Collaborator

martin-frbg commented Feb 1, 2020

Would you happen to have a complete reproducer for this, in particular with the values contained in the array z ? I cannot reproduce the problem with the data you provided and a random z, and I imagine bad things will happen if not even when any of the array elements is a NaN.

@mu578
Copy link

mu578 commented Feb 2, 2020

if dmin is nan it should be set to some legit erroneous value; would prevent infinity.

@martin-frbg
Copy link
Collaborator

I thought about this as well, but if I am correct about the rules for comparing against NaN this is probably not the problem.

@weslleyspereira
Copy link
Collaborator

No infinite loop using 4b3c7c2 to build the code:

      PROGRAM testSLASQ3
      IMPLICIT NONE

*     .. Scalar Arguments ..
      LOGICAL            IEEE
      INTEGER            I0, ITER, N0, NDIV, NFAIL, PP, TTYPE
      REAL               DESIG, DMIN, DMIN1, DMIN2, DN, DN1, DN2, G,
     &                   QMAX, SIGMA, TAU
*     .. Array Arguments ..
      REAL               Z( 64 )
*     .. Subroutines ..
      EXTERNAL           SLASQ3
      
      PARAMETER ( IEEE=.FALSE. )
      PARAMETER ( I0 = 3 )
      PARAMETER ( QMAX = 1.0 )

      ITER=1
      N0=16
      NDIV=2
      NFAIL=4
      PP=1
      TTYPE=-1
      DESIG=0.2
      DMIN1=0.1
      DMIN2=0.1
      DN=1.0
      DN1=1.0
      DN2=1.0
      G=1.0
      TAU=1.0

      Z = (/0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,
     &      0.1,0.2,0.3,0.4,0.5,0.6,
     &      0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,
     &      0.1,0.2,0.3,0.4,0.5,0.6,
     &      0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,
     &      0.1,0.2,0.3,0.4,0.5,0.6,
     &      0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,
     &      0.1,0.2,0.3,0.4,0.5,0.6/)
     
      CALL SLASQ3( I0, N0, Z, PP, DMIN, SIGMA, DESIG, QMAX, NFAIL,
     &                   ITER, NDIV, IEEE, TTYPE, DMIN1, DMIN2, DN, DN1,
     &                   DN2, G, TAU )

      END PROGRAM testSLASQ3

@langou
Copy link
Contributor

langou commented Apr 22, 2021

Based on @weslleyspereira post, let us close this issue then.
@Peter9606 thanks for reporting the issue, if the issue comes back, please come back to us.
Julien.

@langou langou closed this as completed Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants