jameskermode/f90wrap

Incorrect handling of failure for derived type instantiation

Opened this issue · 1 comments

github.zip

On MacOS (Big Sur 11.2.1, with package list below, Python 3.9.1), I tried instantiating multiply nested arrays of derived types. Beyond a certain array size for one of the types, instantiation throws an error (edit: segfault). More details below, code attached.

To trigger the error, set
nfc = 20
(instead of 10) in common/src/bemt/Source/pyint_modules/precision.F90

Compile as follows (assuming you start at the main folder after unzipping)

  1. cd cmake; mkdir build; cd build
  2. FC=gfortran cmake ../../ && make -j

Run with
python3 driver.py in main folder

I've currently set my stack size limit with ulimit -s 65530 (cannot be unlimited on Mac, as far as I know)
Package versions:
Package Version


-umpy 1.20.0
amqp 5.0.2
billiard 3.6.3.0
click 7.1.2
click-didyoumean 0.0.3
click-plugins 1.1.1
click-repl 0.1.6
cycler 0.10.0
f90wrap 0.2.3
kiwisolver 1.3.1
kombu 5.0.2
matplotlib 3.3.4
mpi4py 3.0.3
numpy 1.20.0
pandas 1.2.1
Pillow 8.1.0
pip 21.0.1
prompt-toolkit 3.0.10
pyDOE 0.3.8
pyparsing 2.4.7
PyQt5-sip 4.19.24
python-dateutil 2.8.1
pytz 2020.5
PyYAML 5.4.1
scipy 1.6.0
setuptools 51.1.1
six 1.15.0
TBB 0.1
vine 5.0.0
wcwidth 0.2.5
wheel 0.36.2

Thanks for reporting. However, this is a huge amount of code. Please can you try to cut down to a minimal example which shows the problem? A single short fortran code + Python script would be ideal.