emacs-ess / ESS

Emacs Speaks Statistics: ESS
https://ess.r-project.org/
GNU General Public License v3.0
620 stars 162 forks source link

ESS crashes Mac OS X when quitting #36

Closed mok0 closed 8 years ago

mok0 commented 11 years ago

My MacBook runs OS X Mountain Lion 10.8.2. I installed ESS version 12.09-2 from the tar file in the download area.

I can run a ESS session just fine, but when I exit Emacs and confirming that the R process should be killed, the screen immediately becomes grey and the computer reboots.

I have experienced this every time I have used ESS, but not since I realized that ESS was the reason for the reboot.

vspinu commented 11 years ago

Something is going wrong with killing the process. This is emacs related issue. Try to reinstall/upgrade your emacs.

dpolhamus commented 11 years ago

I'm having identical behavior. I updated to emacs 24.3 (homebrew) and the developmental ess (github and compiled) and the problem continues.

mok0 commented 11 years ago

I'm having identical behavior. I updated to emacs 24.3 (homebrew) and the developmental ess (github and compiled) and the problem continues.

My version of emacs is from Fink; it is package emacs23-nox-23.4-1.

dpolhamus commented 11 years ago

I should add that this only happens when I run in the terminal. When I use the GUI, there is no kernel panic.

On Tue, Apr 2, 2013 at 2:13 PM, Morten Kjeldgaard notifications@github.comwrote:

I'm having identical behavior. I updated to emacs 24.3 (homebrew) and the developmental ess (github and compiled) and the problem continues.

My version of emacs is from Fink; it is package emacs23-nox-23.4-1.

— Reply to this email directly or view it on GitHubhttps://github.com/emacs-ess/ESS/issues/36#issuecomment-15792553 .

Daniel G Polhamus, PhD Metrum Research Group, LLC 2 Tunxis Rd, Suite 112 Tariffville, CT 06081 (888) 308-7049 ext 403

vspinu commented 11 years ago

Does it happen with other process buffers? LIke shell?

Also does it happen when you simply kill R buffer? Either with C-c q or C-x k?

mok0 commented 11 years ago

On 02/04/2013, at 20:20, Vitalie Spinu notifications@github.com wrote:

Does it happen with other process buffers? LIke shell?

Also does it happen when you simply kill R buffer? Either with C-c q or C-x k?

When I kill the buffer using C-x k, Emacs works as expected. However, if I start an R shell, and then kill Emacs using C-x C-c, it first asks "Do you want to kill a running process?" and when I type "yes" and hit return, the Mac crashes. I just did that, and when the Mac came back, it noticed that an error had recurred, and offered me the attached error report. Not sure it will be of any use to you.

Will try C-c q now. Not too happy to continuously crash my computer though, I am afraid to damage the file system… :-(

Cheers, Morten

mok0 commented 11 years ago

On 02/04/2013, at 20:20, Vitalie Spinu notifications@github.com wrote:

Does it happen with other process buffers? LIke shell?

Also does it happen when you simply kill R buffer? Either with C-c q or C-x k?

Hi Vatalie,

Just tried to end the R process using C-x C-q, and it seems to work as intended:

options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient', show.error.loca\ tions=TRUE) Save workspace image? [y/n/c]: y

Process R finished at Tue Apr 2 20:41:30 2013

You will notice that the environment says "emacsclient". I don't actually know where that comes from, or if it is relevant to the problem. I don't actually use emacsclient, as it seems to be more trouble than it's worth, given the speed with which Emacs starts up.

Cheers Morten

vspinu commented 11 years ago

This looks like serious emacs bug to me. If you can kill R buffer with C-x k or end the process with C-c q then you should of course do that before C-x C-c to avoid the crash.

You can try to repost this issue on ess-help mailing list. May be someone experienced this problem before. We have discussed it on ess-core and nobody has any clue. Most of us are not on Mac.

Afterwards you probably should go directly to emacs-dev mailing list. They will suggest how to debug this issue.

Vitalie
vspinu commented 11 years ago

You can also try running some other subprocess, like M-x run-python or M-x shell. Then C-x C-c and see if they also crash.

Our ESS handling of the R subprocess is pretty standard. The behavior should not be different from others.

dpolhamus commented 11 years ago

M-x shell and then C-x C-c does not crash for me.

On Tue, Apr 2, 2013 at 3:00 PM, Vitalie Spinu notifications@github.comwrote:

You can also try running some other subprocess, like M-x run-python or M-x shell. Then C-x C-c and see if they also crash.

Our ESS handling of the R subprocess is pretty standard. The behavior should not be different from others.

— Reply to this email directly or view it on GitHubhttps://github.com/emacs-ess/ESS/issues/36#issuecomment-15795403 .

Daniel G Polhamus, PhD Metrum Research Group, LLC 2 Tunxis Rd, Suite 112 Tariffville, CT 06081 (888) 308-7049 ext 403

vspinu commented 11 years ago

Have you figured out this crashing problem?

ghost commented 11 years ago

I am experiencing this problem as well. Killing python or shell with C-x C-c works fine. The same issue happens when using Aquamacs from the terminal also. I guess, for the time being, the solution is to always remember to C-x k R first then close emacs... or use emacs/aquamacs in gui mode which is also not preferable

kheffernan commented 10 years ago

I just downloaded the latest version of ESS (13.09) and this problem is still persisting (with emacs 24.3.2 in terminal window) Is there any other solution apart from C-x k R?

mmuurr commented 10 years ago

this is still an active bug... i'm also getting this kernel panic/restart issue, this time with 10.8.5. i first encountered it while running emacs 24.3.1 built via MacPorts. i've since found it also occurs with emacs 23.4.1 (also built via MacPorts) and emacs 24.3.1 built by myself.

it ONLY occurs when quitting emacs while an R session is running in a buffer. if you run R within an emacs shell buffer, you can quit emacs and it's fine. and if you terminate the R session (via q()) within the R buffer, it's fine. and if you simply kill the R buffer (even while the R session is running), it's fine.

this last observation makes for an easy-enough workaround where you can put a hook in to the emacs quitting command (C-x C-c) to first kill any R buffers. but nevertheless this bug is nasty.

this bug has manifested itself with other emacs packages, too (e.g. see https://github.com/tkf/emacs-jedi/issues/37).

DarwinAwardWinner commented 10 years ago

I would support adding a "kill R buffers before quitting" hook to work around the bug.

mmuurr commented 10 years ago

yeah that hook should help, but just today i encountered a similar kernel panic while quitting emacs that had just an emacs shell running. in fact, there was no executing job at the moment, nor any in the background, just a waiting shell.

BTW -- i can't reproduce the problem when using emacs.app (or emacs-app, or however people refer to it). it sucks, because i'm much more comfortable bouncing around terminal windows/tabs... but from now on while on the OS X 10.8 machines i'm going to have to stick with the "app" version. for any emacs gurus who might go looking for this bug, comparing those two sources might be a good start, since emacs.app seems to safely kill child (where emacs is the parent) processes.

perhaps 10.9 doesn't share this bug? (i obviously haven't upgraded to it yet.)

mrgordon commented 10 years ago

Still getting this on 10.8 with emacs 24.3.1 and latest ESS

mcheema commented 10 years ago

Just for the record I use ESS 13-09 with emacs 24.3 on Mavericks, and have not had this crash bug.

dwisehart commented 8 years ago

Almost two years later, I think this issue has been resolved. I have not seen it from Mac OS-X El Capitan 10.11.2 (and previous), Emacs 24.5.1 and the latest ESS.

vspinu commented 8 years ago

Thanks for letting us know. It's little we can do on ESS side anyways.