From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.bugs Subject: bug#25279: 26.0.50; Slowdown/crash on certain characters Date: Mon, 26 Dec 2016 21:21:57 +0000 Message-ID: References: <83vau6wi7r.fsf@gnu.org> <83tw9qwh4z.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1482787398 28212 195.159.176.226 (26 Dec 2016 21:23:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Dec 2016 21:23:18 +0000 (UTC) Cc: 25279@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 26 22:23:11 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLcjd-0005oN-0v for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Dec 2016 22:23:09 +0100 Original-Received: from localhost ([::1]:51746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLcjf-0007el-Om for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Dec 2016 16:23:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLcjZ-0007eU-AA for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 16:23:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLcjW-0001MK-5E for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 16:23:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40652) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cLcjV-0001MC-Vr for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 16:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cLcjV-00007x-Qu for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 16:23:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Richard Copley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Dec 2016 21:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25279 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25279-submit@debbugs.gnu.org id=B25279.1482787355449 (code B ref 25279); Mon, 26 Dec 2016 21:23:01 +0000 Original-Received: (at 25279) by debbugs.gnu.org; 26 Dec 2016 21:22:35 +0000 Original-Received: from localhost ([127.0.0.1]:56051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLcj4-00007A-GJ for submit@debbugs.gnu.org; Mon, 26 Dec 2016 16:22:34 -0500 Original-Received: from mail-vk0-f43.google.com ([209.85.213.43]:36521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLcj2-00006y-U0 for 25279@debbugs.gnu.org; Mon, 26 Dec 2016 16:22:33 -0500 Original-Received: by mail-vk0-f43.google.com with SMTP id p9so203648390vkd.3 for <25279@debbugs.gnu.org>; Mon, 26 Dec 2016 13:22:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=o+Fpt1h1Og7lU5hnTTHHvG+i910Jcz/S6DzQVL0cdz4=; b=HzSsHKzp7G3Szq2/EqdLlSjbhkuyqeFEjpPYrbFoBBA9lBgZ95ZOnVhc9dbG/F7EtT jErpXRnhUd0VDrQ4cyzJwRcLSprhPU1EFF8vabVqJgoTOu48jp9xoKUMv1USGYKUp30C YgNEi7OAZp8+Lm/EWU6G6mw10m1x0gB4hC7eTVy/Y5ITibgg4wTOPLr/nUctzbf7EbVg GqoCiJ7c8OVPvETk6j4AaQJ7KdYWnrxS6H2v6LINuRfqetrUrY+s3yadLhmr79QuOMGr JhQnIHbiaCY7R8J/JgzDyUpnwh2Lcge7J16VdY+VUzDHWpLsUCWj4VuXpzoAHJdg0giQ 0kcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=o+Fpt1h1Og7lU5hnTTHHvG+i910Jcz/S6DzQVL0cdz4=; b=GtylRf5AXEDPh6A49itsZkyQ7JB/orFesPcJ+fzx2Xte1aqeJ94sHjBe32A6im37i/ 8RKcRfZQsXgiLOqjRlpnA7Vl4kPLcMIcsFFOCuJRdm+ecp1vO6ZKX0o02OTJOV5fi88/ MNo1xpgPrBK2OwaYjiQknmqryihrAR3NtGpH8Tkdb+JVwr2Pt4TJeh1Gzx2iBMLOE98K 9kFEoL1zfjNpY2ALkn7LKZh6r5OwVxhnN1tZ7y5Ch2Az5ugDDhaCQ1g9QzBDdSRnkkuJ 1uuG1A4FxPzb2iziv85TQoJ+e5tRTpB6xigJpJQB4VACBKdi/JcHMVLOYsmeR4scvO7k fO6w== X-Gm-Message-State: AIkVDXJKwVbvghrUYvb3gxyOFcwdAVTA0cFnj3agzudTGXKE/h3y2M3DJdfg/GrucSDd2tiOUveWACEztIM+FA== X-Received: by 10.31.152.67 with SMTP id a64mr10041599vke.79.1482787347347; Mon, 26 Dec 2016 13:22:27 -0800 (PST) Original-Received: by 10.176.71.29 with HTTP; Mon, 26 Dec 2016 13:21:57 -0800 (PST) In-Reply-To: <83tw9qwh4z.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:127469 Archived-At: On 26 December 2016 at 20:49, Eli Zaretskii wrote: >> From: Richard Copley >> Date: Mon, 26 Dec 2016 20:40:42 +0000 >> Cc: 25279@debbugs.gnu.org >> >> > Because you don't have Symbola installed, I guess. The fonts Emacs >> > finds for displaying these characters all have non-Unicode registry >> > fields, and that causes Emacs to desperately look for a Unicode font >> > each time it needs to display one of these characters. >> >> OK, thanks, but I don't quite follow, sorry. Unless you're saying there's a >> non-desperate mechanism that's usually used but which fails unless a >> font with a Unicode registry field is found for the character? > > When Emacs doesn't find a font with a Unicode registry, it looks in > many fonts trying many alternative registries. Each font is tried > twice, ones with the Uniscribe back-end, the other one with the GDI > back-end. All of that does a lot of consing, so the next GC comes > soon, and compacts font caches by deleting all that information. Then > the next time redisplay kicks in, it searches all of those fonts > again, and again conses a lot, which again causes GC. Etc. etc. > >> Commendably thorough, but causes the editor to grind to a halt and crash >> in some circumstances. > > A crash shouldn't happen in any case, so if you can show a recipe and > a backtrace, maybe this could be fixed. > > Thanks. Reproducing the slowness and high CPU consumption is easy. The "crash" I referred to is probably better termed a "hang" (as far as I can see an indefinite one), sorry. I don't know a simple recipe, but if you use Emacs in this state for long enough, it usually hangs eventually. Recipe: Uninstall Symbola (but perhaps other font changes are required). Run emacs -Q. M-x insert-char RET MUSIC SPC FLAT SPC SIGN RET M-x insert-char RET RIGHTWARDS SPC DOUBLE SPC ARROW RET C-b ;; place point before the arrow M-x describe-char RET ;; display a few more arrows Move point around the scratch buffer and observe that moving past the FLAT character is slow. Switch to the describe-char buffer and observe that moving point past the FLAT character is slow, and scrolling is slow. Keep doing stuff in that Emacs session until it hangs and stops responding. This can take some time and might never happen, but there doesn't seem to be any particular "stuff" that triggers it. Switching away to a different task for a few minutes and back again sometimes does it. Below are C call stacks obtained from a hung emacs process by attaching gdb to it. Possibly a clue: While I had the hung emacs process stopped in GDB I started a new Emacs process to edit this email and the new Emacs was also horribly slow! When I killed the process in the debugger, the new Emacs recovered to normal speed. (gdb) thread apply all bt full Thread 6 (Thread 8808.0x304): #0 0x00007ffc3eb69921 in ntdll!DbgBreakPoint () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #1 0x00007ffc3eb919ba in ntdll!DbgUiRemoteBreakin () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #2 0x00007ffc3c038364 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll No symbol table info available. #3 0x00007ffc3eb270d1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #4 0x0000000000000000 in ?? () No symbol table info available. Backtrace stopped: previous frame inner to this frame (corrupt stack?) Thread 5 (Thread 8808.0x20): #0 0x00007ffc3eb698a4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #1 0x00007ffc3eaf352e in ntdll!RtlReleaseSRWLockExclusive () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #2 0x00007ffc3c038364 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll No symbol table info available. #3 0x00007ffc3eb270d1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #4 0x0000000000000000 in ?? () No symbol table info available. Backtrace stopped: previous frame inner to this frame (corrupt stack?) Thread 4 (Thread 8808.0xe2c): #0 0x00007ffc3eb698a4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #1 0x00007ffc3eaf352e in ntdll!RtlReleaseSRWLockExclusive () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #2 0x00007ffc3c038364 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll No symbol table info available. #3 0x00007ffc3eb270d1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #4 0x0000000000000000 in ?? () No symbol table info available. Backtrace stopped: previous frame inner to this frame (corrupt stack?) Thread 3 (Thread 8808.0x2bfc): #0 0x00007ffc3eb69844 in ntdll!ZwWaitForAlertByThreadId () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #1 0x00007ffc3eaefa87 in ntdll!RtlpUnWaitCriticalSection () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #2 0x00007ffc3eaef98e in ntdll!RtlpUnWaitCriticalSection () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #3 0x00007ffc3eaef81f in ntdll!RtlpUnWaitCriticalSection () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #4 0x00007ffc3eaf0ce4 in ntdll!RtlEnterCriticalSection () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #5 0x00007ffc3eaf0c10 in ntdll!RtlEnterCriticalSection () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #6 0x0000000400216a9b in post_msg () No symbol table info available. #7 0x00000004001f1920 in post_character_message () No symbol table info available. #8 0x00000004001fc2b6 in w32_wnd_proc () No symbol table info available. #9 0x00007ffc3dbe1c24 in USER32!CallWindowProcW () from C:\WINDOWS\System32\user32.dll No symbol table info available. #10 0x00007ffc3dbe156c in USER32!DispatchMessageW () from C:\WINDOWS\System32\user32.dll No symbol table info available. #11 0x00000004001f9dc3 in w32_msg_pump.isra () No symbol table info available. #12 0x00000004001fa430 in w32_msg_worker () No symbol table info available. #13 0x00007ffc3c038364 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll No symbol table info available. #14 0x00007ffc3eb270d1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #15 0x0000000000000000 in ?? () No symbol table info available. Backtrace stopped: previous frame inner to this frame (corrupt stack?) Thread 2 (Thread 8808.0x2860): #0 0x00007ffc3eb66754 in ntdll!ZwDelayExecution () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #1 0x00007ffc3bb6c4a7 in SleepEx () from C:\WINDOWS\System32\KernelBase.dll No symbol table info available. #2 0x000000040022fad9 in timer_loop () No symbol table info available. #3 0x00007ffc3c038364 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll No symbol table info available. #4 0x00007ffc3eb270d1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll No symbol table info available. #5 0x0000000000000000 in ?? () No symbol table info available. Backtrace stopped: previous frame inner to this frame (corrupt stack?) Thread 1 (Thread 8808.0x2cf8): #0 0x00007ffc3c0196a4 in win32u!NtUserSetMenu () from C:\WINDOWS\System32\win32u.dll No symbol table info available. #1 0x00000004002031ad in set_frame_menubar () No symbol table info available. #2 0x00000004000229c0 in update_menu_bar.part () No symbol table info available. #3 0x0000000400051e21 in redisplay_internal () No symbol table info available. #4 0x0000000400054de5 in redisplay_preserve_echo_area () No symbol table info available. #5 0x000000040000cf52 in sit_for () No symbol table info available. #6 0x00000004000f31c9 in command_loop_1 () No symbol table info available. #7 0x0000000400175809 in internal_condition_case () No symbol table info available. #8 0x00000004000e1614 in command_loop_2 () No symbol table info available. #9 0x00000004001756f7 in internal_catch () No symbol table info available. #10 0x00000004000e14f3 in command_loop () No symbol table info available. #11 0x00000004000e8f94 in recursive_edit_1 () No symbol table info available. #12 0x000000040011c221 in read_minibuf () No symbol table info available. #13 0x000000040011cbad in Fread_from_minibuffer () No symbol table info available. #14 0x0000000400177c04 in Ffuncall () No symbol table info available. #15 0x00000004001c3e56 in exec_byte_code () No symbol table info available. #16 0x000000040017747d in funcall_lambda () No symbol table info available. #17 0x00000004001778a1 in Ffuncall () No symbol table info available. #18 0x000000040011ac19 in Fcompleting_read () No symbol table info available. #19 0x0000000400177cf1 in Ffuncall () No symbol table info available. #20 0x00000004001c3e56 in exec_byte_code () No symbol table info available. #21 0x000000040017747d in funcall_lambda () No symbol table info available. #22 0x00000004001778a1 in Ffuncall () No symbol table info available. #23 0x00000004001c3e56 in exec_byte_code () No symbol table info available. #24 0x00000004001c68be in Fbyte_code () No symbol table info available. #25 0x0000000400176b42 in eval_sub () No symbol table info available. #26 0x000000040017c96b in Feval () No symbol table info available. #27 0x0000000400172dca in Fcall_interactively () No symbol table info available. #28 0x0000000400177c89 in Ffuncall () No symbol table info available. #29 0x00000004001c3e56 in exec_byte_code () No symbol table info available. #30 0x000000040017747d in funcall_lambda () No symbol table info available. #31 0x00000004001778a1 in Ffuncall () No symbol table info available. #32 0x0000000400177d8d in call1 () No symbol table info available. #33 0x00000004000f291f in command_loop_1 () No symbol table info available. #34 0x0000000400175809 in internal_condition_case () No symbol table info available. #35 0x00000004000e1614 in command_loop_2 () No symbol table info available. #36 0x00000004001756f7 in internal_catch () No symbol table info available. #37 0x00000004000e15c9 in command_loop () No symbol table info available. #38 0x00000004000e62c4 in Frecursive_edit () No symbol table info available. #39 0x000000040026e699 in main () No symbol table info available.