Re: [R] Mysterious seg fault --- SOLVED

2018-08-15 Thread Chris Evans
Ah, if I'd had a fortune for every time I invoked the wrath of the IT gods and 
the malicious work of their gremlins, I'd be an obscenely wealthy person by now.

More seriously, I can't tell you how much I appreciate the joyous flickers of 
humour here, amidst all the pain and suffering (yes, I may be projecting a bit 
here), and the welcome, vital, but often humiliating genius many contributors 
bring as it underlines how low my statistical and computing IQ is. 

I have Rolf as #1 for self-deprecating humour on r-help.  Keep rescuing my 
sense of humour on my gremlin-beset days please Rolf, all!

Chris

- Original Message -
> From: "Rolf Turner" 
> To: "Richard M. Heiberger" 
> Cc: r-help@r-project.org, "Achim Zeileis" , "peter 
> dalgaard" , "Henrik
> Bengtsson" 
> Sent: Wednesday, 15 August, 2018 04:58:32
> Subject: Re: [R] Mysterious seg fault --- SOLVED

> On 15/08/18 13:00, Richard M. Heiberger wrote:
>> There is no explanation other than gremlins and the malevolence that
>> the computer gods hold towards me.
>> 
>> fortune nomination.
> 
> I demur.  I already have a fortune with gremlins in it attributed to me
> (fortune(213)).
> 
> cheers,
> 
> Rolf
> 
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Mysterious seg fault --- SOLVED

2018-08-14 Thread Rolf Turner

On 15/08/18 13:00, Richard M. Heiberger wrote:

There is no explanation other than gremlins and the malevolence that
the computer gods hold towards me.

fortune nomination.


I demur.  I already have a fortune with gremlins in it attributed to me
(fortune(213)).

cheers,

Rolf

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

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Mysterious seg fault --- SOLVED

2018-08-14 Thread Richard M. Heiberger
There is no explanation other than gremlins and the malevolence that
the computer gods hold towards me.

fortune nomination.

On Tue, Aug 14, 2018 at 7:12 PM, Rolf Turner  wrote:
> On 14/08/18 23:01, peter dalgaard wrote:
>>
>> Hmm,
>>
>>> .Fortran(stats:::C_setsmu, as.integer(0))
>>
>> [[1]]
>> [1] 0
>>
>>> .Fortran(stats:::C_setsmu, as.integer(fumble))
>>
>> Error: object 'fumble' not found
>>>
>>> .Fortran(stats:::C_setsmu, fumble=as.integer(fumble))
>>
>> Error: object 'fumble' not found
>>>
>>> .Fortran(stats:::C_setsmu, nphi=as.integer(nphi))
>>
>> Error: object 'nphi' not found
>>
>> so I think we need an alternative hypothesis about what went wrong for
>> you...
>>
>> If nphi was NULL from the outset, that could explain things.
>
>
> No, I never set nphi to NULL.
>
> I put the code back to the way it was previously, just now, and tried again.
> Now I get "object 'nphi' not found".
>
> There is no explanation other than gremlins and the malevolence that the
> computer gods hold towards me.
>
> cheers,
>
> Rolf
>
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Mysterious seg fault --- SOLVED

2018-08-14 Thread Rolf Turner

On 14/08/18 23:01, peter dalgaard wrote:

Hmm,


.Fortran(stats:::C_setsmu, as.integer(0))

[[1]]
[1] 0


.Fortran(stats:::C_setsmu, as.integer(fumble))

Error: object 'fumble' not found

.Fortran(stats:::C_setsmu, fumble=as.integer(fumble))

Error: object 'fumble' not found

.Fortran(stats:::C_setsmu, nphi=as.integer(nphi))

Error: object 'nphi' not found

so I think we need an alternative hypothesis about what went wrong for you...

If nphi was NULL from the outset, that could explain things.


No, I never set nphi to NULL.

I put the code back to the way it was previously, just now, and tried 
again. Now I get "object 'nphi' not found".


There is no explanation other than gremlins and the malevolence that the 
computer gods hold towards me.


cheers,

Rolf

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

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Mysterious seg fault --- SOLVED

2018-08-14 Thread peter dalgaard
Hmm, 

> .Fortran(stats:::C_setsmu, as.integer(0))
[[1]]
[1] 0

> .Fortran(stats:::C_setsmu, as.integer(fumble))
Error: object 'fumble' not found
> .Fortran(stats:::C_setsmu, fumble=as.integer(fumble))
Error: object 'fumble' not found
> .Fortran(stats:::C_setsmu, nphi=as.integer(nphi))
Error: object 'nphi' not found

