GNU bug report logs - #28700
25.2; Cannot kill Eshell buffer

Previous Next

Package: emacs;

Reported by: Live System User <nyc4bos <at> aol.com>

Date: Wed, 4 Oct 2017 09:58:01 UTC

Severity: minor

Tags: fixed, patch

Merged with 29153

Found in versions 25.2, 25.3

Fixed in version 26.1

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28700 in the body.
You can then email your comments to 28700 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Wed, 04 Oct 2017 09:58:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Live System User <nyc4bos <at> aol.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 04 Oct 2017 09:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Live System User <nyc4bos <at> aol.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.2; Cannot kill Eshell buffer
Date: Wed, 04 Oct 2017 05:57:20 -0400
Hi,

        I cannot kill an Eshell buffer.

        When I attekpt to kill it either by `(kill-buffer)`
        "C-x k" or `(save-buffers-kill-terminal)` "C-x C-c"
        I get the error:

              run-hooks: Text is read-only

        `kill-buffer-hook` is:
        
kill-buffer-hook is a variable defined in ‘files.el’.
Its value is (t eshell-kill-buffer-function)
Local in buffer *eshell*; global value is 
(tramp-delete-temp-file-function uniquify-kill-buffer-function vc-kill-buffer-hook)

         Thank.



In GNU Emacs 25.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.20.10)
 of 2017-05-02 built on buildvm-17.phx2.fedoraproject.org
Windowing system distributor 'Fedora Project', version 11.0.11803000
Configured using:
 'configure --build=x86_64-redhat-linux-gnu
 --host=x86_64-redhat-linux-gnu --program-prefix=
 --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
 --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
 --libexecdir=/usr/libexec --localstatedir=/var
 --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3
 --with-gpm=no --with-xwidgets --with-modules
 build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu
 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=format-security
 -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
 --param=ssp-buffer-size=4 -grecord-gcc-switches
 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic'
 LDFLAGS=-Wl,-z,relro
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES XWIDGETS

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Buffer Menu

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
250 2.1.0 Ok
250 2.1.5 Ok
354 End data with <CR><LF>.<CR><LF>
Sending email 
Sending email done
250 2.0.0 Ok: queued as 1A2883800008D
221 2.0.0 Bye
Sending...done

Load-path shadows:
None found.

Features:
(misearch multi-isearch rect mailalias smtpmail face-remap shadow
emacsbug sendmail shr-color color shr dom subr-x browse-url debug
nnagent nnml pp gnus-dup sort gnus-cite smiley ansi-color mail-extr qp
gnus-async gnus-bcklg gnus-ml disp-table cursor-sensor nndraft nnmh
nndoc mm-archive jka-compr timezone url-http url-gw url-cache url-auth
url-handlers utf-7 rfc2104 nnfolder network-stream nsm starttls
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp
gnus-cache epa-file epa derived nnreddit mm-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util url-parse auth-source cl-seq eieio eieio-core cl-macs url-vars
json map seq byte-opt bytecomp byte-compile cl-extra cconv gnus-art
mm-uu mml2015 mm-view mml-smime smime dig mailcap cl gv sieve sieve-mode
sieve-manage nnir gnus-sum gnus-group gnus-undo gnus-start gnus-cloud
nnimap nnmail mail-source tls gnutls utf7 netrc parse-time gnus-spec
gnus-int gnus-range message dired format-spec rfc822 mml mml-sec
password-cache epg epg-config mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader
gnus-win gnus gnus-ems wid-edit nnoo nnheader gnus-util mm-util help-fns
help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils
time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting xwidget-internal move-toolbar
gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 256618 98808)
 (symbols 48 63384 57)
 (miscs 40 296 557)
 (strings 32 92176 94506)
 (string-bytes 1 2792305)
 (vectors 16 29987)
 (vector-slots 8 1097868 133031)
 (floats 8 588 1436)
 (intervals 56 6441 153)
 (buffers 976 88)
 (heap 1024 71182 572023))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Wed, 04 Oct 2017 11:57:01 GMT) Full text and rfc822 format available.

