* Possible bug: Emacs hangs on (require 'org)
@ 2016-11-23 1:31 Luke
2016-11-23 2:39 ` Eric Abrahamsen
2016-11-23 2:43 ` Luke
0 siblings, 2 replies; 6+ messages in thread
From: Luke @ 2016-11-23 1:31 UTC (permalink / raw)
To: emacs-orgmode
I have a strange situation on my laptop.
I'm running Ubuntu 16.04, with Emacs 24.5.1. I'm also using the latest
development branch from the org-mode git repository (latest changes
pulled today).
Recently, for some unknown reason, emacs suddenly started to hang on
startup. Placing some output messages in my .emacs file I was able to
narrow it down to this line:
(require 'org)
Loading org-mode hangs Emacs for some reason. If I remove the above line
from .emacs then Emacs will start as normal (although without org-mode,
obviously).
I tried creating a minimal-org.el file with the following contents:
;; activate debugging
(setq debug-on-error t
debug-on-signal nil
debug-on-quit nil)
;; add latest org-mode to load path
(add-to-list 'load-path (expand-file-name "~/elisp/org-mode/lisp"))
(add-to-list 'load-path (expand-file-name
"~/elisp/org-mode/contrib/lisp" t))
And then running:
$ emacs -Q -l minimal-org.el
...but I still get the same result (Emacs hangs when I run `M-x (require
'org)`).
Can anyone help tell me what's wrong, or suggest how I try and track
down the problem?
--
Luke
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Possible bug: Emacs hangs on (require 'org)
2016-11-23 1:31 Luke
@ 2016-11-23 2:39 ` Eric Abrahamsen
2016-11-23 2:56 ` Luke
2016-11-23 2:43 ` Luke
1 sibling, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2016-11-23 2:39 UTC (permalink / raw)
To: emacs-orgmode
Luke <mideniko1234-org@yahoo.co.uk> writes:
> I have a strange situation on my laptop.
>
> I'm running Ubuntu 16.04, with Emacs 24.5.1. I'm also using the latest
> development branch from the org-mode git repository (latest changes
> pulled today).
>
> Recently, for some unknown reason, emacs suddenly started to hang on
> startup. Placing some output messages in my .emacs file I was able to
> narrow it down to this line:
>
> (require 'org)
>
> Loading org-mode hangs Emacs for some reason. If I remove the above
> line from .emacs then Emacs will start as normal (although without
> org-mode, obviously).
>
> I tried creating a minimal-org.el file with the following contents:
>
> ;; activate debugging
> (setq debug-on-error t
> debug-on-signal nil
> debug-on-quit nil)
>
> ;; add latest org-mode to load path
> (add-to-list 'load-path (expand-file-name "~/elisp/org-mode/lisp"))
> (add-to-list 'load-path (expand-file-name
> "~/elisp/org-mode/contrib/lisp" t))
>
> And then running:
>
> $ emacs -Q -l minimal-org.el
>
> ...but I still get the same result (Emacs hangs when I run `M-x
> (require 'org)`).
>
> Can anyone help tell me what's wrong, or suggest how I try and track
> down the problem?
You're setting debug-on-quit to nil, but it's likely that setting it to
t is exactly what you need. Toggle it to t, eval (require 'org), then
while it's hung hit C-g. You should get a backtrace showing you what
Emacs was actually doing when you quit.
Eric
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Possible bug: Emacs hangs on (require 'org)
2016-11-23 1:31 Luke
2016-11-23 2:39 ` Eric Abrahamsen
@ 2016-11-23 2:43 ` Luke
1 sibling, 0 replies; 6+ messages in thread
From: Luke @ 2016-11-23 2:43 UTC (permalink / raw)
To: emacs-orgmode
On 23/11/16 09:31, Luke wrote:
> I have a strange situation on my laptop.
>
> I'm running Ubuntu 16.04, with Emacs 24.5.1. I'm also using the latest
> development branch from the org-mode git repository (latest changes
> pulled today).
>
> Recently, for some unknown reason, emacs suddenly started to hang on
> startup. Placing some output messages in my .emacs file I was able to
> narrow it down to this line:
>
> (require 'org)
>
> Loading org-mode hangs Emacs for some reason. If I remove the above line
> from .emacs then Emacs will start as normal (although without org-mode,
> obviously).
>
> I tried creating a minimal-org.el file with the following contents:
>
> ;; activate debugging
> (setq debug-on-error t
> debug-on-signal nil
> debug-on-quit nil)
>
> ;; add latest org-mode to load path
> (add-to-list 'load-path (expand-file-name "~/elisp/org-mode/lisp"))
> (add-to-list 'load-path (expand-file-name
> "~/elisp/org-mode/contrib/lisp" t))
>
> And then running:
>
> $ emacs -Q -l minimal-org.el
>
> ...but I still get the same result (Emacs hangs when I run `M-x (require
> 'org)`).
>
> Can anyone help tell me what's wrong, or suggest how I try and track
> down the problem?
>
Further to my previous post, I've discovered that if I disable
networking then Emacs loads immediately (no hang).
The network connection where I am at the moment is not very reliable, so
I'm wondering if org-mode is trying to make some kind of network
connection which then hangs while waiting for a response that never
comes back.
--
Luke
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Possible bug: Emacs hangs on (require 'org)
2016-11-23 2:39 ` Eric Abrahamsen
@ 2016-11-23 2:56 ` Luke
2016-11-23 3:30 ` Eric Abrahamsen
0 siblings, 1 reply; 6+ messages in thread
From: Luke @ 2016-11-23 2:56 UTC (permalink / raw)
To: emacs-orgmode
On 23/11/16 10:39, Eric Abrahamsen wrote:
> Luke <mideniko1234-org@yahoo.co.uk> writes:
>
>> I have a strange situation on my laptop.
>>
>> I'm running Ubuntu 16.04, with Emacs 24.5.1. I'm also using the latest
>> development branch from the org-mode git repository (latest changes
>> pulled today).
>>
>> Recently, for some unknown reason, emacs suddenly started to hang on
>> startup. Placing some output messages in my .emacs file I was able to
>> narrow it down to this line:
>>
>> (require 'org)
>>
>> Loading org-mode hangs Emacs for some reason. If I remove the above
>> line from .emacs then Emacs will start as normal (although without
>> org-mode, obviously).
>>
>> I tried creating a minimal-org.el file with the following contents:
>>
>> ;; activate debugging
>> (setq debug-on-error t
>> debug-on-signal nil
>> debug-on-quit nil)
>>
>> ;; add latest org-mode to load path
>> (add-to-list 'load-path (expand-file-name "~/elisp/org-mode/lisp"))
>> (add-to-list 'load-path (expand-file-name
>> "~/elisp/org-mode/contrib/lisp" t))
>>
>> And then running:
>>
>> $ emacs -Q -l minimal-org.el
>>
>> ...but I still get the same result (Emacs hangs when I run `M-x
>> (require 'org)`).
>>
>> Can anyone help tell me what's wrong, or suggest how I try and track
>> down the problem?
>
> You're setting debug-on-quit to nil, but it's likely that setting it to
> t is exactly what you need. Toggle it to t, eval (require 'org), then
> while it's hung hit C-g. You should get a backtrace showing you what
> Emacs was actually doing when you quit.
>
> Eric
>
>
>
Thanks to Eric for the debugging tip. Below is the backtrace that was
produced. It looks like tramp is trying to make some connection to the
host-name "host.does.not.exist" (which will obviously fail).
This makes sense, because when I disable networking then Emacs starts
immediately and doesn't hang. I'm not sure how to fix this though.
=====================================================================
Debugger entered--Lisp error: (quit)
call-process("ssh" nil t nil "-o" "ControlPath=%C" "host.does.not.exist")
(progn (call-process "ssh" nil t nil "-o" "ControlPath=%C"
"host.does.not.exist") (goto-char (point-min)) (if
(search-forward-regexp "unknown.+key" nil t) (setq result (concat result
" -o ControlPath='tramp.%%r@%%h:%%p'")) (setq result (concat result " -o
ControlPath='tramp.%%C'"))))
(unwind-protect (progn (call-process "ssh" nil t nil "-o"
"ControlPath=%C" "host.does.not.exist") (goto-char (point-min)) (if
(search-forward-regexp "unknown.+key" nil t) (setq result (concat result
" -o ControlPath='tramp.%%r@%%h:%%p'")) (setq result (concat result " -o
ControlPath='tramp.%%C'")))) (and (buffer-name temp-buffer) (kill-buffer
temp-buffer)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(call-process "ssh" nil t nil "-o" "ControlPath=%C"
"host.does.not.exist") (goto-char (point-min)) (if
(search-forward-regexp "unknown.+key" nil t) (setq result (concat result
" -o ControlPath='tramp.%%r@%%h:%%p'")) (setq result (concat result " -o
ControlPath='tramp.%%C'")))) (and (buffer-name temp-buffer) (kill-buffer
temp-buffer))))
(let ((temp-buffer (generate-new-buffer " *temp*")))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(call-process "ssh" nil t nil "-o" "ControlPath=%C"
"host.does.not.exist") (goto-char (point-min)) (if
(search-forward-regexp "unknown.+key" nil t) (setq result (concat result
" -o ControlPath='tramp.%%r@%%h:%%p'")) (setq result (concat result " -o
ControlPath='tramp.%%C'")))) (and (buffer-name temp-buffer) (kill-buffer
temp-buffer)))))
(if (zerop (length result)) nil (let ((temp-buffer
(generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer
temp-buffer) (unwind-protect (progn (call-process "ssh" nil t nil "-o"
"ControlPath=%C" "host.does.not.exist") (goto-char (point-min)) (if
(search-forward-regexp "unknown.+key" nil t) (setq result (concat result
" -o ControlPath='tramp.%%r@%%h:%%p'")) (setq result (concat result " -o
ControlPath='tramp.%%C'")))) (and (buffer-name temp-buffer) (kill-buffer
temp-buffer))))) (let ((temp-buffer (generate-new-buffer " *temp*")))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(call-process "ssh" nil t nil "-o" "ControlPersist") (goto-char
(point-min)) (if (search-forward-regexp "missing.+argument" nil t)
(progn (setq result ...)))) (and (buffer-name temp-buffer) (kill-buffer
temp-buffer))))))
(progn (let ((temp-buffer (generate-new-buffer " *temp*")))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(call-process "ssh" nil t nil "-o" "ControlMaster") (goto-char
(point-min)) (if (search-forward-regexp "missing.+argument" nil t)
(progn (setq result "-o ControlMaster=auto")))) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer))))) (if (zerop (length result))
nil (let ((temp-buffer (generate-new-buffer " *temp*")))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(call-process "ssh" nil t nil "-o" "ControlPath=%C"
"host.does.not.exist") (goto-char (point-min)) (if
(search-forward-regexp "unknown.+key" nil t) (setq result ...) (setq
result ...))) (and (buffer-name temp-buffer) (kill-buffer
temp-buffer))))) (let ((temp-buffer (generate-new-buffer " *temp*")))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(call-process "ssh" nil t nil "-o" "ControlPersist") (goto-char
(point-min)) (if (search-forward-regexp "missing.+argument" nil t)
(progn ...))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))
(if (executable-find "ssh") (progn (let ((temp-buffer
(generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer
temp-buffer) (unwind-protect (progn (call-process "ssh" nil t nil "-o"
"ControlMaster") (goto-char (point-min)) (if (search-forward-regexp
"missing.+argument" nil t) (progn ...))) (and (buffer-name temp-buffer)
(kill-buffer temp-buffer))))) (if (zerop (length result)) nil (let
((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer
(set-buffer temp-buffer) (unwind-protect (progn (call-process "ssh" nil
t nil "-o" "ControlPath=%C" "host.does.not.exist") (goto-char ...) (if
... ... ...)) (and (buffer-name temp-buffer) (kill-buffer
temp-buffer))))) (let ((temp-buffer (generate-new-buffer " *temp*")))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(call-process "ssh" nil t nil "-o" "ControlPersist") (goto-char ...) (if
... ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))))
(progn (if (executable-find "ssh") (progn (let ((temp-buffer
(generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer
temp-buffer) (unwind-protect (progn (call-process "ssh" nil t nil "-o"
"ControlMaster") (goto-char ...) (if ... ...)) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer))))) (if (zerop (length result))
nil (let ((temp-buffer (generate-new-buffer " *temp*")))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ...
... ...) (and ... ...)))) (let ((temp-buffer (generate-new-buffer "
*temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect
(progn ... ... ...) (and ... ...))))))))
(condition-case nil (progn (if (executable-find "ssh") (progn (let
((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer
(set-buffer temp-buffer) (unwind-protect (progn ... ... ...) (and ...
...)))) (if (zerop (length result)) nil (let ((temp-buffer ...))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...)))
(let ((temp-buffer ...)) (save-current-buffer (set-buffer temp-buffer)
(unwind-protect ... ...))))))) (error nil))
(let ((result "") (case-fold-search t)) (condition-case nil (progn
(if (executable-find "ssh") (progn (let ((temp-buffer ...))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...)))
(if (zerop (length result)) nil (let (...) (save-current-buffer ...
...)) (let (...) (save-current-buffer ... ...)))))) (error nil)) result)
(defvar tramp-ssh-controlmaster-options (let ((result "")
(case-fold-search t)) (condition-case nil (progn (if (executable-find
"ssh") (progn (let (...) (save-current-buffer ... ...)) (if (zerop ...)
nil (let ... ...) (let ... ...))))) (error nil)) result) "Call ssh to
detect whether it supports the Control* arguments.\nReturn a string to
be used in `tramp-methods'.")
eval-buffer(#<buffer *load*> nil
"/usr/share/emacs/24.5/lisp/net/tramp-loaddefs.el" nil t) ; Reading at
buffer position 7072
load-with-code-conversion("/usr/share/emacs/24.5/lisp/net/tramp-loaddefs.el"
"/usr/share/emacs/24.5/lisp/net/tramp-loaddefs.el" nil t)
require(tramp-loaddefs)
byte-code("\300\301!\207" [require tramp-loaddefs] 2)
byte-code("\300\301\302\303#\210\300\304\305\306#\210\300\304\307\306#\210\300\304\310\306#\210\300\304\311\306#\210\300\304\312\306#\210\300\304\313\306#\210\300\314\315\316#\210\300\317\320\316#\210\300\304\321\306#\210\300\322\323\306#\210\300\324\325\306#\210\300\322\326\306#\210\300\327\330\316#\210\300\331\332\303#\210\300\331\333\303#\210\300\331\334\303#\210\300\331\335\303#\210\300\331\336\303#\210\300\337\340\341#\210\342\343!\203\206
=====================================================================
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Possible bug: Emacs hangs on (require 'org)
2016-11-23 2:56 ` Luke
@ 2016-11-23 3:30 ` Eric Abrahamsen
0 siblings, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2016-11-23 3:30 UTC (permalink / raw)
To: emacs-orgmode
Luke <mideniko1234-org@yahoo.co.uk> writes:
> On 23/11/16 10:39, Eric Abrahamsen wrote:
>> Luke <mideniko1234-org@yahoo.co.uk> writes:
[...]
>>> I tried creating a minimal-org.el file with the following contents:
>>>
>>> ;; activate debugging
>>> (setq debug-on-error t
>>> debug-on-signal nil
>>> debug-on-quit nil)
>>>
>>> ;; add latest org-mode to load path
>>> (add-to-list 'load-path (expand-file-name "~/elisp/org-mode/lisp"))
>>> (add-to-list 'load-path (expand-file-name
>>> "~/elisp/org-mode/contrib/lisp" t))
>>>
>>> And then running:
>>>
>>> $ emacs -Q -l minimal-org.el
>>>
>>> ...but I still get the same result (Emacs hangs when I run `M-x
>>> (require 'org)`).
>>>
>>> Can anyone help tell me what's wrong, or suggest how I try and track
>>> down the problem?
>>
>> You're setting debug-on-quit to nil, but it's likely that setting it to
>> t is exactly what you need. Toggle it to t, eval (require 'org), then
>> while it's hung hit C-g. You should get a backtrace showing you what
>> Emacs was actually doing when you quit.
>>
>> Eric
>>
>>
>>
>
> Thanks to Eric for the debugging tip. Below is the backtrace that was
> produced. It looks like tramp is trying to make some connection to the
> host-name "host.does.not.exist" (which will obviously fail).
>
> This makes sense, because when I disable networking then Emacs starts
> immediately and doesn't hang. I'm not sure how to fix this though.
I don't have a copy of Emacs 24 handy (and I recommend you upgrade to
25), but as a band-aid you should be able to kill the check by setting
the `tramp-use-ssh-controlmaster-options' option to nil. That ought to
prevent tramp from testing the connection at all (at least, I think it
will).
In 25 it looks like "host.does.not.exist" has been replaced with a bogus
IP address, meaning that you won't time out on a DNS lookup, which is
likely what's hanging for you.
As for the real root of the problem -- why loading org results in tramp
doing this check -- I unfortunately can't tell you!
The real "fix", I think, would be upgrading to Emacs 25.
Eric
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Possible bug: Emacs hangs on (require 'org)
@ 2017-01-06 14:30 Martin Zuther
0 siblings, 0 replies; 6+ messages in thread
From: Martin Zuther @ 2017-01-06 14:30 UTC (permalink / raw)
To: emacs-orgmode
Hi!
About every third time I start Emacs, I also experience a very slow
startup with org-mode 9.0.3 enabled. I run "GNU Emacs 24.5.1
(x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04,
modified by Debian" on Linux Mint 18.1 Cinnamon.
Here is my minimal setup:
;;; Minimal setup to load latest 'org-mode'
;; activate debugging
(setq debug-on-error t
debug-on-signal nil
debug-on-quit nil)
;; add latest org-mode to load path
(add-to-list 'load-path "~/.emacs.d/elisp/org_9.0.3/lisp")
(require 'org)
This bug is solved by disabling my network, but in contrast to Luke, I
have access to a fast and stable network.
Normal startup time is below one second. When the bug hits, it is
around 2 minutes and 7 seconds, which to me looks suspiciously like a
typical network timeout of 120 seconds.
Martin
--
www.mzuther.de
www.radix-musik.de
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-01-06 14:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-06 14:30 Possible bug: Emacs hangs on (require 'org) Martin Zuther
-- strict thread matches above, loose matches on Subject: below --
2016-11-23 1:31 Luke
2016-11-23 2:39 ` Eric Abrahamsen
2016-11-23 2:56 ` Luke
2016-11-23 3:30 ` Eric Abrahamsen
2016-11-23 2:43 ` Luke
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).