all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#25451: 24.5; Freeze after while-keyword in sh-mode
@ 2017-01-14 20:54 Elias Schwerdtfeger
  2017-01-14 22:37 ` Noam Postavsky
  0 siblings, 1 reply; 4+ messages in thread
From: Elias Schwerdtfeger @ 2017-01-14 20:54 UTC (permalink / raw)
  To: 25451


[-- Attachment #1.1: Type: text/plain, Size: 7111 bytes --]


While typing the following, rather ordinary shell script in sh-mode,
Emacs freezes and consumes full CPU. I had to kill the process.

--- snip ---
#!/bin/sh
########################################################################
#
# location-cascade
# $Id$
#
# Requires 'lynx'
#
########################################################################

# User-agent
# internet exploiter 10 for best results from spammy sites ;)
UA='Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)'

httpcode=0
uri=$1
while
--- snip ---

The bug is fully reproducible after recover-this-buffer.

In text-mode, the bug does not occur.

If the 'while' is part of a complete loop 'while :; do something; done;
the bug does not occur.

I guess, it is a bug in sh-mode, but reading LISP is hard for me, so I
did not investigate further.


Elias




In 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
Windowing system distributor `The X.Org Foundation', version 11.0.11804000
System Description:	Ubuntu 16.04.1 LTS

Configured using:
 `configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
 --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
 -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

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

Major mode: Shell-script

Minor modes in effect:
  sh-electric-here-document-mode: t
  server-mode: t
  show-paren-mode: t
  tooltip-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
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Loading /etc/emacs/site-start.d/50php-elisp.el (source)...done
Loading /etc/emacs/site-start.d/50pylint.el (source)...done
Loading /etc/emacs/site-start.d/50pymacs.el (source)...done
Loading /etc/emacs/site-start.d/50python-mode.el (source)...done
Loading /etc/emacs/site-start.d/50w3m-el.el (source)...done
Loading paren...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Setting up indent for shell type sh
Indentation variables are now local.
Indentation setup for shell type sh

Load-path shadows:
/usr/share/emacs24/site-lisp/css-mode/css-mode hides
/usr/share/emacs/site-lisp/css-mode/css-mode
/usr/share/emacs/24.5/site-lisp/debian-startup hides
/usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs24/site-lisp/cmake-data/cmake-mode hides
/usr/share/emacs/site-lisp/cmake-mode
/usr/share/emacs24/site-lisp/flim/hex-util hides
/usr/share/emacs/24.5/lisp/hex-util
/usr/share/emacs24/site-lisp/flim/md4 hides /usr/share/emacs/24.5/lisp/md4
/usr/share/emacs24/site-lisp/html-helper-mode/tempo hides
/usr/share/emacs/24.5/lisp/tempo
/usr/share/emacs24/site-lisp/css-mode/css-mode hides
/usr/share/emacs/24.5/lisp/textmodes/css-mode
/usr/share/emacs24/site-lisp/flim/sasl-cram hides
/usr/share/emacs/24.5/lisp/net/sasl-cram
/usr/share/emacs24/site-lisp/flim/sasl-digest hides
/usr/share/emacs/24.5/lisp/net/sasl-digest
/usr/share/emacs24/site-lisp/flim/ntlm hides
/usr/share/emacs/24.5/lisp/net/ntlm
/usr/share/emacs24/site-lisp/flim/sasl hides
/usr/share/emacs/24.5/lisp/net/sasl
/usr/share/emacs24/site-lisp/flim/hmac-md5 hides
/usr/share/emacs/24.5/lisp/net/hmac-md5
/usr/share/emacs24/site-lisp/flim/hmac-def hides
/usr/share/emacs/24.5/lisp/net/hmac-def
/usr/share/emacs24/site-lisp/flim/sasl-ntlm hides
/usr/share/emacs/24.5/lisp/net/sasl-ntlm
/usr/share/emacs24/site-lisp/html-helper-mode/hhm-config hides
/usr/share/emacs/site-lisp/html-helper-mode/hhm-config
/usr/share/emacs24/site-lisp/html-helper-mode/tempo hides
/usr/share/emacs/site-lisp/html-helper-mode/tempo
/usr/share/emacs24/site-lisp/html-helper-mode/html-helper-mode hides
/usr/share/emacs/site-lisp/html-helper-mode/html-helper-mode
/usr/share/emacs24/site-lisp/html-helper-mode/visual-basic-mode hides
/usr/share/emacs/site-lisp/html-helper-mode/visual-basic-mode

Features:
(shadow sort mail-extr emacsbug message cl-macs format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mail-utils sh-script smie executable iso-transl mmm-mode mmm-univ
mmm-class mmm-region mmm-utils server paren cus-start cus-load w3m-load
mmm-auto mmm-vars mmm-compat cl gv emacs-goodies-el emacs-goodies-custom
emacs-goodies-loaddefs easy-mmode tempo url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
url-parse auth-source eieio byte-opt bytecomp byte-compile cl-extra
cl-loaddefs cl-lib cconv eieio-core gnus-util mm-util help-fns
mail-prsvr password-cache url-vars mailcap xml-parse doxymacs devhelp
time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment lisp-mode prog-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer 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 make-network-process dbusbind gfilenotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)

Memory information:
((conses 16 114935 7834)
 (symbols 48 22382 0)
 (miscs 40 51 101)
 (strings 32 23202 4636)
 (string-bytes 1 648192)
 (vectors 16 13251)
 (vector-slots 8 433598 5159)
 (floats 8 72 297)
 (intervals 56 322 0)
 (buffers 960 12)
 (heap 1024 51217 1008))

-- 
PGP-Key Fingerprint: DE88 67E6 C80F 4D55 1F9E 38A8 2AE4 FF3B 8A9F 739A
Key verfügbar unter: http://www.tamagothi.de/vorstellung/pgp-key/


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#25451: 24.5; Freeze after while-keyword in sh-mode
  2017-01-14 20:54 bug#25451: 24.5; Freeze after while-keyword in sh-mode Elias Schwerdtfeger
@ 2017-01-14 22:37 ` Noam Postavsky
  2017-01-14 23:05   ` Elias Schwerdtfeger
  0 siblings, 1 reply; 4+ messages in thread
From: Noam Postavsky @ 2017-01-14 22:37 UTC (permalink / raw)
  To: Elias Schwerdtfeger; +Cc: 25451

On Sat, Jan 14, 2017 at 3:54 PM, Elias Schwerdtfeger
<nachtwaechter@tamagothi.de> wrote:
>
> While typing the following, rather ordinary shell script in sh-mode,
> Emacs freezes and consumes full CPU. I had to kill the process.
>
> --- snip ---
> #!/bin/sh
> ########################################################################
> #
> # location-cascade
> # $Id$
> #
> # Requires 'lynx'
> #
> ########################################################################
>
> # User-agent
> # internet exploiter 10 for best results from spammy sites ;)
> UA='Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)'
>
> httpcode=0
> uri=$1
> while
> --- snip ---
>
> The bug is fully reproducible after recover-this-buffer.

I'm sure what this means, and I'm not able to reproduce this.

Is this reproducible from emacs -Q?
Can you reproduce it by just copying that text into a sh-mode buffer,
or does it only happen while typing?
Can you get a backtrace if you send SIGUSR2 to Emacs when it's stuck?





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#25451: 24.5; Freeze after while-keyword in sh-mode
  2017-01-14 22:37 ` Noam Postavsky
