From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#34138: 27.0.50; Delayed display of PDF file images Date: Sun, 20 Jan 2019 21:45:06 +0100 Message-ID: <87sgxnf48d.fsf@gmx.net> References: <871s58e4gh.fsf@gmx.net> <5C443CB1.3050208@gmx.at> <87h8e3h90z.fsf@gmx.net> <5C4483B7.1060604@gmx.at> <87d0orgz0a.fsf@gmx.net> <837eezbazk.fsf@gnu.org> <878szfgwdu.fsf@gmx.net> <8336pnb9cq.fsf@gnu.org> <874la3gujy.fsf@gmx.net> <831s57b7ev.fsf@gnu.org> <87zhrvfdzu.fsf@gmx.net> <83zhrv9qe5.fsf@gnu.org> NNTP-Posting-Host: ciao.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ciao.gmane.org 1548017169 204989 195.159.176.228 (20 Jan 2019 20:46:09 GMT) X-Complaints-To: usenet@ciao.gmane.org NNTP-Posting-Date: Sun, 20 Jan 2019 20:46:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 34138@debbugs.gnu.org, politza@hochschule-trier.de, tsdh@gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 20 21:46:06 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1glJyn-000rFS-16 for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Jan 2019 21:46:05 +0100 Original-Received: from localhost ([127.0.0.1]:44160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glJyw-0007dU-5l for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Jan 2019 15:46:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glJym-0007a7-B2 for bug-gnu-emacs@gnu.org; Sun, 20 Jan 2019 15:46:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glJyk-0003mv-D1 for bug-gnu-emacs@gnu.org; Sun, 20 Jan 2019 15:46:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39951) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1glJyk-0003mm-8V for bug-gnu-emacs@gnu.org; Sun, 20 Jan 2019 15:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1glJyk-0004D4-11 for bug-gnu-emacs@gnu.org; Sun, 20 Jan 2019 15:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Jan 2019 20:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34138 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 34138-submit@debbugs.gnu.org id=B34138.154801712216112 (code B ref 34138); Sun, 20 Jan 2019 20:46:01 +0000 Original-Received: (at 34138) by debbugs.gnu.org; 20 Jan 2019 20:45:22 +0000 Original-Received: from localhost ([127.0.0.1]:39229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1glJy5-0004Bm-Qd for submit@debbugs.gnu.org; Sun, 20 Jan 2019 15:45:22 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:46453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1glJy2-0004BN-1A for 34138@debbugs.gnu.org; Sun, 20 Jan 2019 15:45:19 -0500 Original-Received: from rosalinde ([92.73.79.34]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M3d9B-1h2zEy2NpR-00rHAi; Sun, 20 Jan 2019 21:45:09 +0100 In-Reply-To: <83zhrv9qe5.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 20 Jan 2019 19:42:58 +0200") X-Provags-ID: V03:K1:vCm0DgGqtPDLo9qE+lmfltsB9++I6G7YAk5xl0Iq938FhF2m0I9 FDcnRs7EtzKePGCEbNJbWDI36tSh43oP5a4j5FRtBkatXbLQN5ntSvDLzEgFeP++68bzr10 vM1HAOt07xg87S4Wzi6xyFvPY2jIYfJiXTyVZTttljxxqttbW3x3OEnjn8IhTikH5RNebC7 5MvPAp0VhUcvt6ltHLaYQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:ohXG2SRu1zA=:nwPJXCTCdoiNl80kHXlL5W gSDU+nuvWNnxEqIeD0HZFDf/7ep3epbxutEEaQeqGAOT+rqUWsK0laGQlOKfCX3U57bBfWStr beKkZLu96zL6bUoPvsn6Hqp7qm9Ju6Dtjgw4uo1ZYsXjGgb0IVlMt4JM7NNRQ7XYXeZJLsKNv 4KRATFzt7C2JiL3IsKI1MxGqoKZ5IPNvuKUNF4XIj/uRI3kB4vP7FouO6nd89HFAS4PPXiJqW mUW35GR2lP5lVg95JwmpcdJQdbbTmyGIilMcOfJLAs9GlR6qU9bdqic4FSRb+FklhLbPx/Z06 XBCLykL475POgBhtH85xhteP2Tx77twUcVVhiNM72eKV30B13XtCAb8bFf7yQGY1EEKrGEIdm u6pEeNcHPVIUqYNfGAuU9X98YQiPPl/hnGoKBtUS6ktOAvz0cBgIJR9FNR742Zb48QWRC9EG+ Sz+FJWi0Cag2YcPrgSiaBrsG6oHcr6VCWFA3tbV8rMTUc4G2bgJO9iJPTddE3MKOB5ZYkIKgw 3KbaLZ4Vhj42NvxS/pfqY500bxD/cnLQIReXhoxAmNTgAb1ur/MgLVfN8B1ySsNVX2gWIdSwJ G/i3du1bl9tUIQ091+7j3b3BdlXXMftBDeFjfIJtBTjUmoAzZcSg3GNjD48VjVGMUinIUghAL QXwiGXet+liykkSi/RIHdbyrrwpfl/jA030j79GfeUcE4zq4TpyVIprkyOGJp7uMw/dy3SdU2 O2A4WyCOFyqQzPW4owAlbX6b/nbwPxL1WzdmXcDuWdoKTFaYRQ7rvZVXD0up35dGZZtNff8I 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: 209.51.188.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:154626 Archived-At: --=-=-= Content-Type: text/plain On Sun, 20 Jan 2019 19:42:58 +0200 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: rudalics@gmx.at, 34138@debbugs.gnu.org, politza@hochschule-trier.de, >> tsdh@gnu.org >> Date: Sun, 20 Jan 2019 18:14:13 +0100 >> >> > It means, during the time of the delay, type from the shell prompt: >> > >> > $ gdb -p PID >> > >> > where PID is the numeric process-id of the Emacs process; you should >> > find that in advance, e.g. by running "ps". Once GDB starts and shows >> > its prompt, "(gdb)", type: >> > >> > (gdb) thread apply all bt >> > >> > This should show the C-level backtrace. Then: >> > >> > (gdb) source /path/to/emacs/src/.gdbinit >> > (gdb) xbacktrace >> > >> > The last command should show the Lisp-level backtrace. >> >> Ah, thanks. I started gdb from the path of the emacs executable and the >> Lisp backtrace was shown after typing "thread apply all bt"; > > Please start GDB from a directory other that the Emacs src directory, > I'd like to see the C backtrace that way. Ok, transcript attached. But now there's no Lisp backtrace (more on this below). >> FWIW, while the backtrace was being shown in the shell, the raw PDF >> changed to the image display in Emacs. > > I don't understand how could Emacs be running while GDB was showing > the backtrace. It shouldn't happen, because the executable to which > GDB is attached is supposed to be stopped in its tracks. What does > this show, after you attach GDB and GDB shows its prompt? > > (gdb) show non-stop > > It should say that non-stop mode is OFF. It did say this. And this time the Emacs display did not change until after continuing from gdb, then the PDF image was immediately displayed. >> Lisp Backtrace: >> "image-size" (0x70824720) >> 0x354bf60 PVEC_COMPILED >> "gethash" (0x70820b38) >> "pdf-cache--data-get" (0x70820d40) >> "pdf-cache-number-of-pages" (0x70820f10) >> ---Type to continue, or q to quit--- >> "terminal-live-p" (0x70820ea8) >> "framep-on-display" (0x708210b8) >> "overlayp" (0x70824718) >> 0x92591e8 PVEC_COMPILED >> "overlayp" (0x70824a48) >> 0x92591e8 PVEC_COMPILED >> "redisplay--update-region-highlight" (0x70824fd0) >> "run-hook-with-args" (0x70824fc8) >> "ignore" (0x70825310) >> "apply" (0x70825308) >> 0x9420638 PVEC_COMPILED >> "redisplay_internal (C function)" (0x0) > > This Lisp backtrace contradicts the C backtrace of the main thread: > >> Thread 1 (Thread 0x7f9109a29bc0 (LWP 5077)): >> #0 0x00007f910c590291 in __pselect (nfds=16, readfds=0x7ffc70826670, writefds=0x7ffc708265f0, exceptfds=0x0, timeout=, sigmask=) >> at ../sysdeps/unix/sysv/linux/pselect.c:69 >> #1 0x00000000005bca5d in really_call_select (arg=arg@entry=0x7ffc70826130) >> at /mnt/data/steve/git/emacs-master/src/thread.c:580 >> #2 0x0000000000542d88 in flush_stack_call_func (func=func@entry=0x5bca12 , arg=arg@entry=0x7ffc70826130) >> at /mnt/data/steve/git/emacs-master/src/alloc.c:5229 >> #3 0x00000000005bd24f in thread_select (func=, max_fds=max_fds@entry=16, rfds=rfds@entry=0x7ffc70826670, wfds=, efds=efds@entry=0x0, timeout=timeout@entry=0x7ffc708268c0, sigmask=0x0) >> at /mnt/data/steve/git/emacs-master/src/thread.c:610 >> #4 0x00000000005d7c64 in xg_select (fds_lim=16, rfds=rfds@entry=0x7ffc70826960,---Type to continue, or q to quit--- >> wfds=0x7ffc708268e0, efds=efds@entry=0x0, timeout=timeout@entry=0x7ffc708268c0, sigmask=sigmask@entry=0x0) >> at /mnt/data/steve/git/emacs-master/src/xgselect.c:117 >> #5 0x000000000059daf3 in wait_reading_process_output (time_limit=time_limit@entry=97, nsecs=nsecs@entry=0, read_kbd=-1, do_display=do_display@entry=true, wait_for_cell=wait_for_cell@entry=XIL(0), wait_proc=wait_proc@entry=0x0, just_wait_proc=0) at /mnt/data/steve/git/emacs-master/src/process.c:5405 >> #6 0x0000000000424e63 in sit_for (timeout=timeout@entry=make_number(97), reading=reading@entry=true, display_option=display_option@entry=1) >> at /mnt/data/steve/git/emacs-master/src/lisp.h:1056 >> #7 0x00000000004f769e in read_char (commandflag=1, map=map@entry=XIL(0x35f3093), prev_event=XIL(0), used_mouse_menu=used_mouse_menu@entry=0x7ffc70826d4b, end_time=end_time@entry=0x0) at /mnt/data/steve/git/emacs-master/src/lisp.h:751 >> #8 0x00000000004f81ec in read_key_sequence (keybuf=keybuf@entry=0x7ffc70826e10, prompt=prompt@entry=XIL(0), dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true, fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false) >> at /mnt/data/steve/git/emacs-master/src/lisp.h:1386 >> #9 0x00000000004f9730 in command_loop_1 () >> at /mnt/data/steve/git/emacs-master/src/lisp.h:1056 > > The C backtrace says we are idling, waiting for some input inside > pselect, while the Lisp backtrace says we are in the image-size > function, which was somehow invoked from pre-redisplay-function. I'm > confused... As mentioned and as the transcript shows, there was no Lisp backtrace this time. I then tried again, starting emacs from the shell in the emacs/src path, and the gdb session was the same as above: non-stop off, no Lisp backtrace, and emacs display changed only after continuing from gdb. Then I repeated exactly what I did for my previous post: started Emacs from the window manager menu (openbox), started gdb from the emacs executable path in the shell, and again, non-stop was off and again there was no Lisp backtrace, but this time, the buffer display did change to the PDF image while the backtrace was being shown. Maybe there's a race condition involved in the delay. I guess that doesn't diminish your confusion... Steve Berman --=-=-= Content-Type: text/plain Content-Disposition: attachment Content-Description: gdb backtrace steve [ ~ ]$ ~/build/emacs/src/emacs & [1] 5399 steve [ ~ ]$ GLib-GIO-Message: 21:02:07.387: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications. ^C steve [ ~ ]$ gdb -p 5399 GNU gdb (GDB) 8.1.1 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". Attaching to process 5399 [New LWP 5400] [New LWP 5402] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/libthread_db.so.1". 0x00007fda7ea7f291 in __pselect (nfds=16, readfds=0x7ffd68a79c30, writefds=0x7ffd68a79bb0, exceptfds=0x0, timeout=, sigmask=) at ../sysdeps/unix/sysv/linux/pselect.c:69 69 ../sysdeps/unix/sysv/linux/pselect.c: No such file or directory. (gdb) show non-stop Controlling the inferior in non-stop mode is off. (gdb) thread apply all bt Thread 3 (Thread 0x7fda79c1e700 (LWP 5402)): #0 0x00007fda7ea7cac9 in __GI___poll (fds=0x205fdc0, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29 #1 0x00007fda7fa52cbe in g_main_context_poll (priority=, n_fds=2, fds=0x205fdc0, timeout=, context=0x205d4a0) at gmain.c:4204 #2 0x00007fda7fa52cbe in g_main_context_iterate (context=0x205d4a0, block=block@entry=1, dispatch=dispatch@entry=1, self=) at gmain.c:3898 #3 0x00007fda7fa53032 in g_main_loop_run (loop=0x205ffe0) at gmain.c:4099 #4 0x00007fda7fc42a36 in gdbus_shared_thread_func (user_data=0x205d470) at gdbusprivate.c:275 #5 0x00007fda7fa79395 in g_thread_proxy (data=0x1fe2680) at gthread.c:784 #6 0x00007fda7ec5efa3 in start_thread (arg=) at pthread_create.c:486 #7 0x00007fda7ea875ff in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 2 (Thread 0x7fda7a4d2700 (LWP 5400)): #0 0x00007fda7ea7cac9 in __GI___poll (fds=0x1d177a0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29 #1 0x00007fda7fa52cbe in g_main_context_poll (priority=, n_fds=1, fds=0x1d177a0, timeout=, context=0x1d14c10) at gmain.c:4204 #2 0x00007fda7fa52cbe in g_main_context_iterate (context=context@entry=0x1d14c1---Type to continue, or q to quit--- 0, block=block@entry=1, dispatch=dispatch@entry=1, self=) at gmain.c:3898 #3 0x00007fda7fa52dcc in g_main_context_iteration (context=0x1d14c10, may_block=may_block@entry=1) at gmain.c:3964 #4 0x00007fda7fa52e11 in glib_worker_main (data=) at gmain.c:5773 #5 0x00007fda7fa79395 in g_thread_proxy (data=0x1d16800) at gthread.c:784 #6 0x00007fda7ec5efa3 in start_thread (arg=) at pthread_create.c:486 #7 0x00007fda7ea875ff in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 1 (Thread 0x7fda7bf18bc0 (LWP 5399)): #0 0x00007fda7ea7f291 in __pselect (nfds=16, readfds=0x7ffd68a79c30, writefds=0x7ffd68a79bb0, exceptfds=0x0, timeout=, sigmask=) at ../sysdeps/unix/sysv/linux/pselect.c:69 #1 0x00000000005bca5d in really_call_select (arg=arg@entry=0x7ffd68a796f0) at /mnt/data/steve/git/emacs-master/src/thread.c:580 #2 0x0000000000542d88 in flush_stack_call_func (func=func@entry=0x5bca12 , arg=arg@entry=0x7ffd68a796f0) at /mnt/data/steve/git/emacs-master/src/alloc.c:5229 #3 0x00000000005bd24f in thread_select (func=, max_fds=max_fds@entry=16, rfds=rfds@entry=0x7ffd68a79c30, wfds=, efds=efds@entry=0---Type to continue, or q to quit--- x0, timeout=timeout@entry=0x7ffd68a79e80, sigmask=0x0) at /mnt/data/steve/git/emacs-master/src/thread.c:610 #4 0x00000000005d7c64 in xg_select (fds_lim=16, rfds=rfds@entry=0x7ffd68a79f20, wfds=0x7ffd68a79ea0, efds=efds@entry=0x0, timeout=timeout@entry=0x7ffd68a79e80, sigmask=sigmask@entry=0x0) at /mnt/data/steve/git/emacs-master/src/xgselect.c:117 #5 0x000000000059daf3 in wait_reading_process_output (time_limit=time_limit@entry=172, nsecs=nsecs@entry=0, read_kbd=-1, do_display=do_display@entry=true, wait_for_cell=wait_for_cell@entry=0x0, wait_proc=wait_proc@entry=0x0, just_wait_proc=0) at /mnt/data/steve/git/emacs-master/src/process.c:5405 #6 0x0000000000424e63 in sit_for (timeout=timeout@entry=0x2b2, reading=reading@entry=true, display_option=display_option@entry=1) at /mnt/data/steve/git/emacs-master/src/lisp.h:1056 #7 0x00000000004f769e in read_char (commandflag=1, map=map@entry=0x3563eb3, prev_event=0x0, used_mouse_menu=used_mouse_menu@entry=0x7ffd68a7a30b, end_time=end_time@entry=0x0) at /mnt/data/steve/git/emacs-master/src/lisp.h:751 #8 0x00000000004f81ec in read_key_sequence (keybuf=keybuf@entry=0x7ffd68a7a3d0, prompt=prompt@entry=0x0, dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true, fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false) at /mnt/data/steve/git/emacs-master/src/lisp.h:1386 #9 0x00000000004f9730 in command_loop_1 () at /mnt/data/steve/git/emacs-master/src/lisp.h:1056 ---Type to continue, or q to quit--- #10 0x000000000055fe86 in internal_condition_case (bfun=bfun@entry=0x4f955b , handlers=handlers@entry=0x5490, hfun=hfun@entry=0x4f0c5d ) at /mnt/data/steve/git/emacs-master/src/eval.c:1376 #11 0x00000000004eca0e in command_loop_2 (ignore=ignore@entry=0x0) at /mnt/data/steve/git/emacs-master/src/lisp.h:1056 #12 0x000000000055fdfd in internal_catch (tag=tag@entry=0xc9f0, func=func@entry=0x4ec9f6 , arg=arg@entry=0x0) at /mnt/data/steve/git/emacs-master/src/eval.c:1139 #13 0x00000000004ec9d8 in command_loop () at /mnt/data/steve/git/emacs-master/src/lisp.h:1056 #14 0x00000000004f08d6 in recursive_edit_1 () at /mnt/data/steve/git/emacs-master/src/keyboard.c:714 #15 0x00000000004f0b8d in Frecursive_edit () at /mnt/data/steve/git/emacs-master/src/keyboard.c:785 #16 0x00000000004ec1d7 in main (argc=1, argv=0x7ffd68a7a718) at /mnt/data/steve/git/emacs-master/src/emacs.c:1901 (gdb) source ~/build/emacs/src/.gdbinit Warning: /home/steve/../lwlib: No such file or directory. SIGINT is used by the debugger. Are you sure you want to change it? (y or n) [answered Y; input not from terminal] DISPLAY = :0 TERM = xterm Breakpoint 1 at 0x4eb2ee: file /mnt/data/steve/git/emacs-master/src/emacs.c, line 370. Temporary breakpoint 2 at 0x502b35: file /mnt/data/steve/git/emacs-master/src/lisp.h, line 1056. (gdb) xbacktrace (gdb) c Continuing. [Thread 0x7fda79c1e700 (LWP 5402) exited] [Thread 0x7fda7a4d2700 (LWP 5400) exited] [Inferior 1 (process 5399) exited normally] (gdb) --=-=-=--