I analyzed the differences between 3.2 and 3.1.1 and found out that if I replace dgeqr2 in 3.2 with one from 3.1.1, everything works. The only difference in dgeqr2.f is that 3.1.1 version calls dlarfG and 3.2 version calls dlarfP.

Of course I don't know what is the difference and what were the reasons for the change, but I would really appreciate if you could explain or even rethink the change. Perhaps dlarfp has some little little little flaws? Ok, ok, ok, I dared too much. (I am pretty unaware about this stuff).

I admit that in my both examples, the generalized eigenvalues don't have satisfactory condition numbers, and my second example has even very small angle between null spaces of the two matrices. But my experience so far (version 3.1.1 and earlier) was that the backward errors estimates implied by condition numbers were too pesimistic and the problems (economic models) were stable for small perturbations.

Dear Ondra, Yes, Julie came to the same conclusion as you this morning. She emailed it to me: "If we change the calls of DGEQR2 from DLARFP to the original DLARFG, then everything works fine." DLARFP has been introduced in 3.2.0 and we know it's buggy. And we are currently still debugging it. So yes we had big suspicion on this routine from the start. I have a slightly better version that Julie will try later today. There is still some problem. I might advocate to reverse all LAPACK to DLARFG until DLARFP works. I am thinking about this. Best wishes, Thanks a lot for all the work,You are the first user to really have been hit by a problem with this routine. Sorry about this.Julien.

I have been flying across many timezones recently and this problem was not helping me to fall asleep when I needed. Now having the problem pinned down, there is a chance I would be back on tracks also with my sleep.

The bug was indeed tricky. Guillaume Revy and Jim Demmel (UC Berkeley) spent a while tracking this down. I have committed their fix in the lapack repository (revision 735). Please check this out and let us know. Now everything works fine on our machine. Thanks a lot for the bug report. Best wishes, Julien.