Message #8 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Wed, 04 Oct 2017 07:56:45 -0400
Live System User <nyc4bos <at> aol.com> writes:

> Hi,
>
>         I cannot kill an Eshell buffer.
>
>         When I attekpt to kill it either by `(kill-buffer)`
>         "C-x k" or `(save-buffers-kill-terminal)` "C-x C-c"
>         I get the error:
>
>               run-hooks: Text is read-only
>
>         `kill-buffer-hook` is:
>         
> kill-buffer-hook is a variable defined in ‘files.el’.
> Its value is (t eshell-kill-buffer-function)
> Local in buffer *eshell*; global value is 
> (tramp-delete-temp-file-function uniquify-kill-buffer-function vc-kill-buffer-hook)

Can you get a backtrace if you M-x toggle-debug-on-error RET?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Wed, 04 Oct 2017 14:14:02 GMT) Full text and rfc822 format available.

Message #11 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Wed, 04 Oct 2017 10:13:37 -0400
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> Live System User <nyc4bos <at> aol.com> writes:
>
>> Hi,
>>
>>         I cannot kill an Eshell buffer.
>>
>>         When I attekpt to kill it either by `(kill-buffer)`
>>         "C-x k" or `(save-buffers-kill-terminal)` "C-x C-c"
>>         I get the error:
>>
>>               run-hooks: Text is read-only
>>
>>         `kill-buffer-hook` is:
>>         
>> kill-buffer-hook is a variable defined in ‘files.el’.
>> Its value is (t eshell-kill-buffer-function)
>> Local in buffer *eshell*; global value is 
>> (tramp-delete-temp-file-function uniquify-kill-buffer-function vc-kill-buffer-hook)
>
> Can you get a backtrace if you M-x toggle-debug-on-error RET?

         Ufortunately no;

debug-on-error is a variable defined in ‘C source code’.
Its value is t
Original value was nil


         Only that *Message* buffer imfomation.

         Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Wed, 04 Oct 2017 14:20:02 GMT) Full text and rfc822 format available.

Message #14 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Wed, 4 Oct 2017 10:19:07 -0400
On Wed, Oct 4, 2017 at 10:13 AM, Live System User <nyc4bos <at> aol.com> wrote:
>> Can you get a backtrace if you M-x toggle-debug-on-error RET?
>
>          Ufortunately no;
>
> debug-on-error is a variable defined in ‘C source code’.
> Its value is t
> Original value was nil
>
>
>          Only that *Message* buffer imfomation.

Does setting debug-on-message set to "Text is read-only" help?
Or with debug-on-signal set to t? (You might have to continue ('c' in
the *Backtrace* buffer) if you hit some unrelated errors that are
normally suppressed)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Wed, 04 Oct 2017 15:22:01 GMT) Full text and rfc822 format available.

Message #17 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Wed, 04 Oct 2017 11:21:04 -0400
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> On Wed, Oct 4, 2017 at 10:13 AM, Live System User <nyc4bos <at> aol.com> wrote:
>>> Can you get a backtrace if you M-x toggle-debug-on-error RET?
>>
>>          Ufortunately no;
>>
>> debug-on-error is a variable defined in ‘C source code’.
>> Its value is t
>> Original value was nil
>>
>>
>>          Only that *Message* buffer imfomation.
>
> Does setting debug-on-message set to "Text is read-only" help?
> Or with debug-on-signal set to t? (You might have to continue ('c' in
> the *Backtrace* buffer) if you hit some unrelated errors that are
> normally suppressed)

  Unfortunately, no ro both:
  
debug-on-message is a variable defined in ‘C source code’.
Its value is "Text is read-only"


debug-on-signal is a variable defined in ‘C source code’.
Its value is t
Original value was nil


         Only the "run-hooks: Text is read-only" message
         in the *Message* buffer appears.

         Thanks.






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Wed, 04 Oct 2017 16:43:01 GMT) Full text and rfc822 format available.

