Page 1 of 1

error code (info) problem in dsy*.f

PostPosted: Tue Dec 25, 2012 2:39 pm
by malxyz2
dsyevx.f line 505
IF( INFO.EQ.0 ) THEN
IMAX = M
ELSE
IMAX = INFO - 1
END IF
IMAX should not be set to INFO.
It is always = M

Also the call to CALL DSTEIN may clobber info.

dsygvx.f:418
IF( INFO.GT.0 )
$ M = INFO - 1
M is set properly in DSYEVX no need to do this

dsyevr.f:590 No need to set M=N, it should be set by DSTEBZ
IF( INFO.EQ.0 ) THEN
* Everything worked. Skip DSTEBZ/DSTEIN. IWORK(:) are
* undefined.
M = N
dsyevr.f:633
IF( INFO.EQ.0 ) THEN
IMAX = M
ELSE
IMAX = INFO - 1
END IF
also incorrect IMAX & INFO

there are many similar places in Lapack

Re: error code (info) problem in dsy*.f

PostPosted: Fri Dec 28, 2012 7:08 am
by malxyz2
I cannot post more details, I just get
"This message was flagged as spam and has been denied."

Re: error code (info) problem in dsy*.f

PostPosted: Fri Dec 28, 2012 7:09 am
by malxyz2
Trying to bypass spam filter

I would like to emphasize that using error code (info)
as array index in .f examples mentioned above (there are also other places doing this)
is conceptually wrong.
The error code may change its value during program modifications,
may have negative value etc.
You cannot use error code as array index. Especially without limit checks.
There is a clear error in dsyevr.f 636

IF( ISCALE.EQ.1 ) THEN
IF( INFO.EQ.0 ) THEN
IMAX = M
ELSE
IMAX = INFO - 1
END IF

because INFO can be clobbered in
dsyevr.f 614 CALL DSTEIN( N, WORK( INDD ), WORK( INDE ), M, W,....INFO)

Other places are also potentially erroneous. Some of them buggy.
Anyway using error code (INFO) as array index is just plain conceptually wrong.

PostPosted: Fri Dec 28, 2012 7:10 am
by malxyz2
- -

spam filter

PostPosted: Fri Dec 28, 2012 7:12 am
by malxyz2
By the way. Your board spam filter reacts on dsyevr.f:614
replacing ":" by space allowed to bypass it.
Can you also fix that.

Re: error code (info) problem in dsy*.f

PostPosted: Fri Dec 28, 2012 12:06 pm
by admin
dsyevr.f:614

Re: error code (info) problem in dsy*.f

PostPosted: Sat Dec 29, 2012 12:12 am
by admin
Word test: dsyevr.f:614

Re: error code (info) problem in dsy*.f

PostPosted: Sat Dec 29, 2012 11:41 am
by malxyz2
very strange. I took my original post
viewtopic.php?f=13&t=4208#p10081
and replaced there
dsyevr.f 636 -> dsyevr.f:636
dsyevr.f 614 -> dsyevr.f:614
before the board report my post as a spam.
No such message happened now.

Anyway, this spam issue is minor.
Can you look at the problem of using error code
as array index. This may lead to serious memory corruption issues.