GNU bug report logs - #29548
25.2; How to DEBUG get-device-terminal

Previous Next

Package: emacs;

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

Date: Sun, 3 Dec 2017 15:43:01 UTC

Severity: normal

Tags: moreinfo, wontfix

Merged with 22362, 23378

Found in versions 24.5, 25.0.92, 25.2

Done: Glenn Morris <rgm <at> gnu.org>

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 29548 in the body.
You can then email your comments to 29548 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#29548; Package emacs. (Sun, 03 Dec 2017 15:43: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. (Sun, 03 Dec 2017 15:43: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; How to DEBUG get-device-terminal
Date: Sun, 03 Dec 2017 10:42:00 -0500
Hi,

        I currently have an Emacs (GUI) proceaa giving the
        error:

get-device-terminal: Invalid argument #<terminal 5> in
'get-device-terminal'
Error running timer battery-update-handler' (error Invalid argument
#<terminal 5> in 'get-device-terminal'")

        I belive this happened in my setup after I did the following
        in conjuction with an Emacs daemon process:

          (From a terminall shell prompt)
          $ emacsclient -c file1.txt
          (Emacs frame pops up)

          From another terminal shell prompt::
          $ emacsclient -t file1.txt
          (terminal shows Emacs with file1.txt buffer)
          'C-x 5 0' "(delete-frame)" in Emacs (TTY)
          (terminal "clears" -- Emacs (TTY) mo longer on scree, as
          expected, but mot returned to system shell prompt)
          (Emacs (GUI) frame starts showing 'get-device-terminql'
          error messages abd is umresponsive to any keyboard input)

          This Emacs process is still avaiable to GDB, if useful.

          If not, the only thing else I can do is to kill the Emacs
          process(es) from the command line.

          Please advixe.

          Thanks.

          



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: Summary

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:
nnimap read 136k from imap.aim.com [2 times]
nnimap read 152k from imap.aim.com
nnimap read 160k from imap.aim.com [2 times]
nnimap read 176k from imap.aim.com
nnimap read 184k from imap.aim.com
Fetching headers for nnimap+aol:INBOX...done
Scoring...done
Sorting threads...done
Generating summary...done
Quit
previous-line: Beginning of buffer [9 times]

Load-path shadows:
None found.

Features:
(shadow emacsbug sendmail sort gnus-cite smiley ansi-color shr-color
color shr dom subr-x browse-url mail-extr gnus-async gnus-bcklg qp
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 341497 43309)
 (symbols 48 125854 0)
 (miscs 40 215 249)
 (strings 32 108374 6729)
 (string-bytes 1 3799327)
 (vectors 16 26887)
 (vector-slots 8 926120 60648)
 (floats 8 571 497)
 (intervals 56 11919 146)
 (buffers 976 45)
 (heap 1024 65802 17295))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29548; Package emacs. (Sun, 03 Dec 2017 16:10:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 29548 <at> debbugs.gnu.org
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Sun, 03 Dec 2017 11:09:23 -0500
Live System User <nyc4bos <at> aol.com> writes:

> Hi,
>
>         I currently have an Emacs (GUI) proceaa giving the
>         error:
>
> get-device-terminal: Invalid argument #<terminal 5> in
> 'get-device-terminal'
> Error running timer battery-update-handler' (error Invalid argument
> #<terminal 5> in 'get-device-terminal'")
>
>         I belive this happened in my setup after I did the following
>         in conjuction with an Emacs daemon process:
>
>           (From a terminall shell prompt)
>           $ emacsclient -c file1.txt
>           (Emacs frame pops up)
>
>           From another terminal shell prompt::
>           $ emacsclient -t file1.txt
>           (terminal shows Emacs with file1.txt buffer)
>           'C-x 5 0' "(delete-frame)" in Emacs (TTY)
>           (terminal "clears" -- Emacs (TTY) mo longer on scree, as
>           expected, but mot returned to system shell prompt)
>           (Emacs (GUI) frame starts showing 'get-device-terminql'
>           error messages abd is umresponsive to any keyboard input)
>
>           This Emacs process is still avaiable to GDB, if useful.

Looks like that error comes from a condition-case-unless-debug handler
(in timer-event-handler).  Can you set `debug-on-error' from an
emacsclient and get a backtrace?  Otherwise I think 'break Fsignal' in
GDB should give some info as well (make sure that src/.gdbinit is
sourced so you get a lisp backtrace in addition to the C one).




Merged 22362 23378 29548. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Sun, 03 Dec 2017 21:20:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29548; Package emacs. (Wed, 06 Dec 2017 18:50:02 GMT) Full text and rfc822 format available.

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

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 29548 <at> debbugs.gnu.org
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Wed, 06 Dec 2017 13:49:05 -0500
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> Live System User <nyc4bos <at> aol.com> writes:
>
>> Hi,
>>
>>         I currently have an Emacs (GUI) proceaa giving the
>>         error:
>>
>> get-device-terminal: Invalid argument #<terminal 5> in
>> 'get-device-terminal'
>> Error running timer battery-update-handler' (error Invalid argument
>> #<terminal 5> in 'get-device-terminal'")
>>
>>         I belive this happened in my setup after I did the following
>>         in conjuction with an Emacs daemon process:
>>
>>           (From a terminall shell prompt)
>>           $ emacsclient -c file1.txt
>>           (Emacs frame pops up)
>>
>>           From another terminal shell prompt::
>>           $ emacsclient -t file1.txt
>>           (terminal shows Emacs with file1.txt buffer)
>>           'C-x 5 0' "(delete-frame)" in Emacs (TTY)
>>           (terminal "clears" -- Emacs (TTY) mo longer on scree, as
>>           expected, but mot returned to system shell prompt)
>>           (Emacs (GUI) frame starts showing 'get-device-terminql'
>>           error messages abd is umresponsive to any keyboard input)
>>
>>           This Emacs process is still avaiable to GDB, if useful.
>
> Looks like that error comes from a condition-case-unless-debug handler
> (in timer-event-handler).  Can you set `debug-on-error' from an
> emacsclient and get a backtrace?  Otherwise I think 'break Fsignal' in
> GDB should give some info as well (make sure that src/.gdbinit is
> sourced so you get a lisp backtrace in addition to the C one).

$  emacsclient --eval "(setq debug-on-error t)"
emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
*ERROR*: Invalid argument #<terminal 5> in ‘get-device-terminal’



(gdb) source ~/.gdbinit.emacs-25 
Warning: /home/liveuser/../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 = gnome-256color
Breakpoint 1 at 0x4f17d0: file ../../src/emacs.c, line 353.
Temporary breakpoint 2 at 0x50a490: init_sys_modes. (3 locations)
(gdb) break Fsignal
Breakpoint 3 at 0x566a50: file ../../src/eval.c, line 1470.
(gdb) c
Continuing.

Thread 1 "emacs" hit Breakpoint 3, Fsignal (error_symbol=XIL(0x4b00), 
    data=XIL(0x2451413)) at ../../src/eval.c:1470
1470	{
(gdb) list
1465	See Info anchor `(elisp)Definition of signal' for some details on how this
1466	error message is constructed.
1467	If the signal is handled, DATA is made available to the handler.
1468	See also the function `condition-case'.  */)
1469	  (Lisp_Object error_symbol, Lisp_Object data)
1470	{
1471	  /* When memory is full, ERROR-SYMBOL is nil,
1472	     and DATA is (REAL-ERROR-SYMBOL . REAL-DATA).
1473	     That is a special case--don't do this in other situations.  */
1474	  Lisp_Object conditions;
(gdb) 
(gdb) bt
#0  Fsignal (error_symbol=XIL(0x4b00), data=XIL(0x2451413))
    at ../../src/eval.c:1470
#1  0x00000000005668d5 in Ffuncall (nargs=3, args=args <at> entry=0x7ffe5e974a90)
    at ../../src/eval.c:2702
#2  0x000000000059f173 in exec_byte_code (bytestr=<optimized out>, 
    vector=<optimized out>, maxdepth=<optimized out>, 
    args_template=<optimized out>, nargs=nargs <at> entry=2, args=<optimized out>, 
    args <at> entry=0x878274 <pure+104404>) at ../../src/bytecode.c:880
#3  0x0000000000566416 in funcall_lambda (fun=XIL(0x7ffe5e974ce0), 
    nargs=nargs <at> entry=2, arg_vector=0x878274 <pure+104404>, 
    arg_vector <at> entry=0x7ffe5e974c48) at ../../src/eval.c:2863
#4  0x00000000005666db in Ffuncall (nargs=3, args=args <at> entry=0x7ffe5e974c40)
    at ../../src/eval.c:2760
#5  0x000000000059f173 in exec_byte_code (bytestr=<optimized out>, 
    vector=<optimized out>, maxdepth=<optimized out>, 
    args_template=<optimized out>, nargs=nargs <at> entry=1, args=<optimized out>, 
    args <at> entry=0x97c484 <pure+1169892>) at ../../src/bytecode.c:880