@ 2017-01-14 23:05   ` Elias Schwerdtfeger
  2017-01-15  4:03     ` npostavs
  0 siblings, 1 reply; 4+ messages in thread
From: Elias Schwerdtfeger @ 2017-01-14 23:05 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 25451


[-- Attachment #1.1: Type: text/plain, Size: 1200 bytes --]

Am 14.01.2017 um 23:37 schrieb Noam Postavsky:
> I'm sure what this means, and I'm not able to reproduce this.
>

That's really strange. I can't reproduce it now.

A few hours ago I reproduced the bug five times, before I decided to
file it as the first bug I found in nearly twenty years. Of course I
killed emacs every time, before I used text-mode.

It is not as simple as I thought first, and together with its
reproducibility any chance of analyzing and fixing the bug has gone. I
suggest closing this issue.

> Can you reproduce it by just copying that text into a sh-mode buffer,
> or does it only happen while typing?

The first time I encountered the problem, it happened while I was
typing. In all of my reproductions it happened after opening or
recovering the file, when the mark reached the line with 'while'.

Both is possible without freezing Emacs now, and I don't know why. Today
is a good day for a RAM check.

(Sometimes, that data processing is eerily voodoo-like and noone
understands what is going on.)

-- 
PGP-Key Fingerprint: DE88 67E6 C80F 4D55 1F9E 38A8 2AE4 FF3B 8A9F 739A
Key verfügbar unter: http://www.tamagothi.de/vorstellung/pgp-key/


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#25451: 24.5; Freeze after while-keyword in sh-mode
  2017-01-14 23:05   ` Elias Schwerdtfeger
@ 2017-01-15  4:03     ` npostavs
  0 siblings, 0 replies; 4+ messages in thread
From: npostavs @ 2017-01-15  4:03 UTC (permalink / raw)
  To: Elias Schwerdtfeger; +Cc: 25451

tags 25451 unreproducible
close 25451
quit

Elias Schwerdtfeger <nachtwaechter@tamagothi.de> writes:

> Am 14.01.2017 um 23:37 schrieb Noam Postavsky:
>> I'm sure what this means, and I'm not able to reproduce this.
>>
>
> That's really strange. I can't reproduce it now.
>
> A few hours ago I reproduced the bug five times, before I decided to
> file it as the first bug I found in nearly twenty years. Of course I
> killed emacs every time, before I used text-mode.
>
> It is not as simple as I thought first, and together with its
> reproducibility any chance of analyzing and fixing the bug has gone. I
> suggest closing this issue.

Ok, closing as unreproducible.

>
>> Can you reproduce it by just copying that text into a sh-mode buffer,
>> or does it only happen while typing?
>
> The first time I encountered the problem, it happened while I was
> typing. In all of my reproductions it happened after opening or
> recovering the file, when the mark reached the line with 'while'.
>
> Both is possible without freezing Emacs now, and I don't know why. Today
> is a good day for a RAM check.

Well, the symptoms suggest an infinite loop during fontification.  Do
report back if you can find a way to reproduce it consistently.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-15  4:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-14 20:54 bug#25451: 24.5; Freeze after while-keyword in sh-mode Elias Schwerdtfeger
2017-01-14 22:37 ` Noam Postavsky
2017-01-14 23:05   ` Elias Schwerdtfeger
2017-01-15  4:03     ` npostavs

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.