Message #20 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Wed, 4 Oct 2017 12:42:41 -0400
On Wed, Oct 4, 2017 at 11:21 AM, Live System User <nyc4bos <at> aol.com> wrote:
>
>   Unfortunately, no ro both:
>
> debug-on-message is a variable defined in ‘C source code’.
> Its value is "Text is read-only"
>
>
> debug-on-signal is a variable defined in ‘C source code’.
> Its value is t
> Original value was nil
>
>
>          Only the "run-hooks: Text is read-only" message
>          in the *Message* buffer appears.

Hmm, can you eval each function in the hook value individually and see
which gets the error then?

M-: (tramp-delete-temp-file-function)
M-: (uniquify-kill-buffer-function)
etc.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Wed, 04 Oct 2017 18:28:01 GMT) Full text and rfc822 format available.

Message #23 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Wed, 04 Oct 2017 14:27:32 -0400
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> On Wed, Oct 4, 2017 at 11:21 AM, Live System User <nyc4bos <at> aol.com> wrote:
>>
>>   Unfortunately, no ro both:
>>
>> debug-on-message is a variable defined in ‘C source code’.
>> Its value is "Text is read-only"
>>
>>
>> debug-on-signal is a variable defined in ‘C source code’.
>> Its value is t
>> Original value was nil
>>
>>
>>          Only the "run-hooks: Text is read-only" message
>>          in the *Message* buffer appears.
>
> Hmm, can you eval each function in the hook value individually and see
> which gets the error then?
>
> M-: (tramp-delete-temp-file-function)
> M-: (uniquify-kill-buffer-function)
> etc.

        They all evaluate to nil

.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Wed, 04 Oct 2017 18:33:02 GMT) Full text and rfc822 format available.

Message #26 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Wed, 4 Oct 2017 14:32:36 -0400
On Wed, Oct 4, 2017 at 2:27 PM, Live System User <nyc4bos <at> aol.com> wrote:
>
>         They all evaluate to nil

Hmm, so maybe the run-hooks is a red herring. Could you instrument
kill-buffer with edebug, and step through to find where the error
happens?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Wed, 04 Oct 2017 19:51:01 GMT) Full text and rfc822 format available.

Message #29 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Wed, 04 Oct 2017 15:50:29 -0400
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> On Wed, Oct 4, 2017 at 2:27 PM, Live System User <nyc4bos <at> aol.com> wrote:
>>
>>         They all evaluate to nil
>
> Hmm, so maybe the run-hooks is a red herring. Could you instrument
> kill-buffer with edebug, and step through to find where the error
> happens?

  I don't know how to invoke or use Edebug.

  Can you give me step-by-step instructions?

  BTW, is it possible to Edebug `kill-buffer` ?


kill-buffer is an interactive built-in function in ‘C source code’.

It is bound to C-x k.



   Thanks.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Wed, 04 Oct 2017 19:57:01 GMT) Full text and rfc822 format available.

Message #32 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Wed, 4 Oct 2017 15:56:52 -0400
On Wed, Oct 4, 2017 at 3:50 PM, Live System User <nyc4bos <at> aol.com> wrote:
>   Can you give me step-by-step instructions?
>
>   BTW, is it possible to Edebug `kill-buffer` ?
>
>
> kill-buffer is an interactive built-in function in ‘C source code’.

Oops, sorry, it is indeed not possible to edebug C code. I don't
suppose you've built your emacs with debug info so you could step with
gdb?

Do you know how to reproduce this situation starting from 'emacs -Q',
or is it a one-off fluke?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Wed, 04 Oct 2017 22:13:01 GMT) Full text and rfc822 format available.