#6  0x0000000000566416 in funcall_lambda (fun=XIL(0x7ffe5e974ea0), 
    nargs=nargs <at> entry=1, arg_vector=0x97c484 <pure+1169892>, 
    arg_vector <at> entry=0x7ffe5e974e08) at ../../src/eval.c:2863
#7  0x00000000005666db in Ffuncall (nargs=2, args=args <at> entry=0x7ffe5e974e00)
    at ../../src/eval.c:2760
#8  0x000000000059f173 in exec_byte_code (bytestr=<optimized out>, 
---Type <return> to continue, or q <return> to quit---
    vector=<optimized out>, maxdepth=<optimized out>, 
    args_template=<optimized out>, nargs=nargs <at> entry=1, args=<optimized out>, 
    args <at> entry=0x97c5d4 <pure+1170228>) at ../../src/bytecode.c:880
#9  0x0000000000566416 in funcall_lambda (fun=XIL(0x7ffe5e975040), 
    nargs=nargs <at> entry=1, arg_vector=0x97c5d4 <pure+1170228>, 
    arg_vector <at> entry=0x7ffe5e974fc0) at ../../src/eval.c:2863
#10 0x00000000005666db in Ffuncall (nargs=2, args=args <at> entry=0x7ffe5e974fb8)
    at ../../src/eval.c:2760
#11 0x000000000059f173 in exec_byte_code (bytestr=<optimized out>, 
    vector=<optimized out>, maxdepth=<optimized out>, 
    args_template=args_template <at> entry=XIL(0), nargs=nargs <at> entry=0, 
    args=<optimized out>, args <at> entry=0x0) at ../../src/bytecode.c:880
#12 0x00000000005662ed in funcall_lambda (fun=XIL(0x8a6a3d), 
    nargs=nargs <at> entry=1, arg_vector=arg_vector <at> entry=0x7ffe5e9751c8)
    at ../../src/eval.c:2929
#13 0x00000000005666db in Ffuncall (nargs=nargs <at> entry=2, 
    args=args <at> entry=0x7ffe5e9751c0) at ../../src/eval.c:2760
#14 0x00000000005669da in call1 (fn=fn <at> entry=XIL(0x8a6a3d), 
    arg1=<optimized out>) at ../../src/eval.c:2558
#15 0x000000000056daaa in mapcar1 (leni=leni <at> entry=3, 
    vals=vals <at> entry=0x7ffe5e975250, fn=fn <at> entry=XIL(0x8a6a3d), 
    seq=seq <at> entry=XIL(0x2452103)) at ../../src/fns.c:2522
#16 0x000000000056e175 in Fmapcar (function=XIL(0x8a6a3d), 
---Type <return> to continue, or q <return> to quit---
    sequence=XIL(0x2452103)) at ../../src/fns.c:2587
#17 0x00000000005668d5 in Ffuncall (nargs=3, args=args <at> entry=0x7ffe5e9753a0)
    at ../../src/eval.c:2702
#18 0x000000000059f173 in exec_byte_code (bytestr=<optimized out>, 
    vector=<optimized out>, maxdepth=<optimized out>, 
    args_template=args_template <at> entry=XIL(0), nargs=nargs <at> entry=0, 
    args=<optimized out>, args <at> entry=0x0) at ../../src/bytecode.c:880
#19 0x00000000005662ed in funcall_lambda (fun=XIL(0x8a69bd), 
    nargs=nargs <at> entry=0, arg_vector=arg_vector <at> entry=0x7ffe5e9755b0)
    at ../../src/eval.c:2929
#20 0x00000000005666db in Ffuncall (nargs=1, args=args <at> entry=0x7ffe5e9755a8)
    at ../../src/eval.c:2760
#21 0x000000000059f173 in exec_byte_code (bytestr=<optimized out>, 
    vector=<optimized out>, maxdepth=<optimized out>, 
    args_template=args_template <at> entry=XIL(0), nargs=nargs <at> entry=0, 
    args=<optimized out>, args <at> entry=0x0) at ../../src/bytecode.c:880
#22 0x00000000005662ed in funcall_lambda (fun=fun <at> entry=XIL(0x8acec5), 
    nargs=nargs <at> entry=3, arg_vector=arg_vector <at> entry=0x7ffe5e975710)
    at ../../src/eval.c:2929
#23 0x0000000000565768 in apply_lambda (fun=XIL(0x8acec5), 
    args=<optimized out>, count=count <at> entry=26) at ../../src/eval.c:2800
#24 0x0000000000565aca in eval_sub (form=<optimized out>)
    at ../../src/eval.c:2247
---Type <return> to continue, or q <return> to quit---
#25 0x000000000056645d in Fprogn (body=XIL(0x25d0603)) at ../../src/eval.c:431
#26 funcall_lambda (fun=XIL(0x25d05c3), nargs=nargs <at> entry=0, 
    arg_vector=arg_vector <at> entry=0x7ffe5e9759e8) at ../../src/eval.c:2922
#27 0x00000000005666db in Ffuncall (nargs=1, args=0x7ffe5e9759e0)
    at ../../src/eval.c:2760
#28 0x0000000000566939 in funcall_nil (nargs=<optimized out>, 
    args=<optimized out>) at ../../src/eval.c:2338
#29 0x0000000000564a55 in run_hook_with_args (nargs=1, args=0x7ffe5e9759e0, 
    funcall=0x566930 <funcall_nil>) at ../../src/eval.c:2515
#30 0x0000000000564c33 in run_hook_with_args (funcall=<optimized out>, 
    args=<optimized out>, nargs=<optimized out>) at ../../src/eval.c:2361
#31 Frun_hook_with_args (args=0x7ffe5e9759e0, nargs=1) at ../../src/eval.c:2380
#32 run_hook (hook=<optimized out>) at ../../src/eval.c:2528
#33 Frun_hooks (nargs=1, args=0x7ffe5e975ac8) at ../../src/eval.c:2362
#34 0x00000000005667e9 in Ffuncall (nargs=nargs <at> entry=2, 
    args=args <at> entry=0x7ffe5e975ac0) at ../../src/eval.c:2679
#35 0x00000000005669da in call1 (fn=<optimized out>, 
    arg1=arg1 <at> entry=XIL(0x2e80)) at ../../src/eval.c:2558
#36 0x000000000051107a in Fget_buffer_create (buffer_or_name=<optimized out>)
    at ../../src/buffer.c:591
#37 0x00000000005668e0 in Ffuncall (nargs=2, args=args <at> entry=0x7ffe5e975bc0)
    at ../../src/eval.c:2699
#38 0x000000000059f173 in exec_byte_code (bytestr=<optimized out>, 
---Type <return> to continue, or q <return> to quit---
    vector=<optimized out>, maxdepth=<optimized out>, 
    args_template=<optimized out>, nargs=nargs <at> entry=1, args=<optimized out>, 
    args <at> entry=0x8c314c <pure+411308>) at ../../src/bytecode.c:880
#39 0x0000000000566416 in funcall_lambda (fun=XIL(0x7ffe5e975e30), 
    nargs=nargs <at> entry=1, arg_vector=0x8c314c <pure+411308>, 
    arg_vector <at> entry=0x7ffe5e975d60) at ../../src/eval.c:2863
#40 0x00000000005666db in Ffuncall (nargs=2, args=args <at> entry=0x7ffe5e975d58)
    at ../../src/eval.c:2760
#41 0x000000000059f173 in exec_byte_code (bytestr=<optimized out>, 
    vector=<optimized out>, maxdepth=<optimized out>, 
    args_template=args_template <at> entry=XIL(0), nargs=nargs <at> entry=0, 
    args=<optimized out>, args <at> entry=0x0) at ../../src/bytecode.c:880
#42 0x00000000005662ed in funcall_lambda (fun=XIL(0x1357aa5), 
    nargs=nargs <at> entry=0, arg_vector=arg_vector <at> entry=0x7ffe5e975fc0)
    at ../../src/eval.c:2929
#43 0x00000000005666db in Ffuncall (nargs=1, args=args <at> entry=0x7ffe5e975fb8)
    at ../../src/eval.c:2760
#44 0x000000000059f173 in exec_byte_code (bytestr=<optimized out>, 
    vector=<optimized out>, maxdepth=<optimized out>, 
    args_template=args_template <at> entry=XIL(0), nargs=nargs <at> entry=0, 
    args=<optimized out>, args <at> entry=0x0) at ../../src/bytecode.c:880
