From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 01 17:59:15 2012 Received: (at submit) by debbugs.gnu.org; 1 Sep 2012 21:59:15 +0000 Received: from localhost ([127.0.0.1]:33312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T7vik-00029a-4j for submit@debbugs.gnu.org; Sat, 01 Sep 2012 17:59:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55724) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T7vif-00029R-I3 for submit@debbugs.gnu.org; Sat, 01 Sep 2012 17:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T7vhI-00046z-Pa for submit@debbugs.gnu.org; Sat, 01 Sep 2012 17:57:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:60438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7vhI-00046u-MJ for submit@debbugs.gnu.org; Sat, 01 Sep 2012 17:57:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7vhH-0004yC-20 for bug-gnu-emacs@gnu.org; Sat, 01 Sep 2012 17:57:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T7vhE-00046S-UM for bug-gnu-emacs@gnu.org; Sat, 01 Sep 2012 17:57:42 -0400 Received: from forward16.mail.yandex.net ([95.108.253.141]:38081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7vhE-00046L-Db for bug-gnu-emacs@gnu.org; Sat, 01 Sep 2012 17:57:40 -0400 Received: from smtp19.mail.yandex.net (smtp19.mail.yandex.net [95.108.252.19]) by forward16.mail.yandex.net (Yandex) with ESMTP id 8D5CFD20C8E for ; Sun, 2 Sep 2012 01:57:35 +0400 (MSK) Received: from smtp19.mail.yandex.net (localhost [127.0.0.1]) by smtp19.mail.yandex.net (Yandex) with ESMTP id 7960FBE003E for ; Sun, 2 Sep 2012 01:57:35 +0400 (MSK) Received: from 5x166x243x132.dynamic.spb.ertelecom.ru (5x166x243x132.dynamic.spb.ertelecom.ru [5.166.243.132]) by smtp19.mail.yandex.net (nwsmtp/Yandex) with ESMTP id vYJGUwfa-vYJevfJ5; Sun, 2 Sep 2012 01:57:35 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1346536655; bh=+P0wGU9bczVA+HBlAehZ2Sn6SqbcVvNvXEpwUGd62Y8=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Content-Transfer-Encoding; b=fBg/4+h1HRqXISTDggQcfl1oPm1FgIFoheW0zzzms9l907ZSBNw8O6bU0FYsvH6vw PCmDR4gUl6pJd9yhtHp7haI4FsZ5gj6E8wTltsgMHbtcR0g6fma/7+wK1n1u9XFvK9 dpoYVt6fgzAhrbGWvgdecARtbs1O24Ncl02FyCp4= Message-ID: <504284CE.3040203@yandex.ru> Date: Sun, 02 Sep 2012 01:57:34 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: 24.2.50; js2-mode freezes on current trunk Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) js2-mode freezes during editing in some buffers. This has been a long-standing complaint on Mac OS X port, but now it affect Linux and Windows users too, see https://github.com/mooz/js2-mode/issues/49 Bisecting the Bazaar history (on a Windows machine) points to the month-old commit no 109470, which adds one line in `timer_check_2'. Here's the timer-scheduling function from js2-mode: (defun js2-mode-reset-timer () "Cancel any existing parse timer and schedule a new one." (if js2-mode-parse-timer (cancel-timer js2-mode-parse-timer)) (setq js2-mode-parsing nil) (setq js2-mode-parse-timer (run-with-idle-timer js2-idle-timer-delay nil #'js2-mode-idle-reparse (current-buffer)))) It's only called from an after-change function and from a `js2-mode-idle-reparse' callee, in case parsing has been interrupted. To handle interruptions, the parser code periodically calls (input-pending-p), and when it's true, aborts and reschedules. Any ideas? In GNU Emacs 24.2.50.1 (i386-mingw-nt6.1.7601) of 2012-09-01 on SOL Bzr revision: 109843 rudalics@gmx.at-20120901164709-puy2rq2g4zsjwjee Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --with-gcc (3.4) --cflags -IJ:/Apps/system/gnuwin32/include' Important settings: value of $EMACSDATA: C:/Users/gutov/vc/emacs-bzr/trunk/etc value of $EMACSDOC: C:/Users/gutov/vc/emacs-bzr/trunk/etc value of $EMACSLOADPATH: C:/Users/gutov/vc/emacs-bzr/trunk/site-lisp;C:/Users/gutov/vc/emacs-bzr/trunk/../site-lisp;C:/Users/gutov/vc/emacs-bzr/trunk/lisp;C:/Users/gutov/vc/emacs-bzr/trunk/leim value of $EMACSPATH: C:/Users/gutov/vc/emacs-bzr/trunk/bin value of $LANG: RUS locale-coding-system: cp1251 default enable-multibyte-characters: t Major mode: Bzr-Log-View Minor modes in effect: recentf-mode: t helm-dired-mode: Enable helm completion in Dired functions. Bindings affected are C, R, S, H. This is deprecated for Emacs24+ users, use `helm-mode' instead. shell-dirtrack-mode: t helm-match-plugin-mode: t global-undo-tree-mode: t undo-tree-mode: t global-diff-hl-mode: t diff-auto-refine-mode: t savehist-mode: t yas/global-mode: t yas/minor-mode: t global-auto-revert-mode: t cua-mode: t global-ethan-wspace-mode: t global-auto-complete-mode: t autopair-global-mode: t ido-ubiquitous-mode: t ido-everywhere: t show-paren-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x 3 C-; \ . e r b SPC SPC SPC SPC SPC SPC SPC C-z SPC C-z SPC % % % % ? % % % % % C-x 0 C-c C-c C-c C-c C-x 3 M-x r e p o r t - e m a c s Recent messages: Winner undo (1 / 8) Finding changes in c:/Users/gutov/vc/emacs-bzr/trunk/src/keyboard.c... byte-code: End of buffer [8 times] byte-code: Beginning of buffer [7 times] Undo branch point! Winner undo (1 / 15) Winner undo (2 / 15) Winner undo (3 / 15) Winner undo (4 / 14) Load-path shadows: c:/Users/gutov/.emacs.d/elpa/magit-20120616/.dir-locals hides c:/Users/gutov/.emacs.d/elpa/sunrise-commander-20120705/.dir-locals c:/Users/gutov/.emacs.d/elpa/magit-20120616/.dir-locals hides c:/Users/gutov/vc/emacs-bzr/trunk/lisp/gnus/.dir-locals Features: (shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils js json imenu css-mode ruby-electric ruby-tools inf-ruby ruby-mode mmm-mode mmm-univ mmm-class subword mmm-erb derived mmm-region mmm-utils sgml-mode whitespace add-log log-view pcvs-util vc-bzr cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs unsafep flyspell ispell recentf tree-widget wid-edit bow helm-files image-dired tramp tramp-compat tramp-loaddefs shell pcomplete format-spec dired-x dired-aux thingatpt helm-tags helm-locate helm-help helm-grep helm-regexp grep helm-external helm-bookmark helm-buffers helm-elscreen helm-utils compile comint ansi-color helm-match-plugin helm helm-config elisp-slime-nav etags paredit saveplace undo-tree diff diff-hl face-remap vc-hg vc-git vc ediff-merg ediff-diff ediff-wind ediff-help ediff-util ediff-mult ediff-init ediff vc-dispatcher diff-mode savehist yasnippet autorevert cua-base winner point-stack .emacs-loaddefs cyril-util devenv ethan-wspace pos-tip ac-slime auto-complete-config auto-complete popup eproject-extras ibuf-macs ibuf-ext ibuffer iswitchb eproject esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg eldoc esh-groups eshell esh-module esh-mode esh-util progmodes dropdown-list mmm mmm-auto mmm-vars mmm-compat autopair easy-mmode keys switch-window quail help-mode easymenu hippie dired winring ring transpose-frame iflipb misc prefs defuns birds-of-paradise-plus-theme-autoloads coffee-mode-autoloads eldoc-eval-autoloads findr-autoloads gist-autoloads gh-autoloads inf-ruby-autoloads inflections-autoloads iy-go-to-char-autoloads logito-autoloads move-text-autoloads pcache-autoloads finder-inf rainbow-mode-autoloads ruby-electric-autoloads ruby-tools-autoloads starter-kit-bindings-autoloads windmove starter-kit-lisp-autoloads cl-macs gv elisp-slime-nav-autoloads starter-kit-autoloads edmacro kmacro smex cl cl-lib starter-kit-misc warnings ffap url-parse auth-source eieio byte-opt bytecomp byte-compile cconv macroexp gnus-util mm-util mail-prsvr password-cache url-vars ido-ubiquitous ido paren starter-kit-defuns uniquify advice help-fns advice-preload magit-autoloads ido-ubiquitous-autoloads smex-autoloads find-file-in-project-autoloads idle-highlight-mode-autoloads paredit-autoloads sunrise-commander-autoloads switch-window-autoloads tango-2-theme-autoloads twilight-bright-theme-autoloads typing-autoloads undo-tree-autoloads volatile-highlights-autoloads wgrep-autoloads yaml-mode-autoloads package time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-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 button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 01 21:43:29 2012 Received: (at 12326) by debbugs.gnu.org; 2 Sep 2012 01:43:30 +0000 Received: from localhost ([127.0.0.1]:33487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T7zDl-0007CU-CQ for submit@debbugs.gnu.org; Sat, 01 Sep 2012 21:43:29 -0400 Received: from forward4.mail.yandex.net ([77.88.46.9]:40729) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T7zDh-0007CK-6o for 12326@debbugs.gnu.org; Sat, 01 Sep 2012 21:43:27 -0400 Received: from smtp4.mail.yandex.net (smtp4.mail.yandex.net [77.88.46.104]) by forward4.mail.yandex.net (Yandex) with ESMTP id 0C2ED1BC157F for <12326@debbugs.gnu.org>; Sun, 2 Sep 2012 05:41:58 +0400 (MSK) Received: from smtp4.mail.yandex.net (localhost [127.0.0.1]) by smtp4.mail.yandex.net (Yandex) with ESMTP id EE2555C03E5 for <12326@debbugs.gnu.org>; Sun, 2 Sep 2012 05:41:57 +0400 (MSK) Received: from 5x166x243x132.dynamic.spb.ertelecom.ru (5x166x243x132.dynamic.spb.ertelecom.ru [5.166.243.132]) by smtp4.mail.yandex.net (nwsmtp/Yandex) with ESMTP id fv982uw5-fv9WZK1T; Sun, 2 Sep 2012 05:41:57 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1346550117; bh=CCZaLm8ZfNeyiE0VW7BI1KYMNI08JRvlKJzEYMygjoo=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=ZwAB9hAoZo6maMMn3S0SFML3+iPzkqZfaqJQ13x34XKms0quB+BbYlJAtiqXMhoev ew64XZ2dM0pE3LirgfSHU0UUXXWDakx4+SPU9XusQBtIx66Qa8KAQkf2expJwW6bFW 94T/SxZIRpmZNE22njb7R7n0/3WyiY22HeOO0Gs8= Message-ID: <5042B966.9060804@yandex.ru> Date: Sun, 02 Sep 2012 05:41:58 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: 12326@debbugs.gnu.org Subject: Re: bug#12326: (24.2.50; js2-mode freezes on current trunk) References: <504284CE.3040203@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12326 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Some further analysis showed that the freeze is caused by the infinite mutual loop between `js2-do-parse' and `js2-mode-reset-timer'. Looks like it goes like this: 1. I enter some input. 2. js2-mode-edit is called; it calls js2-mode-reset-timer 3. js2-mode-reset-timer schedules js2-mode-idle-reparse to run 4. js2-mode-idle-reparse calls js2-do-parse 5. If I manage to press a button while js2-do-parse is still running, and it reaches an (input-pending-p), it stops parsing and calls js2-mode-reset-timer. 6. Apparently, at this point the timer code still thinks we're idle, because it immediately calls js2-mode-idle-reparse. So goto 4. While (input-pending-p) still returns true. If I manually inline `run-with-idle-timer' into `js2-mode-reset-timer' and change the DONT-WAIT `timer-activate-when-idle' argument to nil, it fixes the problem. Like this: (defun js2-mode-reset-timer () "Cancel any existing parse timer and schedule a new one." (if js2-mode-parse-timer (cancel-timer js2-mode-parse-timer)) (setq js2-mode-parsing nil) (let ((timer (timer-create))) (setq js2-mode-parse-timer timer) (timer-set-function timer 'js2-mode-idle-reparse (list (current-buffer))) (timer-set-idle-time timer js2-idle-timer-delay) (timer-activate-when-idle timer))) Is this a problem in Emacs or consumer code? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 02 04:37:28 2012 Received: (at 12326) by debbugs.gnu.org; 2 Sep 2012 08:37:28 +0000 Received: from localhost ([127.0.0.1]:33853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T85gM-0003DW-KP for submit@debbugs.gnu.org; Sun, 02 Sep 2012 04:37:28 -0400 Received: from mailout.attendit.se ([83.140.103.4]:52454) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T85gJ-0003DL-9Y for 12326@debbugs.gnu.org; Sun, 02 Sep 2012 04:37:25 -0400 Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.attendit.se (Postfix) with ESMTP id 7A191500D4 for <12326@debbugs.gnu.org>; Sun, 2 Sep 2012 10:30:11 +0200 (CEST) Received: (qmail 2392 invoked by uid 89); 2 Sep 2012 08:35:34 -0000 Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 2 Sep 2012 08:35:34 -0000 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 8B3FE7FA05E; Sun, 2 Sep 2012 10:35:54 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) Subject: Re: bug#12326: 24.2.50; js2-mode freezes on current trunk From: =?iso-8859-1?Q?Jan_Dj=E4rv?= In-Reply-To: <504284CE.3040203@yandex.ru> Date: Sun, 2 Sep 2012 10:35:54 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <44BE28C5-1BC9-4346-873D-84D052F2A338@swipnet.se> References: <504284CE.3040203@yandex.ru> To: Dmitry Gutov X-Mailer: Apple Mail (2.1486) X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12326 Cc: 12326@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Hello. 1 sep 2012 kl. 23:57 skrev Dmitry Gutov : > js2-mode freezes during editing in some buffers. >=20 > This has been a long-standing complaint on Mac OS X port, but now it > affect Linux and Windows users too, see > https://github.com/mooz/js2-mode/issues/49 >=20 > Bisecting the Bazaar history (on a Windows machine) points to the > month-old commit no 109470, which adds one line in `timer_check_2'. >=20 The reason for that line is to make timer_check return the time to the = next timeout, not the time to some random timer. When a dialog i shown, the time to the next time is checked with = timer_check and when that time is reached, the timer is run. If = timer_check returns an out of order time, timers are not run when they = should be. I'm surprised that js2 functions with undefined behaviour and not with = defined behaviour. Jan D. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 02 09:05:31 2012 Received: (at 12326) by debbugs.gnu.org; 2 Sep 2012 13:05:31 +0000 Received: from localhost ([127.0.0.1]:34089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T89rj-0001ge-ST for submit@debbugs.gnu.org; Sun, 02 Sep 2012 09:05:30 -0400 Received: from forward8.mail.yandex.net ([77.88.61.38]:52362) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T89re-0001gS-Lf for 12326@debbugs.gnu.org; Sun, 02 Sep 2012 09:05:25 -0400 Received: from smtp8.mail.yandex.net (smtp8.mail.yandex.net [77.88.61.54]) by forward8.mail.yandex.net (Yandex) with ESMTP id 0FEBAF60D0B; Sun, 2 Sep 2012 17:03:54 +0400 (MSK) Received: from smtp8.mail.yandex.net (localhost [127.0.0.1]) by smtp8.mail.yandex.net (Yandex) with ESMTP id E0A471B60514; Sun, 2 Sep 2012 17:03:53 +0400 (MSK) Received: from 5x166x243x132.dynamic.spb.ertelecom.ru (5x166x243x132.dynamic.spb.ertelecom.ru [5.166.243.132]) by smtp8.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 3qL0EJmV-3rLmdjHp; Sun, 2 Sep 2012 17:03:53 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1346591033; bh=xCPoZ+f+Ls/2vTM4ZHL9KSpSpQb2Xxp3BuFrHhXUI4c=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=Rx5uOFMd9ZqHFexEDLJFWLlgkcxafpFwxGbKR9qbltnGUe7XSU679DsxZ/zAw9cie 39Ips71Uj5UTYbU0PrtP5pPNUY5G4z46AgKjX4IGvWRb1p3IMz6Nx8yKHqTXDmKBe8 EbFiLkcCzyVkv+2Zsmebhv+X/xDYGz/XMCQ4GVRM= Message-ID: <50435939.6070104@yandex.ru> Date: Sun, 02 Sep 2012 17:03:53 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Subject: Re: bug#12326: 24.2.50; js2-mode freezes on current trunk References: <504284CE.3040203@yandex.ru> <44BE28C5-1BC9-4346-873D-84D052F2A338@swipnet.se> In-Reply-To: <44BE28C5-1BC9-4346-873D-84D052F2A338@swipnet.se> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12326 Cc: 12326@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi Jan, On 02.09.2012 12:35, Jan Dj=E4rv wrote: > 1 sep 2012 kl. 23:57 skrev Dmitry Gutov : > >> js2-mode freezes during editing in some buffers. >> >> This has been a long-standing complaint on Mac OS X port, but now it >> affect Linux and Windows users too, see >> https://github.com/mooz/js2-mode/issues/49 >> >> Bisecting the Bazaar history (on a Windows machine) points to the >> month-old commit no 109470, which adds one line in `timer_check_2'. >> > > The reason for that line is to make timer_check return the time to the = next timeout, not the time to some random timer. How was it random? AFAICT, your line just breaks out of the "while" loop=20 when a ripe timer is found, and so `timer_check_2' returns 0 time, and=20 its caller (timer_check) calls it again. And before that the while loop in `timer_check_2' just ran until it=20 reached the end of timers lists, or found a non-ripe timer. I think the main difference is, previously, `timer_check_2' was called=20 only once, so `now' and `idleness_now' were calculated at that time, and=20 all timers were checked for ripeness against those values. Now `now' and `idleness_now' are recalculated after each time a ripe=20 timer fires, which is arguably more correct (some time has passed, after=20 all), but doesn't leave the room for the event loop to detect new=20 keypresses and update `timer_idleness_start_time'. > When a dialog i shown, the time to the next time is checked with timer_= check and when that time is reached, the timer is run. If timer_check re= turns an out of order time, timers are not run when they should be. Didn't they they just run a little late, due to the time values, against=20 which the difference was calculated, being slightly outdated? > I'm surprised that js2 functions with undefined behaviour and not with = defined behaviour. Looks like the previous behavior was more conservative. I think js2-mode is only unusual in that it may schedule a new timer=20 from within a timer callback function. --Dmitry From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 02 12:08:05 2012 Received: (at 12326) by debbugs.gnu.org; 2 Sep 2012 16:08:05 +0000 Received: from localhost ([127.0.0.1]:34682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T8CiS-0006jV-Om for submit@debbugs.gnu.org; Sun, 02 Sep 2012 12:08:05 -0400 Received: from mailout.attendit.se ([83.140.103.4]:50958) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T8CiP-0006j4-Tw for 12326@debbugs.gnu.org; Sun, 02 Sep 2012 12:08:03 -0400 Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.attendit.se (Postfix) with ESMTP id 6C4BE5009B for <12326@debbugs.gnu.org>; Sun, 2 Sep 2012 18:00:48 +0200 (CEST) Received: (qmail 26986 invoked by uid 89); 2 Sep 2012 16:06:11 -0000 Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 2 Sep 2012 16:06:11 -0000 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 832B07FA05E; Sun, 2 Sep 2012 18:06:31 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) Subject: Re: bug#12326: 24.2.50; js2-mode freezes on current trunk From: =?iso-8859-1?Q?Jan_Dj=E4rv?= In-Reply-To: <50435939.6070104@yandex.ru> Date: Sun, 2 Sep 2012 18:06:30 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <2F6F9AFA-23C7-4480-BBDD-288CEB5E88C6@swipnet.se> References: <504284CE.3040203@yandex.ru> <44BE28C5-1BC9-4346-873D-84D052F2A338@swipnet.se> <50435939.6070104@yandex.ru> To: Dmitry Gutov X-Mailer: Apple Mail (2.1486) X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12326 Cc: 12326@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Hello. 2 sep 2012 kl. 15:03 skrev Dmitry Gutov : > Hi Jan, >=20 > On 02.09.2012 12:35, Jan Dj=E4rv wrote: >> 1 sep 2012 kl. 23:57 skrev Dmitry Gutov : >>=20 >>> js2-mode freezes during editing in some buffers. >>>=20 >>> This has been a long-standing complaint on Mac OS X port, but now it >>> affect Linux and Windows users too, see >>> https://github.com/mooz/js2-mode/issues/49 >>>=20 >>> Bisecting the Bazaar history (on a Windows machine) points to the >>> month-old commit no 109470, which adds one line in `timer_check_2'. >>>=20 >>=20 >> The reason for that line is to make timer_check return the time to = the next timeout, not the time to some random timer. >=20 > How was it random? AFAICT, your line just breaks out of the "while" = loop when a ripe timer is found, and so `timer_check_2' returns 0 time, = and its caller (timer_check) calls it again. > And before that the while loop in `timer_check_2' just ran until it = reached the end of timers lists, or found a non-ripe timer. >=20 > I think the main difference is, previously, `timer_check_2' was called = only once, so `now' and `idleness_now' were calculated at that time, and = all timers were checked for ripeness against those values. >=20 > Now `now' and `idleness_now' are recalculated after each time a ripe = timer fires, which is arguably more correct (some time has passed, after = all), but doesn't leave the room for the event loop to detect new = keypresses and update `timer_idleness_start_time'. That is not the problem. Previously timer_check_2 found a timer to run, ran that, and continued = to search in the list. If the timer callback added a timer, it may happen that that timer is = inserted in the front of the list, and not checked by timer_check_2. Now timer_check_2 finds a timer, runs that, and then returns so = timer_check can call timer_check_2 again. This makes timer_check_2 = start over, checking from the beginning of the list. >=20 >> When a dialog i shown, the time to the next time is checked with = timer_check and when that time is reached, the timer is run. If = timer_check returns an out of order time, timers are not run when they = should be. >=20 > Didn't they they just run a little late, due to the time values, = against which the difference was calculated, being slightly outdated? The case I had was one repeating 20 second timer, and one repeating 2 = second timer. The 2 second timer would be run once, then timer_check_2 would return = the difference to the 20 second timer, thus skipping some 10 invokations = of the 2 second timer. >=20 >> I'm surprised that js2 functions with undefined behaviour and not = with defined behaviour. >=20 > Looks like the previous behavior was more conservative. And wrong. >=20 > I think js2-mode is only unusual in that it may schedule a new timer = from within a timer callback function. It may be that some timing issues in the handling of the timer lists = still remain. Jan D. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 02 13:28:50 2012 Received: (at 12326) by debbugs.gnu.org; 2 Sep 2012 17:28:50 +0000 Received: from localhost ([127.0.0.1]:34713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T8Dyc-00005N-A7 for submit@debbugs.gnu.org; Sun, 02 Sep 2012 13:28:50 -0400 Received: from forward14.mail.yandex.net ([95.108.130.92]:38615) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T8DyZ-00005E-An for 12326@debbugs.gnu.org; Sun, 02 Sep 2012 13:28:49 -0400 Received: from smtp14.mail.yandex.net (smtp14.mail.yandex.net [95.108.131.192]) by forward14.mail.yandex.net (Yandex) with ESMTP id ECCF5198107D; Sun, 2 Sep 2012 21:27:17 +0400 (MSK) Received: from smtp14.mail.yandex.net (localhost [127.0.0.1]) by smtp14.mail.yandex.net (Yandex) with ESMTP id C80CB1B60753; Sun, 2 Sep 2012 21:27:17 +0400 (MSK) Received: from 5x166x243x132.dynamic.spb.ertelecom.ru (5x166x243x132.dynamic.spb.ertelecom.ru [5.166.243.132]) by smtp14.mail.yandex.net (nwsmtp/Yandex) with ESMTP id RGZeCTnt-RHZ46Lcu; Sun, 2 Sep 2012 21:27:17 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1346606837; bh=SD5+S9QePH71Zyu0PoHsPCkL3SgdrDi69yNCsgqcezk=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=VStqEyx7UkAnact7wjUP8u+HDWz/Ze3azjOY3IZE31yDvzH0AxHVHvqGjyJIaMf+t IFLR+tiVQdyFcWU3ZTtuP8qu+nxTBAZ6ZpsEnuum56i/ihFGYk3aEtJteyjWPhpYv9 lZr83oMHmEo/hzgbKGpaLqomcC7vuFBuSHYwvmXE= Message-ID: <504396F6.1080309@yandex.ru> Date: Sun, 02 Sep 2012 21:27:18 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Subject: Re: bug#12326: 24.2.50; js2-mode freezes on current trunk References: <504284CE.3040203@yandex.ru> <44BE28C5-1BC9-4346-873D-84D052F2A338@swipnet.se> <50435939.6070104@yandex.ru> <2F6F9AFA-23C7-4480-BBDD-288CEB5E88C6@swipnet.se> In-Reply-To: <2F6F9AFA-23C7-4480-BBDD-288CEB5E88C6@swipnet.se> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12326 Cc: 12326@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 02.09.2012 20:06, Jan Dj=E4rv wrote: > That is not the problem. > Previously timer_check_2 found a timer to run, ran that, and continued = to search in the list. > If the timer callback added a timer, it may happen that that timer is i= nserted in the front of the list, and not checked by timer_check_2. I see. That's probably the reason why it worked. > Now timer_check_2 finds a timer, runs that, and then returns so timer_c= heck can call timer_check_2 again. This makes timer_check_2 start over, = checking from the beginning of the list. > >> >>> When a dialog i shown, the time to the next time is checked with time= r_check and when that time is reached, the timer is run. If timer_check = returns an out of order time, timers are not run when they should be. >> >> Didn't they they just run a little late, due to the time values, again= st which the difference was calculated, being slightly outdated? > > The case I had was one repeating 20 second timer, and one repeating 2 s= econd timer. > The 2 second timer would be run once, then timer_check_2 would return t= he difference to the 20 second timer, thus skipping some 10 invokations o= f the 2 second timer. > >> >>> I'm surprised that js2 functions with undefined behaviour and not wit= h defined behaviour. >> >> Looks like the previous behavior was more conservative. > > And wrong. > >> >> I think js2-mode is only unusual in that it may schedule a new timer f= rom within a timer callback function. > > It may be that some timing issues in the handling of the timer lists st= ill remain. Indeed. I wonder if scheduling an idle timer from within its callback=20 with `run-with-idle-timer' is supposed to work at all. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 15:08:19 2012 Received: (at control) by debbugs.gnu.org; 15 Sep 2012 19:08:19 +0000 Received: from localhost ([127.0.0.1]:35781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCxj0-0007Ee-Ne for submit@debbugs.gnu.org; Sat, 15 Sep 2012 15:08:18 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:53898) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCxiz-0007EY-Se for control@debbugs.gnu.org; Sat, 15 Sep 2012 15:08:18 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1TCxhx-0000zs-Ae for control@debbugs.gnu.org; Sat, 15 Sep 2012 15:07:13 -0400 Date: Sat, 15 Sep 2012 15:07:13 -0400 Message-Id: Subject: control message for bug 12326 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -7.4 (-------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.4 (-------) merge 12447 12326 From unknown Mon Jun 23 07:49:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 21 Oct 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator