?TGSEN use of array SELECT on workspace query may SEGV

Post here if you want to report a bug to the LAPACK team

?TGSEN use of array SELECT on workspace query may SEGV

Postby dbakshee » Tue Feb 09, 2016 4:55 am

The following workspace query fails with memory access error:

call ZGGES3(JOBVSL='N', JOBVSR='N', SORT='S', ..., LWORK=-1, ..., BWORK=NULL )

According to documentation, it is not correct to pass BWORK=NULL while SORT='S', ... but this is just a workspace query.
The subroutine passes BWORK down in

call ZTGSEN( IJOB=0, ..., SELECT=BWORK, ..., LWORK=-1, ... )

and that routine causes memory error reading SELECT(K) when it sets M to the dimension of the specified pair of deflating subspaces. Since IJOB=0 and this is workspace query, the computed M is not used anyway, so it would be safe to not refer to SELECT(K) when IJOB=0. Maybe, it would also be good to not refer to SELECT on workspace query, and evaluate LWMIN to N*N ( instead of 2*M*(N-M) ) regardless of IJOB? I would adjust the workspace query (computation of LWMIN and LIWMIN) in ZTGSEN so that it not reference SELECT for IJOB=0.

Also, if ZTGSEN uses SELECT=BWORK for workspace query, then ZGGES3 should initialize BWORK before passing it to ZTGSEN for workspace query.

What do you think about this?
Proposed patch
(2.34 KiB) Downloaded 68 times
Posts: 9
Joined: Fri Sep 18, 2015 5:44 am

Re: ?TGSEN use of array SELECT on workspace query may SEGV

Postby admin » Wed Feb 10, 2016 11:02 pm

Dear Dmitry,
yes indeed, your patch makes sense.
Patch committed in revision 1687 on our SVN Repository
Site Admin
Posts: 614
Joined: Wed Dec 08, 2004 7:07 pm

Return to Bug report

Who is online

Users browsing this forum: No registered users and 2 guests