#45 0x00000000005662ed in funcall_lambda (fun=XIL(0x1355a05), 
    nargs=nargs <at> entry=0, arg_vector=arg_vector <at> entry=0x7ffe5e9761e0)
---Type <return> to continue, or q <return> to quit---
    at ../../src/eval.c:2929
#46 0x00000000005666db in Ffuncall (nargs=1, args=args <at> entry=0x7ffe5e9761d8)
    at ../../src/eval.c:2760
#47 0x000000000059f173 in exec_byte_code (bytestr=<optimized out>, 
    vector=<optimized out>, maxdepth=<optimized out>, 
    args_template=args_template <at> entry=XIL(0), nargs=nargs <at> entry=0, 
    args=<optimized out>, args <at> entry=0x0) at ../../src/bytecode.c:880
#48 0x00000000005662ed in funcall_lambda (fun=XIL(0x135594d), 
    nargs=nargs <at> entry=0, arg_vector=arg_vector <at> entry=0x7ffe5e976508)
    at ../../src/eval.c:2929
#49 0x00000000005666db in Ffuncall (nargs=nargs <at> entry=1, 
    args=args <at> entry=0x7ffe5e976500) at ../../src/eval.c:2760
#50 0x0000000000567d0c in Fapply (nargs=2, args=0x7ffe5e976500)
    at ../../src/eval.c:2280
#51 0x00000000005667e9 in Ffuncall (nargs=3, args=args <at> entry=0x7ffe5e9764f8)
    at ../../src/eval.c:2679
#52 0x000000000059f173 in exec_byte_code (bytestr=<optimized out>, 
    vector=<optimized out>, maxdepth=<optimized out>, 
    args_template=args_template <at> entry=XIL(0), nargs=nargs <at> entry=0, 
    args=<optimized out>, args <at> entry=0x0) at ../../src/bytecode.c:880
#53 0x00000000005662ed in funcall_lambda (fun=XIL(0x9b3855), 
    nargs=nargs <at> entry=1, arg_vector=arg_vector <at> entry=0x7ffe5e976718)
    at ../../src/eval.c:2929
---Type <return> to continue, or q <return> to quit---
#54 0x00000000005666db in Ffuncall (nargs=nargs <at> entry=2, 
    args=args <at> entry=0x7ffe5e976710) at ../../src/eval.c:2760
#55 0x00000000005669da in call1 (fn=fn <at> entry=XIL(0xb340), 
    arg1=arg1 <at> entry=XIL(0x1356ac5)) at ../../src/eval.c:2558
#56 0x00000000004f7714 in timer_check_2 (idle_timers=<optimized out>, 
    timers=<optimized out>) at ../../src/keyboard.c:4432
#57 timer_check () at ../../src/keyboard.c:4494
#58 0x00000000005a9851 in wait_reading_process_output (
    time_limit=time_limit <at> entry=0, nsecs=nsecs <at> entry=0, 
    read_kbd=read_kbd <at> entry=-1, do_display=true, 
    wait_for_cell=wait_for_cell <at> entry=XIL(0), wait_proc=wait_proc <at> entry=0x0, 
    just_wait_proc=0) at ../../src/process.c:4600
#59 0x00000000004fc80c in kbd_buffer_get_event (end_time=0x0, 
    used_mouse_menu=0x7ffe5e9773cb, kbp=<synthetic pointer>)
    at ../../src/keyboard.c:3824
#60 read_event_from_main_queue (used_mouse_menu=0x7ffe5e9773cb, 
    local_getcjmp=0x7ffe5e976fe0, end_time=0x0) at ../../src/keyboard.c:2153
#61 read_decoded_event_from_main_queue (used_mouse_menu=<optimized out>, 
    prev_event=<optimized out>, local_getcjmp=<optimized out>, 
    end_time=<optimized out>) at ../../src/keyboard.c:2216
#62 read_char (commandflag=commandflag <at> entry=1, map=map <at> entry=XIL(0x1f9cd43), 
    prev_event=XIL(0), used_mouse_menu=used_mouse_menu <at> entry=0x7ffe5e9773cb, 
    end_time=end_time <at> entry=0x0) at ../../src/keyboard.c:2804
---Type <return> to continue, or q <return> to quit---
#63 0x00000000004fe62d in read_key_sequence (
    keybuf=keybuf <at> entry=0x7ffe5e9774c0, prompt=prompt <at> entry=XIL(0), 
    dont_downcase_last=dont_downcase_last <at> entry=false, 
    can_return_switch_frame=can_return_switch_frame <at> entry=true, 
    fix_current_buffer=fix_current_buffer <at> entry=true, 
    prevent_redisplay=prevent_redisplay <at> entry=false, bufsize=30)
    at ../../src/keyboard.c:9068
#64 0x0000000000500264 in command_loop_1 () at ../../src/keyboard.c:1370
#65 0x0000000000565002 in internal_condition_case (
    bfun=bfun <at> entry=0x500040 <command_loop_1>, 
    handlers=handlers <at> entry=XIL(0x4b00), hfun=hfun <at> entry=0x4f68c0 <cmd_error>)
    at ../../src/eval.c:1315
#66 0x00000000004f1cf4 in command_loop_2 (ignore=ignore <at> entry=XIL(0))
    at ../../src/keyboard.c:1112
#67 0x0000000000564fa3 in internal_catch (tag=tag <at> entry=XIL(0xb580), 
    func=func <at> entry=0x4f1cd0 <command_loop_2>, arg=arg <at> entry=XIL(0))
    at ../../src/eval.c:1080
#68 0x00000000004f1cb0 in command_loop () at ../../src/keyboard.c:1091
#69 0x00000000004f64b7 in recursive_edit_1 () at ../../src/keyboard.c:697
#70 0x00000000004f6808 in Frecursive_edit () at ../../src/keyboard.c:768
#71 0x000000000041a032 in main (argc=2, argv=0x7ffe5e977848)
    at ../../src/emacs.c:1629

---Type <return> to continue, or q <return> to quit---
Lisp Backtrace:
"signal" (0x5e974a98)
"error" (0x5e974c48)
"get-device-terminal" (0x5e974e08)
"frames-on-display-list" (0x5e974fc0)
0x8a6a38 PVEC_COMPILED
"mapcar" (0x5e9753a8)
"internal--before-save-selected-window" (0x5e9755b0)
"walk-windows" (0x5e975710)
0x25d05c0 Lisp type 3
"run-hooks" (0x5e975ac8)
"get-buffer-create" (0x5e975bc8)
"generate-new-buffer" (0x5e975d60)
"battery-linux-sysfs" (0x5e975fc0)
"battery-update" (0x5e9761e0)
"battery-update-handler" (0x5e976508)
"apply" (0x5e976500)
"timer-event-handler" (0x5e976718)








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

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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 29548 <at> debbugs.gnu.org
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Wed, 6 Dec 2017 14:56:45 -0500
On Wed, Dec 6, 2017 at 1:49 PM, Live System User <nyc4bos <at> aol.com> wrote:

> Lisp Backtrace:
> "signal" (0x5e974a98)
> "error" (0x5e974c48)
> "get-device-terminal" (0x5e974e08)
> "frames-on-display-list" (0x5e974fc0)
> 0x8a6a38 PVEC_COMPILED
> "mapcar" (0x5e9753a8)
> "internal--before-save-selected-window" (0x5e9755b0)

So this function is getting the terminal list by calling
list-terminals. Try printing them out in gdb, by entering the
following:

define print_terminal_list
set $t = terminal_list
while $t
print *$t
set $t = $t->next_terminal
end
end
print_terminal_list

The gdb command window should like this when you do that

(gdb) define print_terminal_list
Type commands for definition of "print_terminal_list".
End with a line saying just "end".
>set $t = terminal_list
>while $t
 >print *$t
 >set $t = $t->next_terminal
 >end
>end
(gdb) print_terminal_list
$7 = {
...[printout of terminals follows]




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29548; Package emacs. (Thu, 07 Dec 2017 00:26:02 GMT) Full text and rfc822 format available.

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

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 29548 <at> debbugs.gnu.org
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Wed, 06 Dec 2017 19:25:01 -0500
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> On Wed, Dec 6, 2017 at 1:49 PM, Live System User <nyc4bos <at> aol.com> wrote:
>
>> Lisp Backtrace:
>> "signal" (0x5e974a98)
>> "error" (0x5e974c48)
>> "get-device-terminal" (0x5e974e08)
>> "frames-on-display-list" (0x5e974fc0)
>> 0x8a6a38 PVEC_COMPILED
>> "mapcar" (0x5e9753a8)
>> "internal--before-save-selected-window" (0x5e9755b0)
>
> So this function is getting the terminal list by calling
> list-terminals. Try printing them out in gdb, by entering the
> following:
>
> define print_terminal_list
> set $t = terminal_list
> while $t
> print *$t
> set $t = $t->next_terminal
> end
> end
> print_terminal_list
>
> The gdb command window should like this when you do that
>
> (gdb) define print_terminal_list
> Type commands for definition of "print_terminal_list".
> End with a line saying just "end".
>>set $t = terminal_list
>>while $t
>  >print *$t
>  >set $t = $t->next_terminal
>  >end
>>end
> (gdb) print_terminal_list
> $7 = {
> ...[printout of terminals follows]


(gdb) define print_terminal_list
Type commands for definition of "print_terminal_list".
End with a line saying just "end".
>set $t = terminal_list
>while $t
 >print *$t
 >set $t = $t->next_terminal
 >end
>end
(gdb) print_terminal_list
$1 = {
  header = {
    size = 4611686018561773572
  }, 
  param_alist = XIL(0x2bfe553), 
  charset_list = XIL(0x102ec33), 
  Vselection_alist = XIL(0), 
  glyph_code_table = XIL(0), 
  next_terminal = 0x363e3d8, 
  id = 5, 
  reference_count = 0, 
  type = output_termcap, 
  name = 0x0, 
  kboard = 0x4c584e0, 
  image_cache = 0x0, 
  display_info = {
    tty = 0x4160c10, 
    x = 0x4160c10, 
    w32 = 0x4160c10, 
    ns = 0x4160c10
  }, 
  terminal_coding = 0x572a020, 
  keyboard_coding = 0x8594d30, 
---Type <return> to continue, or q <return> to quit---
  rif = 0x0, 
  cursor_to_hook = 0x4b3aa0 <tty_cursor_to>, 
  raw_cursor_to_hook = 0x4b39f0 <tty_raw_cursor_to>, 
  clear_to_end_hook = 0x4b1160 <tty_clear_to_end>, 
  clear_frame_hook = 0x4b1ce0 <tty_clear_frame>, 
  clear_end_of_line_hook = 0x4b38b0 <tty_clear_end_of_line>, 
  ins_del_lines_hook = 0x4b0e50 <tty_ins_del_lines>, 
  insert_glyphs_hook = 0x4b4820 <tty_insert_glyphs>, 
  write_glyphs_hook = 0x4b4500 <tty_write_glyphs>, 
  delete_glyphs_hook = 0x4b3720 <tty_delete_glyphs>, 
  ring_bell_hook = 0x4b0bb0 <tty_ring_bell>, 
  toggle_invisible_pointer_hook = 0x0, 
  reset_terminal_modes_hook = 0x4b3600 <tty_reset_terminal_modes>, 
  set_terminal_modes_hook = 0x4b0d00 <tty_set_terminal_modes>, 
  update_begin_hook = 0x0, 
  update_end_hook = 0x4b35a0 <tty_update_end>, 
  set_terminal_window_hook = 0x4b0790 <tty_set_terminal_window>, 
  mouse_position_hook = 0x0, 
  frame_rehighlight_hook = 0x0, 
  frame_raise_lower_hook = 0x0, 
  fullscreen_hook = 0x0, 
  menu_show_hook = 0x4b2ab0 <tty_menu_show>, 
  popup_dialog_hook = 0x0, 
---Type <return> to continue, or q <return> to quit---
  set_vertical_scroll_bar_hook = 0x0, 
  set_horizontal_scroll_bar_hook = 0x0, 
  condemn_scroll_bars_hook = 0x0, 
  redeem_scroll_bar_hook = 0x0, 
  judge_scroll_bars_hook = 0x0, 
  read_socket_hook = 0x4f8cf0 <tty_read_avail_input>, 
  frame_up_to_date_hook = 0x0, 
  delete_frame_hook = 0x4b0130 <tty_free_frame_resources>, 
  delete_terminal_hook = 0x4aff70 <delete_tty>
}
$2 = {
  header = {
    size = 4611686018561773572
  }, 
  param_alist = XIL(0x3635c03), 
  charset_list = XIL(0), 
  Vselection_alist = XIL(0), 
  glyph_code_table = XIL(0), 
  next_terminal = 0xc2b460, 
  id = 4, 
  reference_count = 2, 
  type = output_x_window, 
  name = 0x3b51a70 ":0", 
---Type <return> to continue, or q <return> to quit---
  kboard = 0x3e374f0, 
  image_cache = 0x435b910, 
  display_info = {
    tty = 0x3a31c00, 
    x = 0x3a31c00, 
    w32 = 0x3a31c00, 
    ns = 0x3a31c00
  }, 
  terminal_coding = 0x3f2f200, 
  keyboard_coding = 0x446f800, 
  rif = 0x85a520 <x_redisplay_interface>, 
  cursor_to_hook = 0x0, 
  raw_cursor_to_hook = 0x0, 
  clear_to_end_hook = 0x0, 
  clear_frame_hook = 0x4c2500 <x_clear_frame>, 
  clear_end_of_line_hook = 0x0, 
  ins_del_lines_hook = 0x4c0cb0 <x_ins_del_lines>, 
  insert_glyphs_hook = 0x0, 
  write_glyphs_hook = 0x0, 
  delete_glyphs_hook = 0x4c0ca0 <x_delete_glyphs>, 
  ring_bell_hook = 0x4c4810 <XTring_bell>, 
  toggle_invisible_pointer_hook = 0x4c0680 <XTtoggle_invisible_pointer>, 
  reset_terminal_modes_hook = 0x0, 
---Type <return> to continue, or q <return> to quit---
  set_terminal_modes_hook = 0x0, 
  update_begin_hook = 0x4c05c0 <x_update_begin>, 
  update_end_hook = 0x4c05d0 <x_update_end>, 
  set_terminal_window_hook = 0x0, 
  mouse_position_hook = 0x4c8f90 <XTmouse_position>, 
  frame_rehighlight_hook = 0x4c9f20 <XTframe_rehighlight>, 
  frame_raise_lower_hook = 0x4c4630 <XTframe_raise_lower>, 
  fullscreen_hook = 0x4ccfe0 <XTfullscreen_hook>, 
  menu_show_hook = 0x46dd20 <x_menu_show>, 
  popup_dialog_hook = 0x46e680 <xw_popup_dialog>, 
  set_vertical_scroll_bar_hook = 0x4c1f60 <XTset_vertical_scroll_bar>, 
  set_horizontal_scroll_bar_hook = 0x4c19d0 <XTset_horizontal_scroll_bar>, 
  condemn_scroll_bars_hook = 0x4c0630 <XTcondemn_scroll_bars>, 
  redeem_scroll_bar_hook = 0x4c0ab0 <XTredeem_scroll_bar>, 
  judge_scroll_bars_hook = 0x4c15f0 <XTjudge_scroll_bars>, 
  read_socket_hook = 0x4c2380 <XTread_socket>, 
  frame_up_to_date_hook = 0x4c4650 <XTframe_up_to_date>, 
  delete_frame_hook = 0x4ce160 <x_destroy_window>, 
  delete_terminal_hook = 0x4c5ea0 <x_delete_terminal>
}
$3 = {
  header = {
    size = 4611686018561773572
---Type <return> to continue, or q <return> to quit---
  }, 
  param_alist = XIL(0x13a3aa3), 
  charset_list = XIL(0x102ec33), 
  Vselection_alist = XIL(0), 
  glyph_code_table = XIL(0), 
  next_terminal = 0x0, 
  id = 0, 
  reference_count = 1, 
  type = output_initial, 
  name = 0xbf45e0 "initial_terminal", 
  kboard = 0xc26e30, 
  image_cache = 0x0, 
  display_info = {
    tty = 0x0, 
    x = 0x0, 
    w32 = 0x0, 
    ns = 0x0
  }, 
  terminal_coding = 0xc2dbf0, 
  keyboard_coding = 0xc2d980, 
  rif = 0x0, 
  cursor_to_hook = 0x0, 
  raw_cursor_to_hook = 0x0, 
---Type <return> to continue, or q <return> to quit---
  clear_to_end_hook = 0x0, 
  clear_frame_hook = 0x0, 
  clear_end_of_line_hook = 0x0, 
  ins_del_lines_hook = 0x0, 
  insert_glyphs_hook = 0x0, 
  write_glyphs_hook = 0x0, 
  delete_glyphs_hook = 0x0, 
  ring_bell_hook = 0x0, 
  toggle_invisible_pointer_hook = 0x0, 
  reset_terminal_modes_hook = 0x0, 
  set_terminal_modes_hook = 0x0, 
  update_begin_hook = 0x0, 
  update_end_hook = 0x0, 
  set_terminal_window_hook = 0x0, 
  mouse_position_hook = 0x0, 
  frame_rehighlight_hook = 0x0, 
  frame_raise_lower_hook = 0x0, 
  fullscreen_hook = 0x0, 
  menu_show_hook = 0x0, 
  popup_dialog_hook = 0x0, 
  set_vertical_scroll_bar_hook = 0x0, 
  set_horizontal_scroll_bar_hook = 0x0, 
  condemn_scroll_bars_hook = 0x0, 
---Type <return> to continue, or q <return> to quit---
  redeem_scroll_bar_hook = 0x0, 
  judge_scroll_bars_hook = 0x0, 
  read_socket_hook = 0x0, 
  frame_up_to_date_hook = 0x0, 
  delete_frame_hook = 0x4b6ea0 <initial_free_frame_resources>, 
  delete_terminal_hook = 0x4b7690 <delete_initial_terminal>
}
(gdb) 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29548; Package emacs. (Thu, 07 Dec 2017 09:29:01 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>, 
 Live System User <nyc4bos <at> aol.com>
Cc: 29548 <at> debbugs.gnu.org
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Thu, 07 Dec 2017 10:27:35 +0100
> So this function is getting the terminal list by calling
> list-terminals.

What function is `list-terminals'?

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29548; Package emacs. (Thu, 07 Dec 2017 09:36:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 29548 <at> debbugs.gnu.org, Live System User <nyc4bos <at> aol.com>
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Thu, 07 Dec 2017 04:35:30 -0500
martin rudalics <rudalics <at> gmx.at> writes:

>> So this function is getting the terminal list by calling
>> list-terminals.
>
> What function is `list-terminals'?

Sorry, I meant terminal-list.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29548; Package emacs. (Fri, 15 Dec 2017 01:38:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 29548 <at> debbugs.gnu.org
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Thu, 14 Dec 2017 20:37:19 -0500
Live System User <nyc4bos <at> aol.com> writes:

> (gdb) define print_terminal_list
> Type commands for definition of "print_terminal_list".
> End with a line saying just "end".
>>set $t = terminal_list
>>while $t
>  >print *$t
>  >set $t = $t->next_terminal
>  >end
>>end
> (gdb) print_terminal_list
> $1 = {
>   header = {
>     size = 4611686018561773572
>   }, 
>   param_alist = XIL(0x2bfe553), 
>   charset_list = XIL(0x102ec33), 
>   Vselection_alist = XIL(0), 
>   glyph_code_table = XIL(0), 
>   next_terminal = 0x363e3d8, 
>   id = 5, 
>   reference_count = 0, 
>   type = output_termcap, 
>   name = 0x0, 

As far as I can tell, the only place that sets a terminals 'name' field
to NULL is in delete_terminal:

    delete_terminal (struct terminal *terminal)
    {
      ...
      terminal->name = NULL;

      [...]
      *tp = terminal->next_terminal;
      ...

Something must have happened in the [...] to prevent the terminal from
being removed from the terminal list.  There is a lot code in that
[...], with a lot of conditional, recursive calls so it's hard to say
what could be the problem.  One thing I see, is that it calls
Fframe_parameter which uses Fassq which checks for quit signals.  Not
sure how plausible it is that you could have managed to quit just at the
right time though.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29548; Package emacs. (Thu, 04 Jan 2018 14:38:02 GMT) Full text and rfc822 format available.

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

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: martin rudalics <rudalics <at> gmx.at>, 29548 <at> debbugs.gnu.org
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Thu, 04 Jan 2018 09:37:31 -0500
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> Live System User <nyc4bos <at> aol.com> writes:
>
>> (gdb) define print_terminal_list
>> Type commands for definition of "print_terminal_list".
>> End with a line saying just "end".
>>>set $t = terminal_list
>>>while $t
>>  >print *$t
>>  >set $t = $t->next_terminal
>>  >end
>>>end
>> (gdb) print_terminal_list
>> $1 = {
>>   header = {
>>     size = 4611686018561773572
>>   }, 
>>   param_alist = XIL(0x2bfe553), 
>>   charset_list = XIL(0x102ec33), 
>>   Vselection_alist = XIL(0), 
>>   glyph_code_table = XIL(0), 
>>   next_terminal = 0x363e3d8, 
>>   id = 5, 
>>   reference_count = 0, 
>>   type = output_termcap, 
>>   name = 0x0, 
>
> As far as I can tell, the only place that sets a terminals 'name' field
> to NULL is in delete_terminal:
>
>     delete_terminal (struct terminal *terminal)
>     {
>       ...
>       terminal->name = NULL;
>
>       [...]
>       *tp = terminal->next_terminal;
>       ...
>
> Something must have happened in the [...] to prevent the terminal from
> being removed from the terminal list.  There is a lot code in that
> [...], with a lot of conditional, recursive calls so it's hard to say
> what could be the problem.  One thing I see, is that it calls
> Fframe_parameter which uses Fassq which checks for quit signals.  Not
> sure how plausible it is that you could have managed to quit just at the
> right time though.

  Here's a new occurrance (see below):

  One thing I noticed is that when it happen this time when doing a
  "emacsclient -c" "is that a blank GUI frame quickly flashed on
  the screen and disappeated before printing the error:

*ERROR*: Invalid argument #<terminal 10> in ‘get-device-terminal’


  When I invoke "emacsclient -t" that error message does NOT
  appear -- Emacs still just doesn't do anything (the emacsclient
  command executed (?) and returned to the system prompt).

  As you noticed that when it's in this state, the "name" field
  appears invalid and its "reference count" is 0 (is it because
  it's deleted/dead/invalid?):

  id = 10, 
  reference_count = 0, 
  type = output_termcap, 
  name = 0x0, 


  Whereas in a working instance it looks like this:

  id = 2, 
  reference_count = 1, 
  type = output_termcap, 
  name = 0x33d5bc0 "/dev/pts/23", 


  Thanks.


(gdb) print_terminal_list
$1 = {
  header = {
    size = 4611686018561773572
  }, 
  param_alist = XIL(0x8793ef3), 
  charset_list = XIL(0x102ec33), 
  Vselection_alist = XIL(0), 
  glyph_code_table = XIL(0), 
  next_terminal = 0xc2b460, 
  id = 10, 
  reference_count = 0, 
  type = output_termcap, 
  name = 0x0, 
  kboard = 0x54ade00, 
  image_cache = 0x0, 
  display_info = {
    tty = 0x9d4e190, 
    x = 0x9d4e190, 
    w32 = 0x9d4e190, 
    ns = 0x9d4e190
  }, 
  terminal_coding = 0x802de00, 
  keyboard_coding = 0x8e3e1b0, 
---Type <return> to continue, or q <return> to quit---
  rif = 0x0, 
  cursor_to_hook = 0x4b3aa0 <tty_cursor_to>, 
  raw_cursor_to_hook = 0x4b39f0 <tty_raw_cursor_to>, 
  clear_to_end_hook = 0x4b1160 <tty_clear_to_end>, 
  clear_frame_hook = 0x4b1ce0 <tty_clear_frame>, 
  clear_end_of_line_hook = 0x4b38b0 <tty_clear_end_of_line>, 
  ins_del_lines_hook = 0x4b0e50 <tty_ins_del_lines>, 
  insert_glyphs_hook = 0x4b4820 <tty_insert_glyphs>, 
  write_glyphs_hook = 0x4b4500 <tty_write_glyphs>, 
  delete_glyphs_hook = 0x4b3720 <tty_delete_glyphs>, 
  ring_bell_hook = 0x4b0bb0 <tty_ring_bell>, 
  toggle_invisible_pointer_hook = 0x0, 
  reset_terminal_modes_hook = 0x4b3600 <tty_reset_terminal_modes>, 
  set_terminal_modes_hook = 0x4b0d00 <tty_set_terminal_modes>, 
  update_begin_hook = 0x0, 
  update_end_hook = 0x4b35a0 <tty_update_end>, 
  set_terminal_window_hook = 0x4b0790 <tty_set_terminal_window>, 
  mouse_position_hook = 0x0, 
  frame_rehighlight_hook = 0x0, 
  frame_raise_lower_hook = 0x0, 
  fullscreen_hook = 0x0, 
  menu_show_hook = 0x4b2ab0 <tty_menu_show>, 
  popup_dialog_hook = 0x0, 
---Type <return> to continue, or q <return> to quit---
  set_vertical_scroll_bar_hook = 0x0, 
  set_horizontal_scroll_bar_hook = 0x0, 
  condemn_scroll_bars_hook = 0x0, 
  redeem_scroll_bar_hook = 0x0, 
  judge_scroll_bars_hook = 0x0, 
  read_socket_hook = 0x4f8cf0 <tty_read_avail_input>, 
  frame_up_to_date_hook = 0x0, 
  delete_frame_hook = 0x4b0130 <tty_free_frame_resources>, 
  delete_terminal_hook = 0x4aff70 <delete_tty>
}
$2 = {
  header = {
    size = 4611686018561773572
  }, 
  param_alist = XIL(0x13a3b23), 
  charset_list = XIL(0x102ec33), 
  Vselection_alist = XIL(0), 
  glyph_code_table = XIL(0), 
  next_terminal = 0x0, 
  id = 0, 
  reference_count = 1, 
  type = output_initial, 
  name = 0xbf45e0 "initial_terminal", 
---Type <return> to continue, or q <return> to quit---
  kboard = 0xc26e30, 
  image_cache = 0x0, 
  display_info = {
    tty = 0x0, 
    x = 0x0, 
    w32 = 0x0, 
    ns = 0x0
  }, 
  terminal_coding = 0xc2dbf0, 
  keyboard_coding = 0xc2d980, 
  rif = 0x0, 
  cursor_to_hook = 0x0, 
  raw_cursor_to_hook = 0x0, 
  clear_to_end_hook = 0x0, 
  clear_frame_hook = 0x0, 
  clear_end_of_line_hook = 0x0, 
  ins_del_lines_hook = 0x0, 
  insert_glyphs_hook = 0x0, 
  write_glyphs_hook = 0x0, 
  delete_glyphs_hook = 0x0, 
  ring_bell_hook = 0x0, 
  toggle_invisible_pointer_hook = 0x0, 
  reset_terminal_modes_hook = 0x0, 
---Type <return> to continue, or q <return> to quit---
  set_terminal_modes_hook = 0x0, 
  update_begin_hook = 0x0, 
  update_end_hook = 0x0, 
  set_terminal_window_hook = 0x0, 
  mouse_position_hook = 0x0, 
  frame_rehighlight_hook = 0x0, 
  frame_raise_lower_hook = 0x0, 
  fullscreen_hook = 0x0, 
  menu_show_hook = 0x0, 
  popup_dialog_hook = 0x0, 
  set_vertical_scroll_bar_hook = 0x0, 
  set_horizontal_scroll_bar_hook = 0x0, 
  condemn_scroll_bars_hook = 0x0, 
  redeem_scroll_bar_hook = 0x0, 
  judge_scroll_bars_hook = 0x0, 
  read_socket_hook = 0x0, 
  frame_up_to_date_hook = 0x0, 
  delete_frame_hook = 0x4b6ea0 <initial_free_frame_resources>, 
  delete_terminal_hook = 0x4b7690 <delete_initial_terminal>
}
(gdb) 








Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29548; Package emacs. (Fri, 05 Jan 2018 02:13:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: martin rudalics <rudalics <at> gmx.at>, 29548 <at> debbugs.gnu.org
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Thu, 04 Jan 2018 21:12:28 -0500
[Message part 1 (text/plain, inline)]
Live System User <nyc4bos <at> aol.com> writes:

>   Here's a new occurrance (see below):

Hmm, if you can reproduce this semi-regularly, then perhaps the
following patch can catch the reason for the problem.  It sets a
breakpoint in Fsignal while the terminal is in the process of being
deleted (requires reproducing the problem under gdb with the patched
.gdbinit loaded).

[0001-TEMP-Debugging-for-Bug-29548-terminal-deletion.patch (text/x-diff, inline)]
From 3178fb78ba044efcbf6c986b64b82e4adb36d203 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Thu, 4 Jan 2018 21:09:03 -0500
Subject: [PATCH] [TEMP] Debugging for Bug#29548 (terminal deletion)

---
 src/.gdbinit   | 22 ++++++++++++++++++++++
 src/terminal.c | 12 ++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/src/.gdbinit b/src/.gdbinit
index 83341c795a..4cfd2ca88a 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -1279,3 +1279,25 @@ commands
   end
   continue
 end
+
+break signal_or_quit
+set $bp_signal_or_quit_num = $bpnum
+disable $bp_signal_or_quit_num
+
+break begin_delete_terminal
+set $bp_begin_delete_terminal_num = $bpnum
+commands $bp_begin_delete_terminal_num
+  if delete_terminal_count == 0
+    enable $bp_signal_or_quit_num
+  end
+  continue
+end
+
+break end_delete_terminal
+set $bp_end_delete_terminal_num = $bpnum
+commands $bp_end_delete_terminal_num
+  if delete_terminal_count == 1
+    disable $bp_signal_or_quit_num
+  end
+  continue
+end
diff --git a/src/terminal.c b/src/terminal.c
index 0b1cbe7b79..3bf18c562d 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -311,6 +311,16 @@ create_terminal (enum output_method type, struct redisplay_interface *rif)
 /* Low-level function to close all frames on a terminal, remove it
    from the terminal list and free its memory.  */
 
+static int delete_terminal_count = 0;
+static void begin_delete_terminal (void)
+{
+    delete_terminal_count++;
+}
+static void end_delete_terminal (void)
+{
+    delete_terminal_count--;
+}
+
 void
 delete_terminal (struct terminal *terminal)
 {
@@ -321,6 +331,7 @@ delete_terminal (struct terminal *terminal)
      delete_terminal_hook when we delete our last frame.  */
   if (!terminal->name)
     return;
+  begin_delete_terminal();
   xfree (terminal->name);
   terminal->name = NULL;
 
@@ -339,6 +350,7 @@ delete_terminal (struct terminal *terminal)
     if (! *tp)
       emacs_abort ();
   *tp = terminal->next_terminal;
+  end_delete_terminal();
 
   xfree (terminal->keyboard_coding);
   terminal->keyboard_coding = NULL;
-- 
2.11.0


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29548; Package emacs. (Sat, 06 Jan 2018 10:18:02 GMT) Full text and rfc822 format available.

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

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: martin rudalics <rudalics <at> gmx.at>, 29548 <at> debbugs.gnu.org
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Sat, 06 Jan 2018 05:16:55 -0500
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> Live System User <nyc4bos <at> aol.com> writes:
>
>>   Here's a new occurrance (see below):
>
> Hmm, if you can reproduce this semi-regularly, then perhaps the
> following patch can catch the reason for the problem.  It sets a
> breakpoint in Fsignal while the terminal is in the process of being
> deleted (requires reproducing the problem under gdb with the patched
> .gdbinit loaded).

   I applied your patch; thanks for it.

   While playing around wirh the emacs daemon and TTY/GUI client frames,
   I got a slightly diffent error message this time  (I'lltry to see if
   I can get back into the same exact situation/error message I got
   before later...but here's this (perhaps?) slightly different one):

    $  emacsclient -t file1.txt
    *ERROR*: Terminal is not live, can’t create new frames on it

   In the *server* buffer, I see:
  
server <127.0.0.1:60208>: Terminal is not live, can’t create new
frames on it
server <127.0.0.1:60208>: Status changed to closed: connection broken
by remote peer
server <127.0.0.1:60208>: server-delete-client
server <127.0.0.1:60208>: Deleted

   (The screen quickly flashed the emacsclient frame and then it
   disappered).


   Your patch output displayed:


Breakpoint 3 at 0x508f7b: file terminal.c, line 317.
Breakpoint 4 at 0x508f91: file terminal.c, line 321.
(gdb) c
Continuing.
[New Thread 0x7fc3a0d25700 (LWP 7745)]
warning: the debug information found in "/usr/lib/debug//lib64/libfreebl3.so.debug" does not match "/lib64/libfreebl3.so" (CRC mismatch).

[New Thread 0x7fc39b162700 (LWP 7746)]

Thread 1 "emacs" hit Breakpoint 3, begin_delete_terminal () at terminal.c:317
317	    delete_terminal_count++;

Thread 1 "emacs" hit Breakpoint 4, end_delete_terminal () at terminal.c:321
321	    delete_terminal_count--;

Thread 1 "emacs" hit Breakpoint 3, begin_delete_terminal () at terminal.c:317
317	    delete_terminal_count++;

Thread 1 "emacs" hit Breakpoint 4, end_delete_terminal () at terminal.c:321
321	    delete_terminal_count--;

Thread 1 "emacs" hit Breakpoint 3, begin_delete_terminal () at terminal.c:317
317	    delete_terminal_count++;


   I noticed that this didn't end with a paired

             "delete_terminal_count--;".
             
   which it does do so normally.

   After the initial error, the "delete_terminal_count"  is no longer
   displayed.



   The *Messages* buffer contains multiple:

get-device-terminal: Invalid argument #<terminal 5> in
'get-device-terminal'
Error running timer battery-update-handler' (error Invalid argument
#<terminal 5> in 'get-device-terminal'")

   whenever its timer goes off.



   The "print_terminal_list" output was:


(gdb) print_terminal_list
$1 = {
  header = {
    size = 4611686018561773572
  }, 
  param_alist = 0, 
  charset_list = 0, 
  Vselection_alist = 0, 
  glyph_code_table = 0, 
  next_terminal = 0x0, 
  id = 0, 
  reference_count = 1, 
  type = output_initial, 
  name = 0xcaf940 "initial_terminal", 
  kboard = 0xce1fb0, 
  image_cache = 0x0, 
  display_info = {
    tty = 0x0, 
    x = 0x0, 
    w32 = 0x0, 
    ns = 0x0
  }, 
  terminal_coding = 0xce8d70, 
  keyboard_coding = 0xce8b00, 
---Type <return> to continue, or q <return> to quit---
  rif = 0x0, 
  cursor_to_hook = 0x0, 
  raw_cursor_to_hook = 0x0, 
  clear_to_end_hook = 0x0, 
  clear_frame_hook = 0x0, 
  clear_end_of_line_hook = 0x0, 
  ins_del_lines_hook = 0x0, 
  insert_glyphs_hook = 0x0, 
  write_glyphs_hook = 0x0, 
  delete_glyphs_hook = 0x0, 
  ring_bell_hook = 0x0, 
  toggle_invisible_pointer_hook = 0x0, 
  reset_terminal_modes_hook = 0x0, 
  set_terminal_modes_hook = 0x0, 
  update_begin_hook = 0x0, 
  update_end_hook = 0x0, 
  set_terminal_window_hook = 0x0, 
  mouse_position_hook = 0x0, 
  frame_rehighlight_hook = 0x0, 
  frame_raise_lower_hook = 0x0, 
  fullscreen_hook = 0x0, 
  menu_show_hook = 0x0, 
  popup_dialog_hook = 0x0, 
---Type <return> to continue, or q <return> to quit---
  set_vertical_scroll_bar_hook = 0x0, 
  set_horizontal_scroll_bar_hook = 0x0, 
  condemn_scroll_bars_hook = 0x0, 
  redeem_scroll_bar_hook = 0x0, 
  judge_scroll_bars_hook = 0x0, 
  read_socket_hook = 0x0, 
  frame_up_to_date_hook = 0x0, 
  delete_frame_hook = 0x509839 <initial_free_frame_resources>, 
  delete_terminal_hook = 0x5098f4 <delete_initial_terminal>
}
(gdb) 


   Thanks.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29548; Package emacs. (Wed, 10 Jan 2018 03:52:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: martin rudalics <rudalics <at> gmx.at>, 29548 <at> debbugs.gnu.org
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Tue, 09 Jan 2018 22:51:47 -0500
Live System User <nyc4bos <at> aol.com> writes:

> Noam Postavsky <npostavs <at> users.sourceforge.net> writes:
>
>> Hmm, if you can reproduce this semi-regularly, then perhaps the
>> following patch can catch the reason for the problem.  It sets a
>> breakpoint in Fsignal while the terminal is in the process of being

I said Fsignal, but posted a patching breaking in signal_or_quit.  The
latter only exists in emacs-26.  Are you running that or 25.2 as in your
original report?

Actually I think it might work better to break in longjmp instead.

> Thread 1 "emacs" hit Breakpoint 3, begin_delete_terminal () at terminal.c:317
> 317	    delete_terminal_count++;
>
>
>    I noticed that this didn't end with a paired
>
>              "delete_terminal_count--;".
>              
>    which it does do so normally.

I believe this means that the problem is indeed a non-local exit
happening somewhere in there, but we failed to catch it.  Either because
I posted the Emacs 26 version while you are on Emacs 25, or it doesn't
go through the signal machinery at all.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29548; Package emacs. (Wed, 14 Feb 2018 17:27:02 GMT) Full text and rfc822 format available.

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

From: Live System User <nyc4bos <at> aol.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: martin rudalics <rudalics <at> gmx.at>, 29548 <at> debbugs.gnu.org
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Wed, 14 Feb 2018 12:26:19 -0500
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> Live System User <nyc4bos <at> aol.com> writes:
>
>> Noam Postavsky <npostavs <at> users.sourceforge.net> writes:
>>
>>> Hmm, if you can reproduce this semi-regularly, then perhaps the
>>> following patch can catch the reason for the problem.  It sets a
>>> breakpoint in Fsignal while the terminal is in the process of being
>
> I said Fsignal, but posted a patching breaking in signal_or_quit.  The
> latter only exists in emacs-26.  Are you running that or 25.2 as in your
> original report?
>
> Actually I think it might work better to break in longjmp instead.

  Where would I do that?
  
>
>> Thread 1 "emacs" hit Breakpoint 3, begin_delete_terminal () at terminal.c:317
>> 317	    delete_terminal_count++;
>>
>>
>>    I noticed that this didn't end with a paired
>>
>>              "delete_terminal_count--;".
>>              
>>    which it does do so normally.
>
> I believe this means that the problem is indeed a non-local exit
> happening somewhere in there, but we failed to catch it.  Either because
> I posted the Emacs 26 version while you are on Emacs 25, or it doesn't
> go through the signal machinery at all.


  When I first start up Emacs daemon. attach GDB, define commands,
  and then continue:


(gdb) define print_terminal_list
Type commands for definition of "print_terminal_list".
End with a line saying just "end"
>set $t = terminal_list
>while $t
 >print *$t
 >set $t = $t->next_terminal
 >end
>end
(gdb) c
Continuing.



 I see the following immediately upon creating a GUI
 frame via "emacsclient -c":

There is no member named name.

 What does this message mean?
 (Presumably. this is from .gdbinit)

 When I subsequently create a TTY framel I do not
 get this message.
 
 Here is the "terminal list":


(gdb) print_terminal_list
$1 = {
  header = {
    size = 4611686018561777668, 
    gcaligned = 4 '\004'
  }, 
  param_alist = XIL(0), 
  charset_list = XIL(0), 
  Vselection_alist = XIL(0), 
  glyph_code_table = XIL(0), 
  next_terminal = 0x3c63270, 
  id = 6, 
  reference_count = 0, 
  type = output_termcap, 
  name = 0x2b4fc10 "/dev/pts/8", 
  kboard = 0x3dcba00, 
  image_cache = 0x0, 
  display_info = {
    tty = 0x2ea9e00, 
    x = 0x2ea9e00, 
    w32 = 0x2ea9e00, 
    ns = 0x2ea9e00
  }, 
  terminal_coding = 0x2751100, 
---Type <return> to continue, or q <return> to quit---
  keyboard_coding = 0x24c0f00, 
  rif = 0x0, 
  cursor_to_hook = 0x4f8d81 <tty_cursor_to>, 
  raw_cursor_to_hook = 0x4f8e5d <tty_raw_cursor_to>, 
  clear_to_end_hook = 0x4f8f1f <tty_clear_to_end>, 
  clear_frame_hook = 0x4f9022 <tty_clear_frame>, 
  clear_end_of_line_hook = 0x4f9116 <tty_clear_end_of_line>, 
  ins_del_lines_hook = 0x4facda <tty_ins_del_lines>, 
  insert_glyphs_hook = 0x4fa63c <tty_insert_glyphs>, 
  write_glyphs_hook = 0x4f9f77 <tty_write_glyphs>, 
  delete_glyphs_hook = 0x4faae4 <tty_delete_glyphs>, 
  ring_bell_hook = 0x4f8059 <tty_ring_bell>, 
  toggle_invisible_pointer_hook = 0x0, 
  reset_terminal_modes_hook = 0x4f843a <tty_reset_terminal_modes>, 
  set_terminal_modes_hook = 0x4f8254 <tty_set_terminal_modes>, 
  update_begin_hook = 0x0, 
  update_end_hook = 0x4f860f <tty_update_end>, 
  set_terminal_window_hook = 0x4f86b6 <tty_set_terminal_window>, 
  mouse_position_hook = 0x4fe4e2 <term_mouse_position>, 
  frame_rehighlight_hook = 0x0, 
  frame_raise_lower_hook = 0x0, 
  fullscreen_hook = 0x0, 
  menu_show_hook = 0x500c1d <tty_menu_show>, 
---Type <return> to continue, or q <return> to quit---
  popup_dialog_hook = 0x0, 
  set_vertical_scroll_bar_hook = 0x0, 
  set_horizontal_scroll_bar_hook = 0x0, 
  condemn_scroll_bars_hook = 0x0, 
  redeem_scroll_bar_hook = 0x0, 
  judge_scroll_bars_hook = 0x0, 
  read_socket_hook = 0x566c0e <tty_read_avail_input>, 
  frame_up_to_date_hook = 0x0, 
  buffer_flipping_unblocked_hook = 0x0, 
  delete_frame_hook = 0x5017eb <tty_free_frame_resources>, 
  delete_terminal_hook = 0x503230 <delete_tty>
}
$2 = {
  header = {
    size = 4611686018561777668, 
    gcaligned = 4 '\004'
  }, 
  param_alist = XIL(0x398c6d3), 
  charset_list = XIL(0), 
  Vselection_alist = XIL(0), 
  glyph_code_table = XIL(0), 
  next_terminal = 0xd38140, 
  id = 5, 
---Type <return> to continue, or q <return> to quit---
  reference_count = 1, 
  type = output_x_window, 
  name = 0x3452030 ":0", 
  kboard = 0x33f1130, 
  image_cache = 0x2948760, 
  display_info = {
    tty = 0x3665600, 
    x = 0x3665600, 
    w32 = 0x3665600, 
    ns = 0x3665600
  }, 
  terminal_coding = 0x399ea00, 
  keyboard_coding = 0x3711000, 
  rif = 0x92d640 <x_redisplay_interface>, 
  cursor_to_hook = 0x0, 
  raw_cursor_to_hook = 0x0, 
  clear_to_end_hook = 0x0, 
  clear_frame_hook = 0x518b22 <x_clear_frame>, 
  clear_end_of_line_hook = 0x0, 
  ins_del_lines_hook = 0x51938c <x_ins_del_lines>, 
  insert_glyphs_hook = 0x0, 
  write_glyphs_hook = 0x0, 
  delete_glyphs_hook = 0x5189c2 <x_delete_glyphs>, 
---Type <return> to continue, or q <return> to quit---
  ring_bell_hook = 0x519312 <XTring_bell>, 
  toggle_invisible_pointer_hook = 0x5192cc <XTtoggle_invisible_pointer>, 
  reset_terminal_modes_hook = 0x0, 
  set_terminal_modes_hook = 0x0, 
  update_begin_hook = 0x51163b <x_update_begin>, 
  update_end_hook = 0x511eef <x_update_end>, 
  set_terminal_window_hook = 0x0, 
  mouse_position_hook = 0x51ab85 <XTmouse_position>, 
  frame_rehighlight_hook = 0x519fe3 <XTframe_rehighlight>, 
  frame_raise_lower_hook = 0x525056 <XTframe_raise_lower>, 
  fullscreen_hook = 0x523cfb <XTfullscreen_hook>, 
  menu_show_hook = 0x498353 <x_menu_show>, 
  popup_dialog_hook = 0x4994da <xw_popup_dialog>, 
  set_vertical_scroll_bar_hook = 0x51bd30 <XTset_vertical_scroll_bar>, 
  set_horizontal_scroll_bar_hook = 0x51c2c7 <XTset_horizontal_scroll_bar>, 
  condemn_scroll_bars_hook = 0x51ca88 <XTcondemn_scroll_bars>, 
  redeem_scroll_bar_hook = 0x51cb79 <XTredeem_scroll_bar>, 
  judge_scroll_bars_hook = 0x51d085 <XTjudge_scroll_bars>, 
  read_socket_hook = 0x5208f0 <XTread_socket>, 
  frame_up_to_date_hook = 0x511f45 <XTframe_up_to_date>, 
  buffer_flipping_unblocked_hook = 0x512006 <XTbuffer_flipping_unblocked_hook>, 
  delete_frame_hook = 0x526493 <x_destroy_window>, 
---Type <return> to continue, or q <return> to quit---
  delete_terminal_hook = 0x527ec2 <x_delete_terminal>
}
$3 = {
  header = {
    size = 4611686018561777668, 
    gcaligned = 4 '\004'
  }, 
  param_alist = XIL(0x1217ec3), 
  charset_list = XIL(0x1134013), 
  Vselection_alist = XIL(0), 
  glyph_code_table = XIL(0), 
  next_terminal = 0x0, 
  id = 0, 
  reference_count = 1, 
  type = output_initial, 
  name = 0xce6940 "initial_terminal", 
  kboard = 0xd33a00, 
  image_cache = 0x0, 
  display_info = {
    tty = 0x0, 
    x = 0x0, 
    w32 = 0x0, 
    ns = 0x0
---Type <return> to continue, or q <return> to quit---
  }, 
  terminal_coding = 0xd3abe0, 
  keyboard_coding = 0xd3a970, 
  rif = 0x0, 
  cursor_to_hook = 0x0, 
  raw_cursor_to_hook = 0x0, 
  clear_to_end_hook = 0x0, 
  clear_frame_hook = 0x0, 
  clear_end_of_line_hook = 0x0, 
  ins_del_lines_hook = 0x0, 
  insert_glyphs_hook = 0x0, 
  write_glyphs_hook = 0x0, 
  delete_glyphs_hook = 0x0, 
  ring_bell_hook = 0x0, 
  toggle_invisible_pointer_hook = 0x0, 
  reset_terminal_modes_hook = 0x0, 
  set_terminal_modes_hook = 0x0, 
  update_begin_hook = 0x0, 
  update_end_hook = 0x0, 
  set_terminal_window_hook = 0x0, 
  mouse_position_hook = 0x0, 
  frame_rehighlight_hook = 0x0, 
  frame_raise_lower_hook = 0x0, 
---Type <return> to continue, or q <return> to quit---
  fullscreen_hook = 0x0, 
  menu_show_hook = 0x0, 
  popup_dialog_hook = 0x0, 
  set_vertical_scroll_bar_hook = 0x0, 
  set_horizontal_scroll_bar_hook = 0x0, 
  condemn_scroll_bars_hook = 0x0, 
  redeem_scroll_bar_hook = 0x0, 
  judge_scroll_bars_hook = 0x0, 
  read_socket_hook = 0x0, 
  frame_up_to_date_hook = 0x0, 
  buffer_flipping_unblocked_hook = 0x0, 
  delete_frame_hook = 0x5044cf <initial_free_frame_resources>, 
  delete_terminal_hook = 0x50458a <delete_initial_terminal>
}
(gdb) c
Continuing.

Thread 1 "emacs" hit Breakpoint 5, begin_delete_terminal () at terminal.c:317
317	    delete_terminal_count++;

Thread 1 "emacs" hit Breakpoint 6, end_delete_terminal () at terminal.c:321
321	    delete_terminal_count--;

"  




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29548; Package emacs. (Sun, 18 Feb 2018 22:43:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Live System User <nyc4bos <at> aol.com>
Cc: martin rudalics <rudalics <at> gmx.at>, 29548 <at> debbugs.gnu.org,
 Noam Postavsky <npostavs <at> users.sourceforge.net>
Subject: Re: bug#29548: 25.2; How to DEBUG get-device-terminal
Date: Sun, 18 Feb 2018 17:41:55 -0500
Live System User <nyc4bos <at> aol.com> writes:

> Noam Postavsky <npostavs <at> users.sourceforge.net> writes:
>
>> Live System User <nyc4bos <at> aol.com> writes:
>>
>>> Noam Postavsky <npostavs <at> users.sourceforge.net> writes:
>>>
>>>> Hmm, if you can reproduce this semi-regularly, then perhaps the
>>>> following patch can catch the reason for the problem.  It sets a
>>>> breakpoint in Fsignal while the terminal is in the process of being
>>
>> I said Fsignal, but posted a patching breaking in signal_or_quit.  The
>> latter only exists in emacs-26.  Are you running that or 25.2 as in your
>> original report?
>>
>> Actually I think it might work better to break in longjmp instead.
>
>   Where would I do that?

Um, maybe in the .gdbinit patch I posted replace signal_or_quit with
'siglongjmp'?  Does anyone else have ideas how to catch this sort of
thing?

>  I see the following immediately upon creating a GUI
>  frame via "emacsclient -c":
>
> There is no member named name.
>
>  What does this message mean?
>  (Presumably. this is from .gdbinit)

Not sure.  Maybe add some printfs in .gdbinit to pin it down?




Added tag(s) wontfix. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 09 Jan 2019 19:40:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 29548 <at> debbugs.gnu.org and Live System User <nyc4bos <at> aol.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 09 Jan 2019 19:40:02 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. (Thu, 07 Feb 2019 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 77 days ago.

Previous Next


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