From: Jingtao Xu <jingtaozf@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 17267@debbugs.gnu.org
Subject: bug#17267: 24.3.50; 100% cpu usage of emacs when copy some lines to org buffer
Date: Wed, 16 Apr 2014 14:18:18 +0800 [thread overview]
Message-ID: <CALopY-nzJjpxmDcxZXL07Nm-=A3bbDCJgHPctCgaZ0QQ68L1Lw@mail.gmail.com> (raw)
In-Reply-To: <83vbubj5xu.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2812 bytes --]
I create test files /tmp/test.el and /tmp/test.diff,see them in attach.
Then I start emacs with -q and create a empty file /tmp/test.org,and
press M-x then invoke function "my-changes",it fails with error
"line-move: Args out of range: 160, 160".
But If I invoke this function in buffer test.el,it runs fine.
Of course it's not a bug of 100% cpu usage,but It also works fine in
my old emacs whether I invoke this command in buffer test.org or not.
Hope this help you indicate the issue position.
Thanks.
With Best Regards.
jingtao.
-------------------------------------------------------------------------------------------------------------------------
On Tue, Apr 15, 2014 at 5:30 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Jingtao Xu <jingtaozf@gmail.com>
>> Date: Tue, 15 Apr 2014 15:46:13 +0800
>>
>>
>> I wrote one elisp function to collect the code changes of a svn diff file:
>> =============================================================================================
>> (defun my-svn-codes-changes (&optional proj)
>> (interactive)
>> (if (null proj)
>> (setf proj (my-select-project)))
>> (with-current-buffer (find-file-noselect (my-path proj (concat (my-p-id proj) ".diff")))
>> (fundamental-mode)
>> (goto-char (point-min))
>> (let (result-list cur-file cur-file-changes)
>> (while (search-forward "Index: " nil t)
>> (setf cur-file (buffer-substring-no-properties (point) (line-end-position)))
>> (next-line 3)
>> ;;(loop repeat 3 do (next-line))
>> (let ((start-pos (line-beginning-position))
>> (end-pos (point-max)))
>> (when (search-forward "Index: " nil t)
>> (previous-line)
>> (setf end-pos (line-end-position)))
>> (setf cur-file-changes (buffer-substring-no-properties start-pos end-pos))
>> (push (cons cur-file cur-file-changes) result-list)
>> (goto-char end-pos)))
>> (reverse result-list))))
>> =============================================================================================
>> It works fine in emacs 24.3.1,but in emacs 24.3.50,it will enter into an infinite loop and never return.
>>
>> I debugged emacs source code and find the infinite loop seems to happen in c function handle_stop,of file xdisp.c.
>> emacs nerver return from this function,and in handle_stop,when it call function handle_invisible_prop,it will
>> return HANDLED_RECOMPUTE_PROPS.
>
> Sorry, I don't see any obvious relation between the above function and
> the part of xdisp.c where you see the infloop. Is it possible for you
> to construct a reproducible recipe for this bug, starting with "emacs -Q",
> including any external files necessary for reproducing the bug? If so,
> please post the recipe and the files here.
>
> Thanks.
[-- Attachment #2: test.diff --]
[-- Type: text/plain, Size: 958 bytes --]
Index: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
===================================================================
--- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb (.../ccccccccccccccccccc) (revision 111111)
+++ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb (.../ddddddddddddddddddd) (revision 222222)
@@ -287,6 +287,9 @@
+xcopy %AAAAAA%\bbbbbbb.html %DIR%\ /R
@echo --- ffffffffff
Index: ccccccccccccccccccccccccccccccccccccccccccccccccccccc
===================================================================
--- ccccccccccccccccccccccccccccccccccccccccccccccccccccc (.../ccccccccccccccccccc) (revision 111111)
+++ ccccccccccccccccccccccccccccccccccccccccccccccccccccc (.../ddddddddddddddddddd) (revision 222222)
@@ -1,3 +0,0 @@
-@echo off
-
-regsvr32 /s /c eeeeeeeee.ocx
[-- Attachment #3: test.el --]
[-- Type: text/x-emacs-lisp, Size: 974 bytes --]
;;; -*- encoding:utf-8 -*- ---
(defun my-changes ()
(interactive)
(with-current-buffer (find-file-noselect "/tmp/test.diff")
(fundamental-mode)
(goto-char (point-min))
(let (result-list cur-file cur-file-changes)
(while (search-forward "Index: " nil t)
(message "range:%d,%d" (point) (line-end-position))
(setf cur-file (buffer-substring-no-properties (point) (line-end-position)))
(next-line 3)
'(loop repeat 3 do
(message "move line")
(next-line))
(let ((start-pos (line-beginning-position))
(end-pos (point-max)))
(when (search-forward "Index: " nil t)
(previous-line)
(setf end-pos (line-end-position)))
(setf cur-file-changes (buffer-substring-no-properties start-pos end-pos))
(push (cons cur-file cur-file-changes) result-list)
(goto-char end-pos)))
(message "result is %s" (reverse result-list)))))
next prev parent reply other threads:[~2014-04-16 6:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-15 7:46 bug#17267: 24.3.50; 100% cpu usage of emacs when copy some lines to org buffer Jingtao Xu
2014-04-15 9:30 ` Eli Zaretskii
2014-04-16 6:18 ` Jingtao Xu [this message]
2014-04-17 9:33 ` Eli Zaretskii
2014-04-18 6:37 ` Jingtao Xu
2014-04-18 6:45 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALopY-nzJjpxmDcxZXL07Nm-=A3bbDCJgHPctCgaZ0QQ68L1Lw@mail.gmail.com' \
--to=jingtaozf@gmail.com \
--cc=17267@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.