From maechler at stat.math.ethz.ch  Thu Dec 11 18:29:05 2003
From: maechler at stat.math.ethz.ch (maechler@stat.math.ethz.ch)
Date: Thu Dec 11 18:27:40 2003
Subject: [Rd] Re: [R] chisq.test freezing on certain inputs (PR#5701)
Message-ID: <20031211172905.19744FC00@slim.kubism.ku.dk>

>>>>> "Torsten" == Torsten Hothorn <torsten@hothorn.de>
>>>>>     on Thu, 11 Dec 2003 18:03:07 +0100 (CET) writes:

    Torsten> On Thu, 11 Dec 2003, Jeffrey Chang wrote:
    >> Hello everybody,
    >> 
    >> I'm running R 1.8.1 on both Linux and OS X compiled with
    >> gcc 3.2.2 and 3.3, respectively.  The following call
    >> seems to freeze the interpreter on both systems: >
    >> chisq.test(matrix(c(233, 580104, 3776, 5786104), 2, 2),
    >> simulate.p.value=TRUE)
    >> 
    >> By freeze, I mean, the function call never returns
    >> (running > 10 hours so far), the process is unresponsive
    >> to SIGINT (but I call kill it with TERM), and the process
    >> still consumes cycles on the CPU.
    >> 

    Torsten> This is due to calling `exp' with a very small
    Torsten> value leading to a zero return value in rcont2
    Torsten> (src/appl/rcont.c) line 70:

yes, that's correct.  

Please, before anyone starts changing the code: 
I have had an version of rcont.c in my own code tree which 
uses much less goto's than the current official code.

I'd like to commit it (with an error message for the moment).
Martin


[Rd] Re: [R] chisq.test freezing on certain inputs (PR#5701)
maechler@stat.math.ethz.ch