Lapack: Segfault in ./EIG/xeigtstz

Created on 19 Apr 2019  ·  11Comments  ·  Source: Reference-LAPACK/lapack

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).

Build System Testing

All 11 comments

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 https://github.com/xianyi/OpenBLAS/issues/1645

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

Same issue here #85.

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?

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.

@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.

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)

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.

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)

Thanks @martin-frbg! I will test it now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

christoph-conrads picture christoph-conrads  ·  26Comments

nboelter picture nboelter  ·  3Comments

Peter9606 picture Peter9606  ·  7Comments

miroi picture miroi  ·  10Comments

JHenneberg picture JHenneberg  ·  10Comments