Message #35 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Wed, 04 Oct 2017 18:12:36 -0400
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> On Wed, Oct 4, 2017 at 3:50 PM, Live System User <nyc4bos <at> aol.com> wrote:
>>   Can you give me step-by-step instructions?
>>
>>   BTW, is it possible to Edebug `kill-buffer` ?
>>
>>
>> kill-buffer is an interactive built-in function in ‘C source code’.
>
> Oops, sorry, it is indeed not possible to edebug C code. I don't
> suppose you've built your emacs with debug info so you could step with
> gdb?

  It's built by Fedora (RedHat).  I have debugging info but I belive
  the emacs binary might be stripped, if that matters.
  
>
> Do you know how to reproduce this situation starting from 'emacs -Q',
> or is it a one-off fluke?

  I dont know how to reproduce this with or without 'emacs -Q' but
  it has happened to me periodically so I decided to finally
  report it

  I'll leave the sessuon around as long as I can.

  I hope someone can help me to debug it.

  Thanks.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Wed, 04 Oct 2017 23:50:02 GMT) Full text and rfc822 format available.

Message #38 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Wed, 04 Oct 2017 19:48:53 -0400
Live System User <nyc4bos <at> aol.com> writes:

>   It's built by Fedora (RedHat).  I have debugging info but I belive
>   the emacs binary might be stripped, if that matters.

Hmm, you will need gdb, emacs debug info and probably the emacs sources
as well.

This link explains how to get the debug info:
https://fedoraproject.org/wiki/StackTraces#What_are_debuginfo_rpms.2C_and_how_do_I_get_them.3F

I'm not sure how to get sources under Redhat based distros.

Also get .gdbinit from
http://git.savannah.gnu.org/cgit/emacs.git/tree/src/.gdbinit?h=heads/emacs-25.3

>   I dont know how to reproduce this with or without 'emacs -Q' but
>   it has happened to me periodically so I decided to finally
>   report it
>
>   I'll leave the sessuon around as long as I can.

After you have installed the debugging symbols and gdb, attach gdb to
the running Emacs by running

    gdb -p xxxx

Where xxxx is Emacs' pid (a number).  Find that out by running 'pgrep -a
emacs'.  Then at the (gdb) prompt, type

    source .gdbinit
    break text_read_only
    continue

Then try to kill the buffer.  Hopefully the breakpoint will be hit and
emacs becomes frozen.  At the (gdb) prompt, type

    bt





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Thu, 05 Oct 2017 08:10:01 GMT) Full text and rfc822 format available.

Message #41 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Live System User <nyc4bos <at> aol.com>, 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Thu, 05 Oct 2017 10:09:04 +0200
>                run-hooks: Text is read-only
>
>          `kill-buffer-hook` is:
>
> kill-buffer-hook is a variable defined in ‘files.el’.
> Its value is (t eshell-kill-buffer-function)
> Local in buffer *eshell*; global value is
> (tramp-delete-temp-file-function uniquify-kill-buffer-function vc-kill-buffer-hook)

Set ‘kill-buffer-hook’ to nil when this happens to find out whether some
local binding creates any difficulties.  If this is not the case,
gradually re-add each of the elements above to see which one causes the
problem.

martin





Added tag(s) moreinfo and unreproducible. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Wed, 11 Oct 2017 12:20:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Sun, 15 Oct 2017 19:10:01 GMT) Full text and rfc822 format available.