so I think we need an alternative hypothesis about what went wrong for you... 

If nphi was NULL from the outset, that could explain things.

-pd


> On 14 Aug 2018, at 01:16 , Rolf Turner  wrote:
> 
> On 13/08/18 23:39, peter dalgaard wrote:
>> It's odd, possibly a bug, that you don't get
>> Error: object 'nphi' not found
>> but I can't offhand see where the evaluation of args to .C/.Fortran is 
>> supposed to take place.
> 
> If it is indeed a bug then it would be nice an it were fixed.  If that is 
> possible.  Way beyond my level of comprehension but.
> 
> cheers,
> 
> Rolf
> 
> -- 
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Mysterious seg fault --- SOLVED

2018-08-13 Thread Rolf Turner

On 13/08/18 23:39, peter dalgaard wrote:

It's odd, possibly a bug, that you don't get

Error: object 'nphi' not found

but I can't offhand see where the evaluation of args to .C/.Fortran is supposed 
to take place.


If it is indeed a bug then it would be nice an it were fixed.  If that 
is possible.  Way beyond my level of comprehension but.


cheers,

Rolf

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

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Mysterious seg fault --- SOLVED

2018-08-13 Thread peter dalgaard
It's odd, possibly a bug, that you don't get 

Error: object 'nphi' not found

but I can't offhand see where the evaluation of args to .C/.Fortran is supposed 
to take place.

-pd

> On 13 Aug 2018, at 11:54 , Rolf Turner  wrote:
> 
> 
> On 13/08/18 20:45, Henrik Bengtsson wrote:
> 
>> On Mon, Aug 13, 2018 at 3:51 AM Rolf Turner  wrote:
>>> 
>>> 
>>> 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
>>> 
>>>  nphi=as.integer(nphi),
>>> 
>>> 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*!!!
>> Didn't R CMD check pick this up, that is, didn't it report that 'nphi'
>> is a "global" variable?
> 
> No it didn't.  The name only appears in the call to .Fortran().  I think if 
> it appeared in a call to an ordinary garden-variety R function then a warning 
> would have been issued.
> 
> Such a lapse would be hard for R CMD check to pick up.  E.g
> 
>   nphi=integer(1),
> 
> would be OK in a call to .Fortran (which would allow a value of nphi, 
> calculated within the called subroutine, to be *returned*) whereas
> 
>   nphi=as.integer(nphi),
> 
> causes trouble when nphi has never been defined (as I found out after a great 
> expenditure of time and torn-out hair).  In the former instance it doesn't 
> matter an FTCF whether nphi has been defined or not.
> 
> cheers,
> 
> Rolf
> 
> -- 
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Mysterious seg fault --- SOLVED

2018-08-13 Thread Rolf Turner



On 13/08/18 20:45, Henrik Bengtsson wrote:


On Mon, Aug 13, 2018 at 3:51 AM Rolf Turner  wrote:



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

  nphi=as.integer(nphi),

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*!!!


Didn't R CMD check pick this up, that is, didn't it report that 'nphi'
is a "global" variable?


No it didn't.  The name only appears in the call to .Fortran().  I think 
if it appeared in a call to an ordinary garden-variety R function then a 
warning would have been issued.


Such a lapse would be hard for R CMD check to pick up.  E.g

   nphi=integer(1),

would be OK in a call to .Fortran (which would allow a value of nphi, 
calculated within the called subroutine, to be *returned*) whereas


   nphi=as.integer(nphi),

causes trouble when nphi has never been defined (as I found out after a 
great expenditure of time and torn-out hair).  In the former instance it 
doesn't matter an FTCF whether nphi has been defined or not.


cheers,

Rolf

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

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Mysterious seg fault --- SOLVED

2018-08-13 Thread Henrik Bengtsson
On Mon, Aug 13, 2018 at 3:51 AM Rolf Turner  wrote:
>
>
> 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
>
>  nphi=as.integer(nphi),
>
> 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*!!!

Didn't R CMD check pick this up, that is, didn't it report that 'nphi'
is a "global" variable?

/Henrik

>
> 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
> sometimes.
>
> Anyhow, thanks to all those who took the time and made the effort to try
> to help me.
>
> cheers,
>
> Rolf
>
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Mysterious seg fault --- SOLVED

2018-08-12 Thread Rolf Turner



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

nphi=as.integer(nphi),

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 
sometimes.


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


cheers,

Rolf

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

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.