jorgenschaefer / elpy

Emacs Python Development Environment
GNU General Public License v3.0
1.9k stars 261 forks source link

100% CPU Utilization #96

Closed georgevreilly closed 10 years ago

georgevreilly commented 11 years ago

When I move around in the dir2pi() function in libpip2pi/commands.py of pip2pi, I reliably get 100% CPU utilization. Elpy 1.0 on Emacs 24.3.1 on OS X 10.7

I set debug-on-quit and got the traceback below. It's gzipped, then base64-encoded. Sorry, but when I pasted the raw text in, Github Issues failed to save it—undoubtedly because of the 29,000-character lines. And there's no way to attach an arbitrary file.

H4sICHSdslEAA2VscHktdHJhY2ViYWNrLnR4dADtXV1z48aVzWPirdr3/Xhoy5kS
GYsc4pvUWt51OU7i2t3Y5Ux2azOa0lAUJDHDrwXAkeSH/e17TgMkgW4QQA9f8tCT
zPXo8p6L/rx9u9Hi+eyz9+/ff/bb+Hb78BAnIl5lcRLfDQb/MU83Ik6SdXIpev+7
nWf9z4SIF5uXQbKZDQZJPIvnH+PBYr6Ke/Uf/TVdr6ofzaaLRe/sIc5u+K9svjkT
Z6+3afJ6sYbidfWnxfz29eYle1yv3GH0Op1n8WAznX2YPsQpP9vMN+5m/nq2Xi6n
q7t0uHk5E1/0zubLzTrJxDq9XhX/TF9K/37cZvPF/sdpFj/Ps/2PP8839/NFvP85
i5eq4jl7Sqab69V9sl6KdHu7SdazOE1FYTB7jGcfZOWuV9eru/he3MV3aNIekf3L
65XAnyTOtslq72xYMhku0iyZb3rXZ9dwcNbv79ywGDfZ+qZogR5/vhC30zS+mydX
f1yv4p13QPE/8ZN8SCqyx1gUILGaLmNxv07EVDygg1bS65CPEMWfr7/+WnvU9dn9
ej1whu7Qu0lmzjCbJsOHn1G4A6x3DpPzC3EurQYHq/N+F9+300T6z+rc8tOd60z3
mFc316WbxTwTV3m1EvkTnjC4PrsQTgGb34tFvOrJz/ri8yvhXh78LdMHoK/Ptqv4
eRPPsvhOupLtdileJfhIvCqavl+FfUlcb7XOxHwlzjcfHgYEDT7GSTpfr4bPz8/n
bPnlNNsVtihN0YW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tp8pAW/VL6DAOJVcj174Sf9wY/ld9CrDwaj7tfy06Rz+i1WLI0Sg8m
aEPnlxDuHyi9P7ADnFGf6qJds/kyTopKBCIsCiW1g/gjH/E45Vf4J723mRjhf8GI
f0TWVnDZOHMgxehd/7P/B4Nz2ogmWQEA
jorgenschaefer commented 11 years ago

Just like good old usenet! :-D Thank you for the bug report.

The traceback says that Elpy is trying to get a calltip, and then the backend hangs.

Which backend are you using? (Rope, Jedi, native) Also, which version of Python? (2.x, 3.x)

georgevreilly commented 11 years ago

I have

jedi==0.5b5
rope==0.9.4
elpy==1.0.1

according to pip freeze. I have no explicit elpy initialization in ~/.emacs.d/init.el beyond (package-initialize) and (elpy-enable)

I'm running Python 2.7.4, as installed by brew

jorgenschaefer commented 11 years ago

Ok, if you haven't changed anything, then M-: (elpy-rpc-get-backend) should return "rope".

What's your project root set to (M-: (elpy-project-root))? Is the the root directory of the git repository of pip2pi? Or are there other files/directories/anything in there?

I tried to reproduce this problem, but it seems to simply work for me.

georgevreilly commented 11 years ago
  1. "rope"
  2. "~/src/pip2pi"

Now I can't reproduce it either, though it repro'd several times last night. I even restarted Emacs a couple of times last night, since I thought at first it might be Evil but I disabled that, and it continued to happen. I reverted commands.py to the version that caused me problems last night, but it still doesn't repro.

If it happens again, I'll report it. If it does happen, is there other data that I should gather?

jorgenschaefer commented 11 years ago

Do check the project root again to make sure it didn't get confused about that.

You can check with ps xar or top which process it is that causes CPU consumption (should be the python process).

You can use strace -p <pid> to see what the python process is doing (most likely, nothing, as that only shows syscalls and it will probably be in an infinite loop in Rope somewhere; but maybe it got confused about the project root and is indexing your home directory for possible Python files …)

If it's not doing anything in that trace, you can also use strace -p <pid> -o foo.txt before reproducing the bug, and then post the trace output here. That might give some hint on what it was doing.

That's all very much stabbing in the dark, though. I wish there was a simple way to hook into a running Python process to get some idea on what it was doing when it did hang. :-|

georgevreilly commented 11 years ago

It repro'd a couple of times in the last half hour. https://gist.github.com/georgevreilly/5745407 has samples from both Emacs.app and the child Python process.

jorgenschaefer commented 11 years ago

That's strace output on OS X? Fascinating :-D

As Python is stuck in PyEval_EvalFrameEx, I suspect it's indeed stuck evaluating some Rope code.

Any idea what you are doing to reproduce this?

georgevreilly commented 11 years ago

Actually, that's the output from the built-in Activity Monitor. There's no strace, but there is DTrace. Maybe I'll finally learn how to use it.

Every time this has happened, I've been doing something innocuous like moving up and down lines. Obviously, moving around in buffers is something I do thousands of times a day. This CPU utilization problem only started in the last few days. I can't think of anything's that's changed.

jorgenschaefer commented 11 years ago

My current idea would be that it's a bug in Rope that we can't reproduce, so difficult to debug or report upstream. :-|

As a workaround, you can use the Jedi backend (M-x elpy-set-backend RET jedi RET). If that also causes those hangs, something else is seriously broken, but I do not know what.

Sorry I can't be of more help here. :-(

Nikratio commented 11 years ago

If there's a possibility to upgrade to Python 3.3, then you could use the faulthandler module to get a (Python level) stack trace by sending a signal to the Python process when the freeze occurs. That would tell you where exactly it is hanging.

jorgenschaefer commented 11 years ago

Any new ideas on what has been causing this?

georgevreilly commented 11 years ago

I had forgotten about this, as I have not noticed it for several weeks.

On Fri, Jul 19, 2013 at 11:21 AM, Jorgen Schäfer notifications@github.comwrote:

Any new ideas on what has been causing this?

— Reply to this email directly or view it on GitHubhttps://github.com/jorgenschaefer/elpy/issues/96#issuecomment-21267696 .

jorgenschaefer commented 11 years ago

I'll close this, then – if it shows up again, do not hesitate to re-open the issue! And thanks for the extensive reports.

glasserc commented 10 years ago

Hi, I've seen this issue as well. Emacs is definitely the process that spikes the CPU. I can't definitively assert that it's due to elpy, but I thought I'd keep you informed. The "proximate cause" that causes the CPU to spike is usually cursor movement or hitting C-x C-f (I use ido). The emacs stack traces tend to just show "redisplay_internal" as the top stack frame. I have my machine set up to use the jedi backend by default, but I've explicitly changed it to Rope; I feel like that works sometimes, but eventually I end up back in a slow state. I'm mostly working on the codebase for my job, which is about 6000 lines of Python (so not that big), but pulls in some thirty or forty packages in a virtualenv. I've tried both using and not using virtualenv-workon to specify the virtualenv. Another quirk of our codebase is that we append the project root to PYTHONPATH, which I have had to do manually when working with virtualenv.

