Skip to content

Segfault in ./EIG/xeigtstz #335

Closed

Description

@Dichloromethane

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

Activity

  1. Dichloromethane commented on Apr 19, 2019

    @Dichloromethane
    Author

    Seems to be a duplicate of #276 .

  2. martin-frbg commented on Apr 19, 2019

    @martin-frbg
    Collaborator

    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

  3. pocket-98 commented on Jun 23, 2020

    @pocket-98

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

  4. weslleyspereira commented on Feb 17, 2021

    @weslleyspereira
    Collaborator

    Same issue here #85.

  5. christoph-conrads commented on Feb 17, 2021

    @christoph-conrads
    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?

  6. martin-frbg commented on Feb 17, 2021

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

  7. langou commented on Feb 17, 2021

    @langou
    Contributor

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

  8. martin-frbg commented on Feb 17, 2021

    @martin-frbg
    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)

  9. langou commented on Feb 17, 2021

    @langou
    Contributor

    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.

  10. martin-frbg commented on Feb 17, 2021

    @martin-frbg
    Collaborator

    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)

  11. weslleyspereira commented on Feb 17, 2021

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions