unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org, mkupfer@alum.berkeley.edu
Subject: Re: misbehavior in shell window with ksh
Date: Tue, 02 May 2017 18:55:01 +0200	[thread overview]
Message-ID: <8760hjjj16.fsf@rosalinde> (raw)
In-Reply-To: <83fugni5i8.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 02 May 2017 19:32:31 +0300")

On Tue, 02 May 2017 19:32:31 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: mkupfer@alum.berkeley.edu,  emacs-devel@gnu.org
>> Date: Tue, 02 May 2017 14:35:44 +0200
>> 
>> > What if you step into comint-output-filter with Edebug (as you already
>> > seem to have a way of doing that), then type 'd' to produce a
>> > backtrace?  Does that show who called comint-output-filter?
>> 
>> Unfortunately not.  FTR: I instrumented comint-output-filter for Edebug
>> and started the recipe.  On entering `ksh RET' at the shell prompt,
>> Edebug took control and I typed `d' and got this backtrace:
>> 
>>   comint-output-filter(#<process shell> "steve@rosalinde:/home/steve> ")
>> 
>> I typed `q' and continued with the recipe, and at `C-x 0' (M-o and M-0
>> above were typos) Edebug again took over, and `d' produced this
>> backtrace:
>> 
>>   comint-output-filter(#<process shell> "> ")
>> 
>> > It could be that it is called by the process-filter mechanism, which
>> > is in C.  But what we want to know is where does the 2nd arg of
>> > comint-output-filter comes from, and why.
>> 
>> If you can advise me what to try in gdb, I can do that.
>
> Get Emacs to stop in comint-output-filter using Edebug, then attach
> GDB, make sure src/.gdbinit is being source'd by GDB, and type
>
>   (gdb) bt
>
> This should producve both C-level backtrace and Lisp-level backtrace.

Here they are:

#0  0x00007fd0f3733bd9 in pselect () at /lib64/libc.so.6
#1  0x00000000005ab745 in really_call_select (arg=arg@entry=0x7ffcbb813cc0)
    at /home/steve/git/emacs-master/src/thread.c:566
#2  0x000000000053d8c6 in flush_stack_call_func (func=func@entry=0x5ab6fa <really_call_select>, arg=arg@entry=0x7ffcbb813cc0)
    at /home/steve/git/emacs-master/src/alloc.c:5153
#3  0x00000000005abc0b in thread_select (func=<optimized out>, max_fds=max_fds@entry=19, rfds=rfds@entry=0x7ffcbb8141e0, wfds=<optimized out>, efds=efds@entry=0x0, timeout=timeout@entry=0x7ffcbb814430, sigmask=sigmask@entry=0x0)
    at /home/steve/git/emacs-master/src/thread.c:589
#4  0x00000000005c6391 in xg_select (fds_lim=19, rfds=rfds@entry=0x7ffcbb8144d0, wfds=0x7ffcbb814450, efds=efds@entry=0x0, timeout=timeout@entry=0x7ffcbb814430, sigmask=sigmask@entry=0x0) at /home/steve/git/emacs-master/src/xgselect.c:117
#5  0x00000000005903da in wait_reading_process_output (time_limit=time_limit@entry=67, nsecs=nsecs@entry=0, read_kbd=<optimized out>, do_display=do_display@entry=true, wait_for_cell=wait_for_cell@entry=0, wait_proc=wait_proc@entry=0x0, just_wait_proc=just_wait_proc@entry=0) at /home/steve/git/emacs-master/src/process.c:5355
#6  0x0000000000421953 in sit_for (timeout=timeout@entry=270, reading=reading@entry=true, display_option=display_option@entry=1)
    at /home/steve/git/emacs-master/src/dispnew.c:5763
#7  0x00000000004f313e in read_char (commandflag=1, map=map@entry=55836707, prev_event=0, used_mouse_menu=used_mouse_menu@entry=0x7ffcbb8148eb, end_time=end_time@entry=0x0) at /home/steve/git/emacs-master/src/keyboard.c:2722
#8  0x00000000004f4252 in read_key_sequence (keybuf=keybuf@entry=0x7ffcbb8149a0, bufsize=bufsize@entry=30, prompt=prompt@entry=0, dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true, fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false)
    at /home/steve/git/emacs-master/src/keyboard.c:9122
#9  0x00000000004f57aa in command_loop_1 ()
---Type <return> to continue, or q <return> to quit---
    at /home/steve/git/emacs-master/src/keyboard.c:1370
#10 0x00000000005533cd in internal_condition_case (bfun=bfun@entry=0x4f54cf <command_loop_1>, handlers=handlers@entry=19968, hfun=hfun@entry=0x4eca3d <cmd_error>)
    at /home/steve/git/emacs-master/src/eval.c:1324
#11 0x00000000004e840f in command_loop_2 (ignore=ignore@entry=0)
    at /home/steve/git/emacs-master/src/keyboard.c:1112
#12 0x0000000000553347 in internal_catch (tag=tag@entry=20640, func=func@entry=0x4e83f7 <command_loop_2>, arg=arg@entry=0)
    at /home/steve/git/emacs-master/src/eval.c:1091
#13 0x00000000004e83e7 in command_loop ()
    at /home/steve/git/emacs-master/src/keyboard.c:1083
#14 0x00000000004ec6c1 in recursive_edit_1 ()
    at /home/steve/git/emacs-master/src/keyboard.c:697
#15 0x00000000004ec98a in Frecursive_edit ()
    at /home/steve/git/emacs-master/src/keyboard.c:768
#16 0x00000000005554bb in funcall_subr (subr=0x843120 <Srecursive_edit>, numargs=numargs@entry=0, args=args@entry=0x7ffcbb814c58)
    at /home/steve/git/emacs-master/src/eval.c:2815
#17 0x000000000055497a in Ffuncall (nargs=nargs@entry=1, args=args@entry=0x7ffcbb814c50) at /home/steve/git/emacs-master/src/eval.c:2742
#18 0x0000000000585ea3 in exec_byte_code (bytestr=<optimized out>, vector=47927725, maxdepth=<optimized out>, args_template=args_template@entry=1030, nargs=nargs@entry=1, args=<optimized out>, args@entry=0x7ffcbb814f78)
    at /home/steve/git/emacs-master/src/bytecode.c:641
#19 0x00000000005545e4 in funcall_lambda (fun=47928061, nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7ffcbb814f78) at /home/steve/git/emacs-master/src/eval.c:2942
#20 0x00000000005549a6 in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x7ffcbb814f70) at /home/steve/git/emacs-master/src/eval.c:2744
#21 0x0000000000585ea3 in exec_byte_code (bytestr=<optimized out>, vector=47926757, m---Type <return> to continue, or q <return> to quit---
axdepth=<optimized out>, args_template=args_template@entry=3086, nargs=nargs@entry=3, args=<optimized out>, args@entry=0x7ffcbb815338)
    at /home/steve/git/emacs-master/src/bytecode.c:641
#22 0x00000000005545e4 in funcall_lambda (fun=47927453, nargs=nargs@entry=3, arg_vector=arg_vector@entry=0x7ffcbb815338) at /home/steve/git/emacs-master/src/eval.c:2942
#23 0x00000000005549a6 in Ffuncall (nargs=nargs@entry=4, args=args@entry=0x7ffcbb815330) at /home/steve/git/emacs-master/src/eval.c:2744
#24 0x0000000000585ea3 in exec_byte_code (bytestr=<optimized out>, vector=18637573, maxdepth=<optimized out>, args_template=args_template@entry=3086, nargs=nargs@entry=3, args=<optimized out>, args@entry=0x7ffcbb815508)
    at /home/steve/git/emacs-master/src/bytecode.c:641
#25 0x00000000005545e4 in funcall_lambda (fun=47926149, nargs=nargs@entry=3, arg_vector=arg_vector@entry=0x7ffcbb815508) at /home/steve/git/emacs-master/src/eval.c:2942
#26 0x00000000005549a6 in Ffuncall (nargs=nargs@entry=4, args=args@entry=0x7ffcbb815500) at /home/steve/git/emacs-master/src/eval.c:2744
#27 0x0000000000585ea3 in exec_byte_code (bytestr=<optimized out>, vector=47925941, maxdepth=<optimized out>, args_template=args_template@entry=3086, nargs=nargs@entry=3, args=<optimized out>, args@entry=0x7ffcbb815738)
    at /home/steve/git/emacs-master/src/bytecode.c:641
#28 0x00000000005545e4 in funcall_lambda (fun=47926101, nargs=nargs@entry=3, arg_vector=arg_vector@entry=0x7ffcbb815738) at /home/steve/git/emacs-master/src/eval.c:2942
#29 0x00000000005549a6 in Ffuncall (nargs=nargs@entry=4, args=args@entry=0x7ffcbb815730) at /home/steve/git/emacs-master/src/eval.c:2744
#30 0x0000000000585ea3 in exec_byte_code (bytestr=<optimized out>, vector=47925357, maxdepth=<optimized out>, args_template=args_template@entry=1030, nargs=nargs@entry=1, args=<optimized out>, args@entry=0x7ffcbb8158b0)
    at /home/steve/git/emacs-master/src/bytecode.c:641
#31 0x00000000005545e4 in funcall_lambda (fun=fun@entry=47925437, nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7ffcbb8158b0)
---Type <return> to continue, or q <return> to quit---
    at /home/steve/git/emacs-master/src/eval.c:2942
#32 0x0000000000553cad in apply_lambda (fun=fun@entry=47925437, args=<optimized out>, count=count@entry=32) at /home/steve/git/emacs-master/src/eval.c:2879
#33 0x0000000000554290 in eval_sub (form=form@entry=52890883)
    at /home/steve/git/emacs-master/src/eval.c:2263
#34 0x0000000000553c6c in apply_lambda (fun=fun@entry=47925621, args=<optimized out>, count=count@entry=31) at /home/steve/git/emacs-master/src/eval.c:2874
#35 0x0000000000554290 in eval_sub (form=<optimized out>)
    at /home/steve/git/emacs-master/src/eval.c:2263
#36 0x0000000000554469 in Fprogn (body=53182579)
    at /home/steve/git/emacs-master/src/eval.c:449
#37 0x00000000005547c2 in funcall_lambda (fun=50274099, nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x7ffcbb815c38) at /home/steve/git/emacs-master/src/eval.c:3013
#38 0x0000000000554a04 in Ffuncall (nargs=nargs@entry=1, args=args@entry=0x7ffcbb815c30) at /home/steve/git/emacs-master/src/eval.c:2756
#39 0x0000000000585ea3 in exec_byte_code (bytestr=<optimized out>, vector=47981685, maxdepth=<optimized out>, args_template=args_template@entry=3086, nargs=nargs@entry=3, args=<optimized out>, args@entry=0x7ffcbb815eb8)
    at /home/steve/git/emacs-master/src/bytecode.c:641
#40 0x00000000005545e4 in funcall_lambda (fun=47982005, nargs=nargs@entry=3, arg_vector=arg_vector@entry=0x7ffcbb815eb8) at /home/steve/git/emacs-master/src/eval.c:2942
#41 0x00000000005549a6 in Ffuncall (nargs=nargs@entry=4, args=args@entry=0x7ffcbb815eb0) at /home/steve/git/emacs-master/src/eval.c:2744
#42 0x0000000000585ea3 in exec_byte_code (bytestr=<optimized out>, vector=47981685, maxdepth=<optimized out>, args_template=args_template@entry=3086, nargs=nargs@entry=3, args=<optimized out>, args@entry=0x7ffcbb8160c0)
    at /home/steve/git/emacs-master/src/bytecode.c:641
#43 0x00000000005545e4 in funcall_lambda (fun=fun@entry=47982005, nargs=nargs@entry=3, arg_vector=arg_vector@entry=0x7ffcbb8160c0)
---Type <return> to continue, or q <return> to quit---
    at /home/steve/git/emacs-master/src/eval.c:2942
#44 0x0000000000553cad in apply_lambda (fun=fun@entry=47982005, args=<optimized out>, count=count@entry=9) at /home/steve/git/emacs-master/src/eval.c:2879
#45 0x0000000000554290 in eval_sub (form=<optimized out>)
    at /home/steve/git/emacs-master/src/eval.c:2263
#46 0x0000000000554469 in Fprogn (body=53182403)
    at /home/steve/git/emacs-master/src/eval.c:449
#47 0x00000000005547c2 in funcall_lambda (fun=53178035, nargs=nargs@entry=2, arg_vector=arg_vector@entry=0x7ffcbb8162e8) at /home/steve/git/emacs-master/src/eval.c:3013
#48 0x0000000000554a04 in Ffuncall (nargs=nargs@entry=3, args=args@entry=0x7ffcbb8162e0) at /home/steve/git/emacs-master/src/eval.c:2756
#49 0x0000000000555f85 in Fapply (nargs=nargs@entry=2, args=args@entry=0x7ffcbb816380) at /home/steve/git/emacs-master/src/eval.c:2373
#50 0x0000000000555feb in apply1 (fn=4150696, arg=<optimized out>)
    at /home/steve/git/emacs-master/src/eval.c:2589
#51 0x0000000000589297 in read_process_output_call (fun_and_args=fun_and_args@entry=50273987) at /home/steve/git/emacs-master/src/process.c:5771
#52 0x0000000000553443 in internal_condition_case_1 (bfun=bfun@entry=0x589286 <read_process_output_call>, arg=50273987, handlers=handlers@entry=19968, hfun=hfun@entry=0x589218 <read_process_output_error_handler>)
    at /home/steve/git/emacs-master/src/eval.c:1348
#53 0x0000000000588e2f in read_and_dispose_of_process_output (p=p@entry=0x1365d60, chars=chars@entry=0x7ffcbb816460 "> ", nbytes=nbytes@entry=2, coding=coding@entry=0x105c330) at /home/steve/git/emacs-master/src/process.c:5979
#54 0x0000000000589095 in read_process_output (proc=proc@entry=20340069, channel=channel@entry=18) at /home/steve/git/emacs-master/src/process.c:5890
#55 0x0000000000590a0a in wait_reading_process_output (time_limit=time_limit@entry=30, nsecs=nsecs@entry=0, read_kbd=<optimized out>, do_display=do_display@entry=true, wait_for_cell=wait_for_cell@entry=0, wait_proc=wait_proc@entry=0x0, just_wait_proc=just---Type <return> to continue, or q <return> to quit---
_wait_proc@entry=0) at /home/steve/git/emacs-master/src/process.c:5589
#56 0x0000000000421953 in sit_for (timeout=timeout@entry=122, reading=reading@entry=true, display_option=display_option@entry=1)
    at /home/steve/git/emacs-master/src/dispnew.c:5763
#57 0x00000000004f313e in read_char (commandflag=1, map=map@entry=13473155, prev_event=0, used_mouse_menu=used_mouse_menu@entry=0x7ffcbb817b2b, end_time=end_time@entry=0x0) at /home/steve/git/emacs-master/src/keyboard.c:2722
#58 0x00000000004f4252 in read_key_sequence (keybuf=keybuf@entry=0x7ffcbb817be0, bufsize=bufsize@entry=30, prompt=prompt@entry=0, dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true, fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false)
    at /home/steve/git/emacs-master/src/keyboard.c:9122
#59 0x00000000004f57aa in command_loop_1 ()
    at /home/steve/git/emacs-master/src/keyboard.c:1370
#60 0x00000000005533cd in internal_condition_case (bfun=bfun@entry=0x4f54cf <command_loop_1>, handlers=handlers@entry=19968, hfun=hfun@entry=0x4eca3d <cmd_error>)
    at /home/steve/git/emacs-master/src/eval.c:1324
#61 0x00000000004e840f in command_loop_2 (ignore=ignore@entry=0)
    at /home/steve/git/emacs-master/src/keyboard.c:1112
#62 0x0000000000553347 in internal_catch (tag=tag@entry=48192, func=func@entry=0x4e83f7 <command_loop_2>, arg=arg@entry=0)
    at /home/steve/git/emacs-master/src/eval.c:1091
#63 0x00000000004e83b5 in command_loop ()
    at /home/steve/git/emacs-master/src/keyboard.c:1091
#64 0x00000000004ec6c1 in recursive_edit_1 ()
    at /home/steve/git/emacs-master/src/keyboard.c:697
#65 0x00000000004ec98a in Frecursive_edit ()
    at /home/steve/git/emacs-master/src/keyboard.c:768
#66 0x00000000004e7fc9 in main (argc=2, argv=0x7ffcbb817f28)
---Type <return> to continue, or q <return> to quit---
    at /home/steve/git/emacs-master/src/emacs.c:1687

Lisp Backtrace:
"recursive-edit" (0xbb814c58)
"edebug--recursive-edit" (0xbb814f78)
"edebug--display-1" (0xbb815338)
"edebug--display" (0xbb815508)
"edebug-debugger" (0xbb815738)
"edebug-before" (0xbb8158b0)
"edebug-after" (0xbb815af8)
0x2ff1f40 Lisp type 3
"edebug-enter" (0xbb815eb8)
"edebug-enter" (0xbb8160c0)
"comint-output-filter" (0xbb8162e8)



  reply	other threads:[~2017-05-02 16:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-30 23:12 misbehavior in shell window with ksh Mike Kupfer
2017-05-01  6:49 ` Eli Zaretskii
2017-05-01 10:59   ` Stephen Berman
2017-05-01 11:31     ` Eli Zaretskii
2017-05-01 14:41       ` Stephen Berman
2017-05-01 15:09         ` Eli Zaretskii
2017-05-01 15:52           ` Stephen Berman
2017-05-02  9:03             ` Eli Zaretskii
2017-05-02 12:35               ` Stephen Berman
2017-05-02 16:32                 ` Eli Zaretskii
2017-05-02 16:55                   ` Stephen Berman [this message]
2017-05-03 17:51                     ` Eli Zaretskii
2017-05-04  7:54                       ` Stephen Berman
2017-05-04 14:42                         ` Eli Zaretskii
2017-05-05  3:04                           ` Mike Kupfer
2017-05-05  6:13                             ` Eli Zaretskii
2017-05-06 18:41                               ` Mike Kupfer
2017-05-09 16:36                                 ` Eli Zaretskii
2017-05-01 15:29         ` Mike Kupfer
2017-05-02 13:03           ` Tino Calancha
2017-05-01  7:38 ` Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760hjjj16.fsf@rosalinde \
    --to=stephen.berman@gmx.net \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mkupfer@alum.berkeley.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).