Here's the base64-encoded profiler-report of doing C-x C-f and then aborting with C-g a few times.

Cltwcm9maWxlci1wcm9maWxlICIyNC4zIiBjcHUgI3MoaGFzaC10YWJsZSBzaXplIDk3IHRlc3Qg
ZXF1YWwgcmVoYXNoLXNpemUgMS41IHJlaGFzaC10aHJlc2hvbGQgMC44IGRhdGEgKFtuaWwgbmls
IG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5pbCBuaWxd
IDE3NiBbdGltZXItLWFjdGl2YXRlIHRpbWVyLWFjdGl2YXRlLXdoZW4taWRsZSB0aW1lci1ldmVu
dC1oYW5kbGVyIG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5pbCBuaWwgbmls
IG5pbF0gMzQ1IFtkZWxxIGNhbmNlbC10aW1lci1pbnRlcm5hbCB0aW1lci1ldmVudC1oYW5kbGVy
IG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5pbF0gMTI3
IFt0aW1lci0tdGltZS1sZXNzLXAgdGltZXItLWFjdGl2YXRlIHRpbWVyLWFjdGl2YXRlLXdoZW4t
aWRsZSB0aW1lci1ldmVudC1oYW5kbGVyIG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5pbCBuaWwg
bmlsIG5pbCBuaWwgbmlsXSA0MTEgW2NhbmNlbC10aW1lci1pbnRlcm5hbCB0aW1lci1ldmVudC1o
YW5kbGVyIG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5p
bCBuaWxdIDcxIFt0aW1lci0tdGltZSB0aW1lci0tdGltZS1sZXNzLXAgdGltZXItLWFjdGl2YXRl
IHRpbWVyLWFjdGl2YXRlLXdoZW4taWRsZSB0aW1lci1ldmVudC1oYW5k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J0LWNwdSBwcm9maWxlci1yZXBvcnQgY2FsbC1pbnRlcmFj
dGl2ZWx5IGNvbW1hbmQtZXhlY3V0ZSBleGVjdXRlLWV4dGVuZGVkLWNvbW1hbmQgY2FsbC1pbnRl
cmFjdGl2ZWx5IG5pbCBuaWwgbmlsIG5pbCBuaWwgbmlsIG5pbCBuaWxdIDQgW0F1dG9tYXRpY1wg
R0NdIDM3ODgpKSAoMjExNTIgNDY4MjkgNTYyMTY5IDcwNDAwMCkgbmlsXQo=

I have python3.3 on my machine so I could try to run elpy using it (even though our codebase is definitely not py3k safe). Is there an environment variable I could change?

jorgenschaefer commented 10 years ago

Thank you!

Which version of Emacs are you using?

glasserc commented 10 years ago

I'm running:

jorgenschaefer commented 10 years ago

Pity. They recently broke something in Emacs trunk that might be causing this. But 24.3 should unaffected.

I'm pretty much at a loss here. The profile output doesn't contain any elpy code. Hanging in redisplay should be a C problem, too. I'd love to say "can't reproduce, unlikely to be elpy's fault", but that would be cheating a bit. I'll keep the issue open in case someone can find more information here.

glasserc commented 10 years ago

Is there some elpy-minor-mode that is suspect? Somethiing I could try in order to rule something out?

jorgenschaefer commented 10 years ago

The only thing I can imagine would be the RPC interface doing something really weird. Disabling both auto-complete and eldoc-mode would mean Elpy does not use RPC while moving in a buffer. If you can semi-reliably reproduce this, disabling both of those would be an idea.

glasserc commented 10 years ago

Hmm. I haven't hit the problem since disabling those two minor modes. Is there some way to narrow down a cause, or maybe get a log or something?

jorgenschaefer commented 10 years ago

Hm. I have a suspicion.