Message #46 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Sun, 15 Oct 2017 15:09:12 -0400
[Message part 1 (text/plain, inline)]
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> Live System User <nyc4bos <at> aol.com> writes:
>
>>   It's built by Fedora (RedHat).  I have debugging info but I belive
>>   the emacs binary might be stripped, if that matters.
>
> Hmm, you will need gdb, emacs debug info and probably the emacs sources
> as well.
>
> This link explains how to get the debug info:
> https://fedoraproject.org/wiki/StackTraces#What_are_debuginfo_rpms.2C_and_how_do_I_get_them.3F
>
> I'm not sure how to get sources under Redhat based distros.
>
> Also get .gdbinit from
> http://git.savannah.gnu.org/cgit/emacs.git/tree/src/.gdbinit?h=heads/emacs-25.3
>
>>   I dont know how to reproduce this with or without 'emacs -Q' but
>>   it has happened to me periodically so I decided to finally
>>   report it
>>
>>   I'll leave the sessuon around as long as I can.
>
> After you have installed the debugging symbols and gdb, attach gdb to
> the running Emacs by running
>
>     gdb -p xxxx
>
> Where xxxx is Emacs' pid (a number).  Find that out by running 'pgrep -a
> emacs'.  Then at the (gdb) prompt, type
>
>     source .gdbinit
>     break text_read_only
>     continue
>
> Then try to kill the buffer.  Hopefully the breakpoint will be hit and
> emacs becomes frozen.  At the (gdb) prompt, type
>
>     bt

      Here is some GDB info.

      Thanks.

[text_read_only-bt-error.txt (text/plain, attachment)]
[text_read_only-bt-error.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Sun, 15 Oct 2017 19:30:02 GMT) Full text and rfc822 format available.

Message #49 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Sun, 15 Oct 2017 15:29:21 -0400
[Message part 1 (text/plain, inline)]
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> Live System User <nyc4bos <at> aol.com> writes:
>
>>   It's built by Fedora (RedHat).  I have debugging info but I belive
>>   the emacs binary might be stripped, if that matters.
>
> Hmm, you will need gdb, emacs debug info and probably the emacs sources
> as well.
>
> This link explains how to get the debug info:
> https://fedoraproject.org/wiki/StackTraces#What_are_debuginfo_rpms.2C_and_how_do_I_get_them.3F
>
> I'm not sure how to get sources under Redhat based distros.
>
> Also get .gdbinit from
> http://git.savannah.gnu.org/cgit/emacs.git/tree/src/.gdbinit?h=heads/emacs-25.3
>
>>   I dont know how to reproduce this with or without 'emacs -Q' but
>>   it has happened to me periodically so I decided to finally
>>   report it
>>
>>   I'll leave the sessuon around as long as I can.
>
> After you have installed the debugging symbols and gdb, attach gdb to
> the running Emacs by running
>
>     gdb -p xxxx
>
> Where xxxx is Emacs' pid (a number).  Find that out by running 'pgrep -a
> emacs'.  Then at the (gdb) prompt, type
>
>     source .gdbinit
>     break text_read_only
>     continue
>
> Then try to kill the buffer.  Hopefully the breakpoint will be hit and
> emacs becomes frozen.  At the (gdb) prompt, type
>
>     bt

      Additional info...

      Thanks.

[text_read_only-error.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Sun, 15 Oct 2017 19:50:01 GMT) Full text and rfc822 format available.

Message #52 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Sun, 15 Oct 2017 15:48:54 -0400
Live System User <nyc4bos <at> aol.com> writes:

>       Here is some GDB info.

> (gdb) bt
> #0  text_read_only (propval=propval <at> entry=XIL(0xb010))
>     at ../../src/textprop.c:71

> Lisp Backtrace:
> "eshell-write-history" (0x5642bf38)
> "run-hooks" (0x5642c020)
> "eshell-kill-buffer-function" (0x5642c200)
> "kill-buffer" (0x5642c400)
> "funcall-interactively" (0x5642c3f8)
> "call-interactively" (0x5642c660)
> "command-execute" (0x5642c808)

Thanks, my guess is you have some string with a read-only property in
eshell history (probably introduced by copying from another buffer), and
this is tripping up eshell-write-history.

Can you post the result of

    M-x pp-eval-expression RET eshell-history-ring RET

If my guess is correct there should be some strings of the form

    #("some command" 0 11 (read-only t))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Sun, 15 Oct 2017 22:04:01 GMT) Full text and rfc822 format available.

