bug#29548: 25.2; How to DEBUG get-device-terminal

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#29548: 25.2; How to DEBUG get-device-terminal

Live System User

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))



Reply | Threaded
Open this post in threaded view
|

bug#29548: 25.2; How to DEBUG get-device-terminal

Noam Postavsky-2
Live System User <[hidden email]> 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).



Reply | Threaded
Open this post in threaded view
|

bug#29548: 25.2; How to DEBUG get-device-terminal

Live System User
Noam Postavsky <[hidden email]> writes:

> Live System User <[hidden email]> 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@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@entry=2, args=<optimized out>,
    args@entry=0x878274 <pure+104404>) at ../../src/bytecode.c:880
#3  0x0000000000566416 in funcall_lambda (fun=XIL(0x7ffe5e974ce0),
    nargs=nargs@entry=2, arg_vector=0x878274 <pure+104404>,
    arg_vector@entry=0x7ffe5e974c48) at ../../src/eval.c:2863
#4  0x00000000005666db in Ffuncall (nargs=3, args=args@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@entry=1, args=<optimized out>,
    args@entry=0x97c484 <pure+1169892>) at ../../src/bytecode.c:880
#6  0x0000000000566416 in funcall_lambda (fun=XIL(0x7ffe5e974ea0),
    nargs=nargs@entry=1, arg_vector=0x97c484 <pure+1169892>,
    arg_vector@entry=0x7ffe5e974e08) at ../../src/eval.c:2863
#7  0x00000000005666db in Ffuncall (nargs=2, args=args@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@entry=1, args=<optimized out>,
    args@entry=0x97c5d4 <pure+1170228>) at ../../src/bytecode.c:880
#9  0x0000000000566416 in funcall_lambda (fun=XIL(0x7ffe5e975040),
    nargs=nargs@entry=1, arg_vector=0x97c5d4 <pure+1170228>,
    arg_vector@entry=0x7ffe5e974fc0) at ../../src/eval.c:2863
#10 0x00000000005666db in Ffuncall (nargs=2, args=args@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@entry=XIL(0), nargs=nargs@entry=0,
    args=<optimized out>, args@entry=0x0) at ../../src/bytecode.c:880
#12 0x00000000005662ed in funcall_lambda (fun=XIL(0x8a6a3d),
    nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7ffe5e9751c8)
    at ../../src/eval.c:2929
#13 0x00000000005666db in Ffuncall (nargs=nargs@entry=2,
    args=args@entry=0x7ffe5e9751c0) at ../../src/eval.c:2760
#14 0x00000000005669da in call1 (fn=fn@entry=XIL(0x8a6a3d),
    arg1=<optimized out>) at ../../src/eval.c:2558
#15 0x000000000056daaa in mapcar1 (leni=leni@entry=3,
    vals=vals@entry=0x7ffe5e975250, fn=fn@entry=XIL(0x8a6a3d),
    seq=seq@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@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@entry=XIL(0), nargs=nargs@entry=0,
    args=<optimized out>, args@entry=0x0) at ../../src/bytecode.c:880
#19 0x00000000005662ed in funcall_lambda (fun=XIL(0x8a69bd),
    nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x7ffe5e9755b0)
    at ../../src/eval.c:2929
#20 0x00000000005666db in Ffuncall (nargs=1, args=args@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@entry=XIL(0), nargs=nargs@entry=0,
    args=<optimized out>, args@entry=0x0) at ../../src/bytecode.c:880
#22 0x00000000005662ed in funcall_lambda (fun=fun@entry=XIL(0x8acec5),
    nargs=nargs@entry=3, arg_vector=arg_vector@entry=0x7ffe5e975710)
    at ../../src/eval.c:2929
#23 0x0000000000565768 in apply_lambda (fun=XIL(0x8acec5),
    args=<optimized out>, count=count@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@entry=0,
    arg_vector=arg_vector@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@entry=2,
    args=args@entry=0x7ffe5e975ac0) at ../../src/eval.c:2679
#35 0x00000000005669da in call1 (fn=<optimized out>,
    arg1=arg1@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@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@entry=1, args=<optimized out>,
    args@entry=0x8c314c <pure+411308>) at ../../src/bytecode.c:880
#39 0x0000000000566416 in funcall_lambda (fun=XIL(0x7ffe5e975e30),
    nargs=nargs@entry=1, arg_vector=0x8c314c <pure+411308>,
    arg_vector@entry=0x7ffe5e975d60) at ../../src/eval.c:2863
#40 0x00000000005666db in Ffuncall (nargs=2, args=args@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@entry=XIL(0), nargs=nargs@entry=0,
    args=<optimized out>, args@entry=0x0) at ../../src/bytecode.c:880
#42 0x00000000005662ed in funcall_lambda (fun=XIL(0x1357aa5),
    nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x7ffe5e975fc0)
    at ../../src/eval.c:2929
#43 0x00000000005666db in Ffuncall (nargs=1, args=args@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@entry=XIL(0), nargs=nargs@entry=0,
    args=<optimized out>, args@entry=0x0) at ../../src/bytecode.c:880
#45 0x00000000005662ed in funcall_lambda (fun=XIL(0x1355a05),
    nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x7ffe5e9761e0)
---Type <return> to continue, or q <return> to quit---
    at ../../src/eval.c:2929
#46 0x00000000005666db in Ffuncall (nargs=1, args=args@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@entry=XIL(0), nargs=nargs@entry=0,
    args=<optimized out>, args@entry=0x0) at ../../src/bytecode.c:880
#48 0x00000000005662ed in funcall_lambda (fun=XIL(0x135594d),
    nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x7ffe5e976508)
    at ../../src/eval.c:2929
#49 0x00000000005666db in Ffuncall (nargs=nargs@entry=1,
    args=args@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@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@entry=XIL(0), nargs=nargs@entry=0,
    args=<optimized out>, args@entry=0x0) at ../../src/bytecode.c:880
#53 0x00000000005662ed in funcall_lambda (fun=XIL(0x9b3855),
    nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7ffe5e976718)
    at ../../src/eval.c:2929
---Type <return> to continue, or q <return> to quit---
#54 0x00000000005666db in Ffuncall (nargs=nargs@entry=2,
    args=args@entry=0x7ffe5e976710) at ../../src/eval.c:2760
#55 0x00000000005669da in call1 (fn=fn@entry=XIL(0xb340),
    arg1=arg1@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@entry=0, nsecs=nsecs@entry=0,
    read_kbd=read_kbd@entry=-1, do_display=true,
    wait_for_cell=wait_for_cell@entry=XIL(0), wait_proc=wait_proc@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@entry=1, map=map@entry=XIL(0x1f9cd43),
    prev_event=XIL(0), used_mouse_menu=used_mouse_menu@entry=0x7ffe5e9773cb,
    end_time=end_time@entry=0x0) at ../../src/keyboard.c:2804
---Type <return> to continue, or q <return> to quit---
#63 0x00000000004fe62d in read_key_sequence (
    keybuf=keybuf@entry=0x7ffe5e9774c0, 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, 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@entry=0x500040 <command_loop_1>,
    handlers=handlers@entry=XIL(0x4b00), hfun=hfun@entry=0x4f68c0 <cmd_error>)
    at ../../src/eval.c:1315
#66 0x00000000004f1cf4 in command_loop_2 (ignore=ignore@entry=XIL(0))
    at ../../src/keyboard.c:1112
#67 0x0000000000564fa3 in internal_catch (tag=tag@entry=XIL(0xb580),
    func=func@entry=0x4f1cd0 <command_loop_2>, arg=arg@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)







Reply | Threaded
Open this post in threaded view
|

bug#29548: 25.2; How to DEBUG get-device-terminal

Noam Postavsky-2
On Wed, Dec 6, 2017 at 1:49 PM, Live System User <[hidden email]> 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]



Reply | Threaded
Open this post in threaded view
|

bug#29548: 25.2; How to DEBUG get-device-terminal

Live System User
Noam Postavsky <[hidden email]> writes:

> On Wed, Dec 6, 2017 at 1:49 PM, Live System User <[hidden email]> 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)



Reply | Threaded
Open this post in threaded view
|

bug#29548: 25.2; How to DEBUG get-device-terminal

martin rudalics
In reply to this post by Noam Postavsky-2
 > So this function is getting the terminal list by calling
 > list-terminals.

What function is `list-terminals'?

martin



Reply | Threaded
Open this post in threaded view
|

bug#29548: 25.2; How to DEBUG get-device-terminal

Noam Postavsky-2
martin rudalics <[hidden email]> writes:

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

Sorry, I meant terminal-list.



Reply | Threaded
Open this post in threaded view
|

bug#29548: 25.2; How to DEBUG get-device-terminal

Noam Postavsky-2
In reply to this post by Live System User
Live System User <[hidden email]> 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.