MESAHub / mesa

Modules for Experiments in Stellar Astrophysics
http://mesastar.org
GNU Lesser General Public License v2.1
145 stars 39 forks source link

Out of bounds access to xscale in irradiated_planet #103

Closed rjfarmer closed 4 years ago

rjfarmer commented 4 years ago

irradiated_planet (turn on bounds checking by adding -fbounds-check to FCBasic) then after its finished relaxing the irradiation

At line 3084 of file ../private/star_utils.f90
Fortran runtime error: Index '443' of dimension 2 of array 'xscale' above upper bound of 442

Error termination. Backtrace:
#0  0x44e282 in __star_utils_MOD_ep1
    at ../private/star_utils.f90:3084
#1  0xa76f1e in __hydro_energy_MOD_do1_energy_eqn
    at ../private/hydro_energy.f90:72
#2  0xa4b643 in __hydro_eqns_MOD_eval_equ_for_solver._omp_fn.0
    at ../private/hydro_eqns.f90:346
#3  0x7f5fb1e16cf5 in gomp_thread_start
    at /home/user/sdk2-tmp/build/gcc/libgomp/team.c:123
#4  0x7f5fb1985431 in start_thread
    at /usr/src/debug/glibc-2.31-48-g64246fccaf/nptl/pthread_create.c:477
#5  0x7f5fb18b3912 in ???
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
#6  0xffffffffffffffff in ???
DATE: 2020-11-01
TIME: 12:01:13

Line 3084 is in ep1():

s% ublk(i,j,k) = s% ublk(i,j,k) + v*xscale(j,k+1)
jschwab commented 4 years ago

Looked like this could have been a generic issue. Should be fixed in r14773, assuming I understood what was happening.

rjfarmer commented 4 years ago

Fixed