Message #55 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Sun, 15 Oct 2017 18:02:54 -0400
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> Live System User <nyc4bos <at> aol.com> writes:
>
>>       Here is some GDB info.
>
>> (gdb) bt
>> #0  text_read_only (propval=propval <at> entry=XIL(0xb010))
>>     at ../../src/textprop.c:71
>
>> Lisp Backtrace:
>> "eshell-write-history" (0x5642bf38)
>> "run-hooks" (0x5642c020)
>> "eshell-kill-buffer-function" (0x5642c200)
>> "kill-buffer" (0x5642c400)
>> "funcall-interactively" (0x5642c3f8)
>> "call-interactively" (0x5642c660)
>> "command-execute" (0x5642c808)
>
> Thanks, my guess is you have some string with a read-only property in
> eshell history (probably introduced by copying from another buffer), and
> this is tripping up eshell-write-history.
>
> Can you post the result of
>
>     M-x pp-eval-expression RET eshell-history-ring RET
>
> If my guess is correct there should be some strings of the form
>
>     #("some command" 0 11 (read-only t))

      Yes.  So how do I deal wi'th?

      Thanks.



(6 128 .
   [#("ssh localhost ps -efw | grep ssh" 0 1
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      3 4
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      4 5
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      13 14
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      14 15
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      16 17
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      17 18
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      21 22
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      22 23
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      23 24
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      24 25
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      28 29
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      29 30
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      31 32
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t))
    #("ssh localhost ps -efw | grep ssh" 0 1
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      3 4
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      4 5
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      13 14
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      14 15
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      16 17
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      17 18
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      21 22
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      22 23
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      23 24
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      24 25
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      28 29
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      29 30
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      31 32
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t))
    #("ssh localhost ps" 0 1
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      3 4
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      4 5
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      13 14
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      14 15
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      15 16
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t))
    #("ssh localhost " 0 1
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      3 4
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      4 5
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      13 14
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t))
    #("~/" 0 1
      (rear-nonsticky
       (arg-begin arg-end)
       read-only t arg-begin t)
      1 2
      (rear-nonsticky
       (arg-end arg-begin)
       read-only t arg-end t))
    #("  env | grep TERM" 2 3
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      5 6
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      6 7
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      7 8
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      8 9
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      12 13
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t)
      13 14
      (rear-nonsticky
       (arg-begin arg-end)
       arg-begin t)
      16 17
      (rear-nonsticky
       (arg-end arg-begin)
       arg-end t))
    "ssh locallhost" "Error: Failed to execute child process \"$SHELL\"
   (No such file or directory)" "ssh locallhost" "ssh locallhost"

[...]





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Mon, 16 Oct 2017 02:22:02 GMT) Full text and rfc822 format available.

Message #58 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Sun, 15 Oct 2017 22:20:52 -0400
[Message part 1 (text/plain, inline)]
tags 28700 = patch
quit

Live System User <nyc4bos <at> aol.com> writes:

>> Thanks, my guess is you have some string with a read-only property in
>> eshell history (probably introduced by copying from another buffer), and
>> this is tripping up eshell-write-history.
>>
>> Can you post the result of
>>
>>     M-x pp-eval-expression RET eshell-history-ring RET
>>
>> If my guess is correct there should be some strings of the form
>>
>>     #("some command" 0 11 (read-only t))
>
>       Yes.  So how do I deal wi'th?

>     #("~/" 0 1
>       (rear-nonsticky
>        (arg-begin arg-end)
>        read-only t arg-begin t)
>       1 2
>       (rear-nonsticky
>        (arg-end arg-begin)
>        read-only t arg-end t))

Ah, there we are.  I can't quite work out exactly how you managed to get
such a string, but stripping properties in eshell-write-history should
take care of it regardless.  If you evaluate the following defun in your
emacs session, it should be able to exit:

(defun eshell-write-history (&optional filename append)
  "Writes the buffer's `eshell-history-ring' to a history file.
The name of the file is given by the variable
`eshell-history-file-name'.  The original contents of the file are
lost if `eshell-history-ring' is not empty.  If
`eshell-history-file-name' is nil this function does nothing.

Useful within process sentinels.

See also `eshell-read-history'."
  (let ((file (or filename eshell-history-file-name)))
    (cond
     ((or (null file)
	  (equal file "")
	  (null eshell-history-ring)
	  (ring-empty-p eshell-history-ring))
      nil)
     ((not (file-writable-p file))
      (message "Cannot write history file %s" file))
     (t
      (let* ((ring eshell-history-ring)
	     (index (ring-length ring)))
	;; Write it all out into a buffer first.  Much faster, but
	;; messier, than writing it one line at a time.
	(with-temp-buffer
	  (while (> index 0)
	    (setq index (1- index))
	    (let ((start (point)))
              ;; Remove properties before inserting, to avoid trouble
              ;; with read-only strings (Bug#28700).
              (insert (substring-no-properties (ring-ref ring index)) ?\n)
	      (subst-char-in-region start (1- (point)) ?\n ?\177)))
	  (eshell-with-private-file-modes
	   (write-region (point-min) (point-max) file append
			 'no-message))))))))

Here's the corresponding patch:

[0001-Ignore-string-properties-when-saving-eshell-history-.patch (text/x-diff, inline)]
From ffaeb09ca6ef9b3d97c8b378c1e5c2b2723dae6f Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Sun, 15 Oct 2017 16:41:17 -0400
Subject: [PATCH] Ignore string properties when saving eshell history
 (Bug#28700)

* lisp/eshell/em-hist.el (eshell-write-history): Remove properties
before inserting history strings.
(eshell-read-history): Remove obsolete comment.
---
 lisp/eshell/em-hist.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index 1ab3c60b2c..8084c12653 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -444,7 +444,6 @@ eshell-read-history
 	     (ignore-dups eshell-hist-ignoredups))
 	(with-temp-buffer
 	  (insert-file-contents file)
-	  ;; Save restriction in case file is already visited...
 	  ;; Watch for those date stamps in history files!
 	  (goto-char (point-max))
 	  (while (and (< count size)
@@ -488,7 +487,9 @@ eshell-write-history
 	  (while (> index 0)
 	    (setq index (1- index))
 	    (let ((start (point)))
-	      (insert (ring-ref ring index) ?\n)
+              ;; Remove properties before inserting, to avoid trouble
+              ;; with read-only strings (Bug#28700).
+              (insert (substring-no-properties (ring-ref ring index)) ?\n)
 	      (subst-char-in-region start (1- (point)) ?\n ?\177)))
 	  (eshell-with-private-file-modes
 	   (write-region (point-min) (point-max) file append
-- 
2.11.0


Added tag(s) patch; removed tag(s) moreinfo and unreproducible. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Mon, 16 Oct 2017 02:22:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28700; Package emacs. (Sat, 21 Oct 2017 19:52:01 GMT) Full text and rfc822 format available.

Message #63 received at 28700 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 28700 <at> debbugs.gnu.org
Subject: Re: bug#28700: 25.2; Cannot kill Eshell buffer
Date: Sat, 21 Oct 2017 15:51:18 -0400
tags 28700 fixed
close 28700 26.1
quit

Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> * lisp/eshell/em-hist.el (eshell-write-history): Remove properties
> before inserting history strings.

Add test and pushed to emacs-26.

[1: 9e4265ef91]: 2017-10-21 15:19:14 -0400
  Ignore string properties when saving eshell history (Bug#28700)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=9e4265ef91bd659a5fac49fbe7dc34b91f89d4ed




Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Sat, 21 Oct 2017 19:52:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 26.1, send any further explanations to 28700 <at> debbugs.gnu.org and Live System User <nyc4bos <at> aol.com> Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Sat, 21 Oct 2017 19:52:02 GMT) Full text and rfc822 format available.

Merged 28700 29153. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Sun, 05 Nov 2017 11:40:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 03 Dec 2017 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 204 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.