I built an R-package with several Fortran subroutines back in 2012. Up to 2019 (or a bit earlier) I had no problem updating and running the package under an R session. The Fortran source has a lot of write and format. Prior to 2019, the output of these commands showed up nicely on the screen (RStudio or Rconsole), but after that the same commands break R (and RStudio) with R (3.6.3), clang (12.0.0) and gfortran (11.2.0) on macOS Catalina
> res=olsml65(model,x,y,10) [1] 0 Into Fortran code
nst = 2
leng = 1114
*** caught segfault ***
address 0x0, cause 'memory not mapped'
Traceback: 1: olsml65(model, x, y, 10)
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
If I use print instead of write and no format at all, the package runs smoothly.
Here is one line that breaks R:
write(6,999) j
999 format(' * (Process) terms of submodel',i2,' under regression *')
I could get rid of all writes but I wonder if there is a workaround.