millejoh / emacs-ipython-notebook

Jupyter notebook client in Emacs
http://millejoh.github.io/emacs-ipython-notebook/
GNU General Public License v3.0
1.47k stars 122 forks source link

Emacs freezes while editing markdown notebook #583

Closed chep closed 5 years ago

chep commented 5 years ago

Problem description

Sometimes, while editing markdown cells, emacs freezes and uses 100% of one CPU It happens after a "long" time (maybe 15-20 minutes).

If I don't kill emacs and wait, it lasts a few minutes and then emacs is responding again.

I'm not able to stop anything with C-g so enabling debug is useless.

I compiled emacs with debug symbols and attached gdb. Emacs is always in the garbage collector functions when the problem occurs. It seems that cleaning takes very long time.

Steps to reproduce the problem

I can't reproduce the problem with emacs -Q but maybe I didn't tried enough, it's no always funny to use vanilla emacs. This could also be a problem with one of my other packages... I don't know how to debug this. If you have any idea, I can try it.

System info:

("EIN system info"
 :emacs-version
 "GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2019-08-13"
 :emacs-bzr-version "4f38332f3330c056d1790a5b7a38cd4193c0850e"
 :window-system x
 :emacs-variant nil
 :os
 (:uname
  "Linux BaradDur 5.2.5-arch1-1-ARCH #1 SMP PREEMPT Wed Jul 31 08:30:34 UTC 2019 x86_64 GNU/Linux
"
  :lsb-release nil)
 :notebook
 "Name: notebook
Version: 6.0.0
Summary: A web-based notebook environment for interactive computing
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: jupyter@googlegroups.com
License: BSD
Location: /usr/lib/python3.7/site-packages
Requires: jinja2, tornado, pyzmq, ipython-genutils, traitlets, jupyter-core, jupyter-client, nbformat, nbconvert, ipykernel, Send2Trash, terminado, prometheus-client
Required-by: widgetsnbextension, rise
"
 :ipython "7.6.1
"
 :image-types
 (svg png gif tiff jpeg xpm xbm pbm postscript)
 :image-types-available
 (svg png gif tiff jpeg xpm xbm pbm postscript)
 :request
 (:backend curl)
 :ein
 (:version "20190809.2351"
           :source-dir "/home/chep/.emacs.d/elpa/ein-20190809.2351/")
 :lib
 ((:name "websocket"
         :path "~/.emacs.d/elpa/websocket-20190621.54/websocket.elc"
         :featurep t
         :version-var websocket-version
         :version "1.11.1")
  (:name "auto-complete"
         :path "~/.emacs.d/elpa/auto-complete-20170125.245/auto-complete.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "request"
         :path "~/.emacs.d/elpa/request-20190730.1014/request.elc"
         :featurep t
         :version-var request-version
         :version "0.3.0")
  (:name "deferred"
         :path "~/.emacs.d/elpa/deferred-20170901.1330/deferred.elc"
         :featurep t
         :version-var deferred:version
         :version "0.5.0")
  (:name "polymode"
         :path "~/.emacs.d/elpa/polymode-20190714.2017/polymode.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "markdown-mode"
         :path "~/.emacs.d/elpa/markdown-mode-20190802.2215/markdown-mode.elc"
         :featurep t
         :version-var markdown-mode-version
         :version "2.4-dev")
  (:name "dash"
         :path "~/.emacs.d/elpa/dash-20190424.1804/dash.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "s"
         :path "~/.emacs.d/elpa/s-20180406.808/s.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "skewer-mode"
         :path "~/.emacs.d/elpa/skewer-mode-20180706.1807/skewer-mode.elc"
         :featurep t
         :version-var nil
         :version nil)))
dickmao commented 5 years ago

Perhaps font-lock or syntax-ppss is spinning on a pathological mix of markdown and python (like what happens when we miss a close quote, and comments get parsed as code). If that were the case then turning on polymode would be the solution -- unless you already have polymode turned on. That is what I'd need to know.

dickmao commented 5 years ago

Whether polymode is on or off, I'd want to see the ipynb file that reliably triggers the blowup if that could be posted here.

chep commented 5 years ago

I have poly-ein minor mode enabled is that what you are talking about?

I can't post my notebook here sorry

dickmao commented 5 years ago

If poly-ein is enabled and a minimum reproducible example cannot be furnished, then I have no further input. Sorry.