I added one (remotely) possible bugfix and some debug output to the issue-96 branch. Could you use that? (It'll be a bit slower and spam your message log, though; might make more sense to log to a separate buffer)

If it still hangs, the debug output should show whether it's running some kind of endless loop with the backend there somehow.

glasserc commented 10 years ago

Hmm, took me a little while to figure out how to co-opt package to install elpy@issue-96, but I think I've done it -- I moved elpy-1.2.1 out of the way, symlinked both elpy-1.2.1 and elpy-1.2.50 to elpy-issue96, and copied elpy-autoloads.el from elpy-1.2.1 to elpy-issue96. I'll let you know how it goes!

jorgenschaefer commented 10 years ago

Oh. You should be able to just add the elpy repository to your load-path and do a (require 'elpy) (and add2virtualenv for the repository to get the python module, too).

glasserc commented 10 years ago

Hmm. I've been using it all day and at least it hasn't spiked the CPU. But I just got "Flymake: Configuration error has occurred while running (flake8 /home/ethan/..../filename_flymake.py). Flymake will be switched OFF." I get it every time I open a Python file (i.e. C-x C-f to a file that I haven't already C-x C-f'd to in this session).

From having looked at the changes you introduced, I can't imagine that it's related. Just for fun, I checked *Messages* and didn't see anything from Flymake (though I do see the elpy-rpc--call messages).

glasserc commented 10 years ago

Sorry, this is even weirder than that -- it only shows up in files in certain directories. It looks like the _flymake files are being created correctly with the correct contents, too. It's almost certainly unrelated.

glasserc commented 10 years ago

Ah, this is definitely unrelated, it's something to do with my codebase (I have a file called stat.py, which seems to conflict somehow with the stdlib's stat.py).

glasserc commented 10 years ago

Actually, just to clarify a little more in case this turns out to be related in some way to the larger problem -- for some reason I have PYTHONPATH=:/home/ethan/some-directory, and flake8 is getting run from the directory with stat.py. flake8, when run in exactly this way, imports os, which imports posixpath, which imports stat, which finds stat because it's first on PYTHONPATH.

jorgenschaefer commented 10 years ago

That's a different bug definitely. I'm currently on vacation and won't be able look any closer at the moment, could you open a separate issue so I won't forget?

eN-Joy commented 10 years ago

Well, I kind of having the same problem, however it occurs randomly and I just can't reproduce it. Basically emacs would work most of the time, especially when it just started. Then after a while, when it tries to auto-complete, it eats up 100% CPU, you'll have to wait a long time before it becomes responsive to key stroke, and you'll end up with this cycle until emacs crashes.

I have tried to elliminate some minor modes, such as eldoc-mode, flymake-mode, auto-complete-mode, etc, no help. I've set toggle-debug-on-error, or toggle-debug-on-quit, but emacs quits and creates a dumps, I can't see logs.

Here's my environment: Python 2.7.5 (default, Oct 2 2013, 22:34:09) [GCC 4.8.1] on cygwin

dot emacs (I have a very simple setup) (add-to-list 'load-path "~/.emacs.d")

;; Python mode in elpa is not the newest (add-to-list 'load-path "~/.emacs.d/python-mode.el-6.1.2") (load-theme 'wombat t)

(require 'package) (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") ("marmalade" . "http://marmalade-repo.org/packages/") ("melpa" . "http://melpa.milkbox.net/packages/"))) (package-initialize)

(require 'python-mode) (add-hook 'python-mode-hook 'show-paren-mode) (add-hook 'python-mode-hook 'electric-pair-mode)

(when (require 'elpy nil t) (elpy-enable) (elpy-clean-modeline)) (elpy-use-ipython)

python:

Django==1.6.1 Scrapy==0.20.2 Twisted==13.2.0 beautifulsoup4==4.3.2 cssselect==0.9.1 django-debug-toolbar==1.0 elpy==1.2.1 epc==0.0.5 flake8==2.1.0 ipython==1.1.0 jedi==0.7.0 lxml==3.2.4 mccabe==0.2.1 pep8==1.4.6 pyOpenSSL==0.13.1 pyflakes==0.7.3 queuelib==1.1.1 requests==2.1.0 sexpdata==0.0.3 simplejson==3.3.1 six==1.4.1 sqlparse==0.1.10 w3lib==1.5 wsgiref==0.1.2 zope.interface==4.0.5

Sample emacs dump

Stack trace: Frame Function Args 00000427030 0018006F943 (001802DFEA0, 001802DFEA0, 00000427368, 001802E4D28) 00000000006 00180070E0A (00100004000, 00000000000, 00000000234, 00000000000) 00000427210 00180119138 (5E86A32000000006, 00000000000, 00100935481, 0060002D568) 000000000C1 001801161EE (00000427780, 00000000000, 00000000000, 00100488200) 001004881A0 001801166BB (00000000000, 00000000000, 00000000000, 00000000006) 001004881A0 0018011688C (00000000079, 0000042D440, 001801750AB, 001004881A0) 001004881A0 0018011227B (0000042D440, 001801750AB, 001004881A0, 00000000020) 001004881A0 000004275DC (001801750AB, 001004881A0, 00000000020, 00100488200) 001004881A0 00000000079 (001004881A0, 00000000020, 00100488200, 001008C49E0) 001004881A0 0000042D440 (00000000020, 00100488200, 001008C49E0, 00000000001) 001004881A0 001801750AB (00000000001, 000004275DC, 00180137010, 00600E3A400) 001004881A0 0010048819A (00000006D3F, 1FFFFFFFFFFFFFFF, 0000000000C, 001008FB5E6) 001004881A0 0010049FFB3 (001004DE720, 00600BDE460, 0010083A640, 00100FAEE58) 00000000002 00180070E0A (001008DD432, 001008C2AA9, 001004F72A3, 00000000000) 00000427A00 00180112391 (001008C49E0, 001008C49E0, 00600C9ADD8, 00100D92612) 00100C818F2 00000427A48 (001008C49E0, 00600C9ADD8, 00100D92612, 00600F648A6) End of stack trace (more stack frames may be present)

jorgenschaefer commented 10 years ago

(require 'python-mode)

Hm. Elpy doesn't work with python-mode.el (and actually should throw an error when used in this configuration). Could you re-try without?

Also, which version of Emacs is that?

eN-Joy commented 10 years ago

Yes, I've tried to switch to built-in python.el, it didn't help either. Here a screen shot of the cpu usage. http://imgur.com/zqtsEIB

(However I've never received complaints from using python-mode.el)

My emacs version: GNU Emacs 24.3.1 (x86_64-unknown-cygwin) of 2013-08-20 on moufang Copyright (C) 2013 Free Software Foundation, Inc.

jorgenschaefer commented 10 years ago

I have no idea why Emacs would hang. elpy doesn't do anything to make it hang to my knowledge. It even breaks out of the busy-lock after a few seconds if it uses that, and for auto-complete/eldoc, it doesn't even busy-block. :-(

glasserc commented 10 years ago

Well, let me chime in -- using the "hacked" version of elpy with the minor fix and the logging turned on, I haven't seen elpy hang, so I think that the fix at least helps a lot. I do have one remaining complaint, but it doesn't cause emacs to hang or CPU to spike. Hmm, I think I better open another bug report for that, actually.

jorgenschaefer commented 10 years ago

The original issue might be related to #154 and #182 – though the user was reporting to have rope installed, which would by default mean they used rope, not jedi. The ticket was reopened, but that user reports the problem solved for now. So closing this.

If this resurfaces with rope, please do not hesitate to re-open this ticket.

gyst commented 10 years ago

FWIW I ran into this problem (Emacs hanging at 100% CPU w/ elpy on cursor up/down) today after I renamed a module called 'stat.py' to 'stats.py' (and was working in this module). Following the hints in this thread I renamed that module to a more innocuous name 'describe.py'. That seems to have solved the problem (for me). Using elpy with rope and flycheck.

I cannot reproduce the problem though by re-creating stat.py and/or stats.py.

jorgenschaefer commented 10 years ago

@gyst, which versions of Emacs and Elpy are you using?

gyst commented 10 years ago

On 04/05/14 12:08, Jorgen Schäfer wrote:

@gyst https://github.com/gyst, which versions of Emacs and Elpy are you using?

GNU Emacs 24.3.1 elpy-1.3.0

gyst@thor:~$ ls .emacs.d/elpa/ archives/ highlight-indentation-0.5.0/ auto-complete-1.4/ idomenu-0.1/ autofit-frame-readme.txt iedit-0.97/ color-theme-20080305.34/ less-css-mode-20140205.250/ color-theme-solarized-20140401.957/ nose-0.1.1/ dash-20140327.116/ pkg-info-20140313.513/ elpy-1.3.0/ popup-0.5/ epl-20140316.544/ pyvenv-1.1/ f-20140220.21/ s-20131223.944/ find-file-in-project-3.2/ sr-speedbar-20131207.2049/ flycheck-20140328.743/ web-mode-20140325.1631/ flycheck-color-mode-line-20131125.2138/ yasnippet-0.8.0/ fuzzy-0.1/

 Guido Stevens  |  +31.43.3618933  |  http://cosent.nl

 s o c i a l   k n o w l e d g e   t e c h n o l o g y
jorgenschaefer commented 10 years ago

Thank you. Really strange. And it's Emacs that is consuming CPU?

I hate these bugs being so difficult to analyze :-)

gyst commented 10 years ago

On 04/05/14 18:54, Jorgen Schäfer wrote:

Thank you. Really strange. And it's Emacs that is consuming CPU?

Yes it was. Stopped responding, basically, so I looked at top.

I hate these bugs being so difficult to analyze :-)

I felt really bad about submitting a report when I couldn't even reproduce it myself. But then I thought, the other guy had stat problems, moving that module worked for me, it might work for the next guy who's hit by this.

:*CU

 Guido Stevens  |  +31.43.3618933  |  http://cosent.nl

 s o c i a l   k n o w l e d g e   t e c h n o l o g y
jorgenschaefer commented 10 years ago

Never feel bad about submitting bug reports. Thank you!

gyst commented 10 years ago

On 04/05/14 19:44, Jorgen Schäfer wrote:

Never feel bad about submitting bug reports. Thank you!

Well, thank you! Elpy is a major upgrade of my dev environment :-)

 Guido Stevens  |  +31.43.3618933  |  http://cosent.nl

 s o c i a l   k n o w l e d g e   t e c h n o l o g y
eN-Joy commented 10 years ago

I am still experiencing the cpu problem with my new Ubuntu LTS 14.04 box, it's a minimal installation, absolutely only necessary packages are installed.

GNU Emacs 24.3.1, Python 2.7.6, iPython 2.0.0,

.emacs

;; (autoload 'jedi:setup "jedi" nil t) ;; (setq jedi:setup-keys t) ;; (add-hook 'python-mode-hook 'jedi:setup) ;; (setq jedi:complete-on-dot t)

(when (require 'elpy nil t) (elpy-enable) (elpy-clean-modeline)) (elpy-use-ipython)

(add-hook 'python-mode-hook 'show-paren-mode) (add-hook 'python-mode-hook 'electric-pair-mode)

virtualenv

backports.ssl-match-hostname==3.4.0.2 beautifulsoup4==4.3.2 cffi==0.8.2 cryptography==0.4 cssselect==0.9.1 Django==1.6.4 elpy==1.4.0 epc==0.0.5 filemagic==1.6 flake8==2.1.0 ipython==2.0.0 jedi==0.8.0-final0 log-colorizer==1.6 lxml==3.3.5 mccabe==0.2.1 pep8==1.5.6 pip-tools==0.3.4 psutil==2.1.1 psycopg2==2.5.2 pycparser==2.10 pyflakes==0.8.1 pyOpenSSL==0.14 queuelib==1.1.1 Scrapy==0.22.2 sexpdata==0.0.3 six==1.6.1 South==0.8.4 tornado==3.2.1 Twisted==14.0.0 uWSGI==2.0.4 w3lib==1.5 wdb.server==2.0.0 wdb==2.0.0 zope.interface==4.1.1

emacs packages

archives auto-complete-20140414.2324 autopair-20140311.1211 concurrent-20140303.1635 ctable-20140304.1659 deferred-20140303.1634 elpy-20140501.744 epc-20140323.2054 ess-20140507.2352 find-file-in-project-20140221.557 flymake-cursor-20130822.1032 fuzzy-20131025.2343 highlight-indentation-20131207.835 idomenu-20111122.1048 iedit-20131021.116 jedi-20140321.1323 nginx-mode-20140321.2028 nose-20140501.1740 pastebin-20101125.1955 php-mode-20140502.1051 pony-mode-20140127.846 popup-20140207.1702 python-environment-20140321.1116 pyvenv-20140411.1319 web-mode-20140511.1206 yasnippet-20140511.947

The CPU spike is totally not predictable, I can sometimes use emacs for a while not seeing anything, yet sometimes it's just start hanging no matter what you type. The picture below shows when I was in a parenthesis.

cpu

jorgenschaefer commented 10 years ago

@eN-Joy, could you enable M-x toggle-debug-on-quit, hit C-g (possibly a few times) when Emacs hangs like this, and post the resulting backtrace? If that does not produce a backtrace, could you run strace -o foo.txt -f -p 20744 (the PID of the Emacs process), let that run for a few seconds, abort it with C-c, and post the resulting foo.txt?

eN-Joy commented 10 years ago

@jorgenschaefer sorry it took me some time to get back. M-x toggle-debug-on-quit does not always spit messages, so i've tried the strace way, the dumped file is about 500k, i don't think it can be pasted here. http://ix.io/dbU please let me know what else i can provide. (i promise i'll respond quicker;-)

jorgenschaefer commented 10 years ago

Thanks for the trace! That looks really weird.

The start of the trace is the normal loop of Emacs that I know: pselect/clock_gettime/rt_sigprocmask. Then it somehow looks like it simply forgets to call pselect, which is what it would need to do to notice input is pending.

This really looks like a bug in Emacs. What version are you using?

You probably should report this using M-x report-emacs-bug

eN-Joy commented 10 years ago

I am using GNU Emacs 24.3.1 on Ubuntu 14.04. Will try report bug later. Thanks!

gyst commented 10 years ago

On 29/06/14 18:09, eN-Joy wrote:

I am using GNU Emacs 24.3.1 on Ubuntu 14.04.

That is exactly the version I'm using as well. Hardly a coincidence.

| This is GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) | of 2014-03-07 on lamiak, modified by Debian

:*CU

 Guido Stevens  |  +31.43.3618933  |  http://cosent.nl

 s o c i a l   k n o w l e d g e   t e c h n o l o g y
jorgenschaefer commented 10 years ago

Testing the latest pre-release might be an idea if you have the time. This looks a bit like a bug we traced down in Emacs a few weeks ago. Though the behavior was a bit different (only minor hiccups, no real lock-ups).

gyst commented 10 years ago

On 30/06/14 15:56, Jorgen Schäfer wrote:

Testing the latest pre-release might be an idea if you have the time.

Prerelease of elpy, or of emacs?

:*CU

 Guido Stevens  |  +31.43.3618933  |  http://cosent.nl

 s o c i a l   k n o w l e d g e   t e c h n o l o g y
jorgenschaefer commented 10 years ago

@gyst, oops, sorry for being unclear, I meant the Emacs pre-test.

http://alpha.gnu.org/gnu/emacs/pretest/