Closed Yrisch closed 4 months ago
I found something while compiling with the flagfsanitize=address,undefined
. Something goes wrong in the ptmass_create
routine. I found a heap buffer overflow during the fxyz_ptmass_sinksink
initialisation ptmass.f90:1539
in this routine. If this line is commented, the code run smoothly...
It should be fixed with #548. I cleaned up a bit the routine and use another index to initialize the array. I'm not sure to understand completely why it works with this fix. However reusing nptmass
after changing its value in the middle of the routine sounds a bit risky to me. It could be dangerous if optimizations occur in this routine and change the order of the lines...
I found a bug with the cluster setup after the new integrator implementations. My initial cloud has a radius of 10 pc and a mass of 4.7e4 Msun. sink accretion radii are set to 4000 au. ( See attached .in and .setup files for more details ) It works with no issues during 231 dumps. It created 25 sinks smoothly. However, it crashed at the next dump with a SIGARBRT :
It points something about header allocation while writing dump.... It doesn't happen before subgroups and 4th order scheme pull requests... I checked every changes between the two versions but I did not see anything obvious. I tried on two different machines and it crashes the same way (with gfortran 13.2). The crash also happens while restarting from dump 230. I did not see any memory leak. I managed to avoid the crash by printing
maxphead
before callingallocate_header
inwrite_smalldump_fortran
routine. It seems to be a optimisation bug from the compiler...I attached the last full dump to reproduce the crash quickly.
attached files : https://drive.google.com/file/d/1PCILpt0xnt-cW7RNfoOPlgi8QnCNF1V2/view?usp=sharing