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

Segfault in ./EIG/xeigtstz #335

Closed
Dichloromethane opened this issue Apr 19, 2019 · 11 comments · Fixed by #492
Closed

Segfault in ./EIG/xeigtstz #335

Dichloromethane opened this issue Apr 19, 2019 · 11 comments · Fixed by #492

Comments

@Dichloromethane
Copy link

Dichloromethane commented Apr 19, 2019

Hi,

this is with Lapack 3.8.0.

A segfault occurs in xeigtstz with lapack 3.8.0 and recent gfortran:

./EIG/xeigtstz < nep.in > znep.out 2>&1
/bin/sh: Zeile 1: 9026 Speicherzugriffsfehler (Speicherabzug geschrieben) ./EIG/xeigtstz < nep.in > znep.out 2>&1

This goes away when the stack limit is raised from the default of 8192 kb to 81920 kb (the
first value I tried).

@Dichloromethane
Copy link
Author

Seems to be a duplicate of #276 .

@martin-frbg
Copy link
Collaborator

martin-frbg commented Apr 19, 2019

gfortran9 flags an out-of-bounds access in (among others) TESTING/EIG/zhet21.f line 304 (do loop on J running from 1 to N-1, accessing array element U(1,J-1) ...ouch). Not sure if this is the actual and only cause of this issue yet though...
EDIT: my observation is unrelated (and I had actually missed that you already opened #333 for it) xeigtstz tries to allocate around 10MB on the stack for the NEP tests as already noted in OpenMathLib/OpenBLAS#1645

@pocket-98
Copy link

setting ulimit -s 16384 instead of the default 8192 fixed this issue for me as well

@weslleyspereira
Copy link
Collaborator

Same issue here #85.

@christoph-conrads
Copy link
Contributor

The go-to solution for this issue has been to increase the stack limit but since this is a test, would heap allocation not be a better solution?

@martin-frbg
Copy link
Collaborator

I believe it is allocatable arrays that end up on the stack due to the 'recursive' option (required for thread safety) but I have not yet managed to find a working solution.

@langou
Copy link
Contributor

langou commented Feb 17, 2021

@weslleyspereira will try to only compile zchkee.f without the -frecursive option. So all files (in particular liblapack.a) will be compiled using the -frecursive option, but zchkee.f will be compiled without the -frecursive option. We think/hope that'll do the trick. We will test. I think it is important to compile LAPACK with -frecursive. Now zchkee.f can be compiled without. That'll be just fine. CMake and make will look a little uglier. I think we are long overdue for a new test suite, so we suggest that we do it ugly for now, and focus on a new test suite.

@martin-frbg
Copy link
Collaborator

Worked for me as long as I did not also use OpenMP, but the latter unfortunately implies -frecursive
(Can use filter_out in Makefile to strip frecursive/Mrecursive from FFLAGS, so not much new uglyness)

@langou
Copy link
Contributor

langou commented Feb 17, 2021

Worked for me as long as I did not also use OpenMP, but the latter unfortunately implies -frecursive

Ah. Yes, that's a potential problem.

(Can use filter_out in Makefile to strip frecursive/Mrecursive from FFLAGS, so not much new uglyness)

Ah, good idea. No idea how the filter_out in Makefile works. Worse investigating. Thanks for the tip.

@martin-frbg
Copy link
Collaborator

martin-frbg commented Feb 17, 2021

TESTING/EIG/Makefile, after the include ../../make.inc add

FFLAGS := $(filter-out -frecursive -Mrecursive,$(FFLAGS))
FFLAGS_DRV := $(filter-out -frecursive -Mrecursive,$(FFLAGS_DRV))
LDFLAGS := $(filter-out -frecursive -Mrecursive,$(LDFLAGS))

for cmake it would be something like
string(REGEX REPLACE "-(fM)recursive" "" FFLAGS ${FFLAGS})
(untested)

@weslleyspereira
Copy link
Collaborator

Thanks @martin-frbg! I will test it now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants