[R] Mysterious seg fault --- SOLVED

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Mon Aug 13 03:51:24 CEST 2018

OK everybody!  You can relax.  :-) I managed to spot the loony.  After 
mucking around with valgrind, and before trying gdb, I had one more look 
at my code and *finally* saw the stupid thing that I had been doing.

In the call to .Fortran() I had a line


but "nphi" was nowhere defined (!!!) in the R code.  The name "nphi" 
appeared as an argument in the Fortran subroutine in question, but was 
nowhere actually *used*!!!

It seems that passing a non-existent value as an argument to a Fortran 
subroutine can *sometimes* confuse it.  Understandably.

I think that this "nphi" was a left-over from an earlier version of the 
code.  I must have changed the code so that nphi was no longer needed, 
but then forgot to remove it from some places.  Psigh!  I hate myself 

Anyhow, thanks to all those who took the time and made the effort to try 
to help me.



Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

More information about the R-help mailing list