From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: misbehavior in shell window with ksh Date: Tue, 02 May 2017 18:55:01 +0200 Message-ID: <8760hjjj16.fsf@rosalinde> References: <12812.1493593946@alto> <83o9vdjcl6.fsf@gnu.org> <87pofszvue.fsf@rosalinde> <837f20ke4g.fsf@gnu.org> <87inlkzlkt.fsf@rosalinde> <831ss8k40f.fsf@gnu.org> <87bmrczi9s.fsf@rosalinde> <83h913iq9x.fsf@gnu.org> <87efw7jv1b.fsf@rosalinde> <83fugni5i8.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1493744178 3400 195.159.176.226 (2 May 2017 16:56:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 2 May 2017 16:56:18 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org, mkupfer@alum.berkeley.edu To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 02 18:56:11 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5b5v-0000gn-3v for ged-emacs-devel@m.gmane.org; Tue, 02 May 2017 18:56:11 +0200 Original-Received: from localhost ([::1]:60233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5b60-0003GF-Tx for ged-emacs-devel@m.gmane.org; Tue, 02 May 2017 12:56:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5b50-0003DI-Fq for emacs-devel@gnu.org; Tue, 02 May 2017 12:55:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5b4x-0002yJ-Ac for emacs-devel@gnu.org; Tue, 02 May 2017 12:55:14 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:52523) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d5b4w-0002wd-Vd; Tue, 02 May 2017 12:55:11 -0400 Original-Received: from rosalinde ([83.135.28.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M9bYB-1dE5Fp140d-00CyOx; Tue, 02 May 2017 18:55:02 +0200 In-Reply-To: <83fugni5i8.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 02 May 2017 19:32:31 +0300") X-Provags-ID: V03:K0:G5+tbR9S/TCk9vQF2kfrM+zc24H8suvyNsjg3iwfb3YEoWcOm1/ XCVwLM6kQCxdzzP6GVEq0lLin6vveANgRqwS/kBlcx6xDa56r4wwazZIlLjuUPL6CgHfubP sBhstSheVzsnnT0t5XGnQ6BUVUXkTZs9dcSkCJHZYgUpPwhswwOSzJLU8ZENHl0fzR5Hidw NLOJS7LJLydh1gt20lLDw== X-UI-Out-Filterresults: notjunk:1;V01:K0:oqdRQWHE42A=:G3s3acL0Dv4emqp9S9ZlRl vwe+zeIpBZUMofCwuDw6j0HqxbRxeLmXESxl8S+h6hJD2lq3ilOPQLNih79PwktMsiDO1ZjeK +js0ZfihpckP7WeVBX66xCRMCYRploR7ypDOi3MdxGTjMmR0LV47tk92h4KAjOPHw7bVobRL5 AyijTUv9g9bnDZVE8Z/nS2zPOIj+CPoWCMtdDWd4USXp3KimDMX1xKQwJlZtNKUlTSfYbEN21 qOLfsjy1xhlXOlOqj4vl53aiSLSkSu684camiYU/Au21YVvdp5HmMIqEcgH6FFVYPVkTtN1jO lrEKWf+UtVKf0oEtSR95TL3DX2InJG+njkqRydCAbwXTyN3ZW5JjqFY5yNkv/Bmw0tw33xzod jRqvp4g4QxarKgGF+tMrULcaHMS5iW1T/w5p4XpwhNIwvcq9v+7e1kEG/FvQsjR387T1hdAbB Hjf9LghlACUiaj12mMJ4lU3r8pbaD7MM4sc+mXXpM68uQbhVCCbC7cpGxsSj0YLBX9vsszjxC FeGsO+VOBvVr1ZmHR+mtTsoKYM9ww+swxtYNZ24sZ9sPPxtbn2H0046m99q6EhEcPJFDgfh4x gktrWt+B1pZfaLEv7gweJzt7K9lwYjst0LQNyZsR9wpGl8q0mKVOrJhoaqUbUy6xSC3LXdrVY osVOphB6tx1/4AWzRDd8nN5gxLopysvZMnRJgMZorzM8YyYxHgRlUuTwrK84rRboLSpB6UGJE LDUiU/J8B/6ewmdcapWsGGuL2crAX+TbNQbwlbogbyqrPPD0pTcj5vuaX0TvaiSwbhVuv+Ul X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.21 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214521 Archived-At: On Tue, 02 May 2017 19:32:31 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> 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(# "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(# "> ") >> >> > 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 , arg=arg@entry=0x7ffcbb813cc0) at /home/steve/git/emacs-master/src/alloc.c:5153 #3 0x00000000005abc0b in thread_select (func=, max_fds=max_fds@entry=19, rfds=rfds@entry=0x7ffcbb8141e0, wfds=, 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=, 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 to continue, or q to quit--- at /home/steve/git/emacs-master/src/keyboard.c:1370 #10 0x00000000005533cd in internal_condition_case (bfun=bfun@entry=0x4f54cf , handlers=handlers@entry=19968, hfun=hfun@entry=0x4eca3d ) 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 , 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 , 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=, vector=47927725, maxdepth=, args_template=args_template@entry=1030, nargs=nargs@entry=1, args=, 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=, vector=47926757, m---Type to continue, or q to quit--- axdepth=, args_template=args_template@entry=3086, nargs=nargs@entry=3, args=, 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=, vector=18637573, maxdepth=, args_template=args_template@entry=3086, nargs=nargs@entry=3, args=, 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=, vector=47925941, maxdepth=, args_template=args_template@entry=3086, nargs=nargs@entry=3, args=, 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=, vector=47925357, maxdepth=, args_template=args_template@entry=1030, nargs=nargs@entry=1, args=, 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 to continue, or q to quit--- at /home/steve/git/emacs-master/src/eval.c:2942 #32 0x0000000000553cad in apply_lambda (fun=fun@entry=47925437, args=, 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=, count=count@entry=31) at /home/steve/git/emacs-master/src/eval.c:2874 #35 0x0000000000554290 in eval_sub (form=) 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=, vector=47981685, maxdepth=, args_template=args_template@entry=3086, nargs=nargs@entry=3, args=, 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=, vector=47981685, maxdepth=, args_template=args_template@entry=3086, nargs=nargs@entry=3, args=, 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 to continue, or q to quit--- at /home/steve/git/emacs-master/src/eval.c:2942 #44 0x0000000000553cad in apply_lambda (fun=fun@entry=47982005, args=, count=count@entry=9) at /home/steve/git/emacs-master/src/eval.c:2879 #45 0x0000000000554290 in eval_sub (form=) 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=) 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 , arg=50273987, handlers=handlers@entry=19968, hfun=hfun@entry=0x589218 ) 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=, 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 to continue, or q 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 , handlers=handlers@entry=19968, hfun=hfun@entry=0x4eca3d ) 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 , 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 to continue, or q 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)