I have a hung session I would very much like to recover, since it has some simulation results I haven't saved (that took about 12 hours to create). Yes, I know, I should have saved while I had the chance. I tried to do a hist() in an environment without a plotting device. My R session now seems to be hung; ^C doesn't do anything. I thought it would timeout, but it has not so far. The details of this session's environment are a bit baroque. In case it matters, here they are: Running an xterm locally, used the "screen" program to start a shell. Ran R. Then, from a remote computer, used ssh to log in (without X forwarding enabled). Grabbed the session by doing screen -d -r. (screen lets you trade the controlling tty of a session; that's why I was using it). After detaching and reattaching the session a couple of times (still remote) I did> hist(tres4$singles[["a"]])tres4$singles is a dataframe. I can still type on the terminal, but get no response. R 1.7.1 on Debian. Is there any way to get the R session back without killing it? Thanks.
Can you use save.image() to rescue your results? I would try save.image(file="salvage.RData") and see if the file appears. Otherwise I would say you're probably out of luck. On Mon, 29 Sep 2003, Ross Boylan wrote:> I have a hung session I would very much like to recover, since it has > some simulation results I haven't saved (that took about 12 hours to > create). Yes, I know, I should have saved while I had the chance. > > I tried to do a hist() in an environment without a plotting device. > My R session now seems to be hung; ^C doesn't do anything. I thought > it would timeout, but it has not so far. > > The details of this session's environment are a bit baroque. In case > it matters, here they are: > Running an xterm locally, used the "screen" program to start a shell. > Ran R. > Then, from a remote computer, used ssh to log in (without X forwarding > enabled). Grabbed the session by doing screen -d -r. (screen lets > you trade the controlling tty of a session; that's why I was using > it). > > After detaching and reattaching the session a couple of times (still > remote) I did > > hist(tres4$singles[["a"]]) > tres4$singles is a dataframe. > I can still type on the terminal, but get no response. > > R 1.7.1 on Debian. > > Is there any way to get the R session back without killing it? > > Thanks. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.math.ethz.ch/mailman/listinfo/r-help >-- 620B Bartram Hall bolker at zoo.ufl.edu Zoology Department, University of Florida zoo.ufl.edu/bolker Box 118525 (ph) 352-392-5697 Gainesville, FL 32611-8525 (fax) 352-392-3704
On Mon, 29 Sep 2003, Ross Boylan wrote:> I have a hung session I would very much like to recover, since it has > some simulation results I haven't saved (that took about 12 hours to > create). Yes, I know, I should have saved while I had the chance. > > I tried to do a hist() in an environment without a plotting device. > My R session now seems to be hung; ^C doesn't do anything. I thought > it would timeout, but it has not so far.You may be able to send SIGUSR1 to the process, which tells it to quit and save, or SIGUSR2, which is quit and save without running .Last and .on.exit stuff. It depends on how badly it is wedged. -thomas
Thanks to everyone for your help. I decided to see if the session could be recovered if I connected back from the original, local terminal. The local screen was locked by the KDE screensaver. Either my unlocking it, or the passage of time, seems to have got the process unstuck. It happened before I reattached to the screen session from a local terminal. Whew!