Skip to content

hang on use of ESC in R 2.6.2

11 messages · Ken Knoblauch, Simon Urbanek, John Maindonald +4 more

#
Hi,

I notice with R 2.6.2 on a powerpc and on a MacBook Pro that if I hit ESC to
annul running a line in the GUI, input hangs with the spinning beach ball
for an indefinite period of time.  I haven't tried to see how long it will
hang, but
it is at least several minutes too long.  Checking Force Quit indicates that
R is not responding.

On the power pc, w/ Tiger (but the same thing happens on my Intel Mac w/
Leopard)
sessionInfo()
R version 2.6.2 (2008-02-08)
powerpc-apple-darwin8.10.1

locale:
en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base


Thanks.

best,

Ken
1 day later
#
[I have replied privately, but here is the relevant part of the  
response for the list:]

If R is stuck in a long computation in C code that doesn't call  
R_ProcessEvents, we're helpless. There is no way to stop that code  
until it finishes. Even if you press <Esc> it may not help (just give  
you the beachball), because the event of you pressing <Esc> must first  
be processed so it can fire, but if R is already somewhere in a C  
code, so it will never get processed, hence the beachball (on OS X the  
beachball means that the application doesn't process events for some  
time).

Now, you can debug this if you desire so to find out what R is doing.  
To do so, start a Terminal (in parallel to your unresponsive R) and  
type:
gdb
attach R

That should get you into the R process that is spinning. Now you can  
issue
bt
to see where it really is. Very likely it will be somewhere is the  
package performing the computation. But if it's not, then we want to  
know.

Anyway, I suspect that this is not really something we can do much  
about (in the current GUI). The new GUI 2.0 is running R in a separate  
thread, so it is always responsive despite R being busy, hence we can  
deal better with unresponsive R there.

Cheers,
Simon
On Feb 10, 2008, at 10:53 AM, Ken Knoblauch wrote:

            
#
Command :

rnorm(10000)
then I press <Esc>

reproduced the problem. It's not link to the computational time.

Best regards, C.

~~

Mac Intel - OS 10.5.1 / 10.5.2

 > sessionInfo()
R version 2.6.2 (2008-02-08)
i386-apple-darwin8.10.1

locale:
fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
#
Will it be possible for ESS to do the same?  I guess this is more general
than Mac, but it seems worth asking here at this point.
John Maindonald
#
Will it be possible for ESS to do the same?  I guess this is more general
than Mac, but it seems worth asking here at this point.
John Maindonald
#
ESS can always do that because it's running in a separate process and  
hence has a separate event loop.

Cheers,
Simon
On Feb 12, 2008, at 3:11 PM, John Maindonald wrote:

            
#
Charles,

thanks a lot for the example. I have now fixed this issue in the  
current GUI. Please download and test the updated GUI tomorrow from
http://r.research.att.com/

Thanks,
Simon
On Feb 12, 2008, at 10:43 AM, Charles Hebert wrote:

            
#
The way to get control over ESS if you are stuck in a big loop is to do
   C-g
Then R will run happily and you can continue writing in other  
buffers. You will not be able to stop the process short of actually  
killing R - if you do for example
   C-c C-c
which sends an interrupt, R will not process it - the same  
explanation holds true as for the GUI stuff.

Kasper
On Feb 12, 2008, at 12:11 PM, John Maindonald wrote:

            
#
R runs in other threads now? Does it actually do it or did you have to
resort to turning off the C stack protection stuff that just goes
insane when you try to initialize it in a second thread?
On Feb 12, 2008 6:29 AM, Simon Urbanek <simon.urbanek at r-project.org> wrote:

  
    
#
Simon

I downloaded the  nightly builded R-GUI as you mentioned
and i still hangs when I try
the example of Charles
Is there any solution about this problem?

Regards

Christoph


Am 12.02.2008 um 21:47 schrieb Simon Urbanek:
#
Hi,

I'm using this version : R GUI 1.24-devel (4944)

Works well.

Thanks !

Charles

Le 13 f?vr. 08 ? 08:59, Christoph Hofer a ?crit :
--
Charles H?bert

Charles Hebert
Genome Organisation and Dynamics,
Regulation of Genetic Expression Lab, CNRS UMR 8541,
?cole Normale Sup?rieure,
46 rue d'Ulm, 75005 Paris, France.