From james at jwm-art.net Mon Jun 1 15:32:52 2009 From: james at jwm-art.net (james morris) Date: Mon, 1 Jun 2009 16:32:52 +0100 (BST) Subject: [linedit-devel] maybe a possible bug? In-Reply-To: <633d72b0905311439r525d10dcua2021ee85fac7cc@mail.gmail.com> Message-ID: <1D66t6Nh.1243870372.4086240.james@jwm-art.net> On 31/5/2009, "Nikodemus Siivola" wrote: >2009/5/31 james morris : >> >> OK, I've taken the 'trouble' of looking into the source for linedit, >> in particular the command-keys.lisp file, and have seen that the >> functions i was looking for are implemented just not using the keys i >> expected. It would be interesting to know why >> CTRL-any-arrow-direction-key causes a hang tho. >> >> Any chance of getting home+end ctrl-arrow keys working in linedit by >> default? > >Sure. I haven't touched linedit in quite a while, but am happy to >merge a patch. :) ...with a bit of luck I might even find time to do >it myself, but that will take a while. > >(Sorry for the slow answer, was at ELS 2009 this week.) No problem. I'm still wondering though as to why CTRL-left/right/up/down cause sbcl/linedit to hang? Sorry, i'm only a humble beginner to common lisp so all i can do is report problems :| I've attempted to change the key mappings to use home/end keys for bol/eol but came stuck... i know that the keycodes generated for home/end etc are a two-code thing, but not sure how to specify it in the keys file within linedit - the defcommand using "home" and "end" seems to be ignored by these keys which get caught (on my system atleast) by the defcommand for "M-O" (IIRC) and the 2nd part of their keycodes comes out as 'F' or 'H' (IIRC) at the prompt. Cheers, james. >Cheers, > > -- Nikodemus > >> >> Cheers, James. >> >> On 30/5/2009, "james morris" wrote: >> >>> >>>Hi, >>> >>>I'm learning CL, and installed linedit chiefly for use within the SBCL >>>REPL. >>> >>>It seems to hang if I press CTRL-arrow (ie to move the cursor at word >>>boundaries instead of a char at a time). CTRL-C does not get out of this >>>hung state and I have to open another terminal and kill sbcl from there. >>> >>>Home and End keys do not work and 'Unknown command "M-O".' is >>>displayed along with a H or F as user-input. >>> >>>I'm running sbcl-1.0.18-debian in Debian Lenny for the AMD64 platform. >>> >>>Any ideas? >>> >>>Thanks, >>>James. >>> >>>_______________________________________________ >>>linedit-devel mailing list >>>linedit-devel at common-lisp.net >>>http://common-lisp.net/cgi-bin/mailman/listinfo/linedit-devel >>> >>> >> >> _______________________________________________ >> linedit-devel mailing list >> linedit-devel at common-lisp.net >> http://common-lisp.net/cgi-bin/mailman/listinfo/linedit-devel >> > >_______________________________________________ >linedit-devel mailing list >linedit-devel at common-lisp.net >http://common-lisp.net/cgi-bin/mailman/listinfo/linedit-devel > > From nikodemus at random-state.net Mon Jun 1 17:02:06 2009 From: nikodemus at random-state.net (Nikodemus Siivola) Date: Mon, 1 Jun 2009 20:02:06 +0300 Subject: [linedit-devel] maybe a possible bug? In-Reply-To: <1D66t6Nh.1243870372.4086240.james@jwm-art.net> References: <633d72b0905311439r525d10dcua2021ee85fac7cc@mail.gmail.com> <1D66t6Nh.1243870372.4086240.james@jwm-art.net> Message-ID: <633d72b0906011002x3851c716radd10e2fdc7f5e6e@mail.gmail.com> 2009/6/1 james morris : > No problem. I'm still wondering though as to why CTRL-left/right/up/down > cause sbcl/linedit to hang? Sorry, i'm only a humble beginner to common > lisp so all i can do is report problems :| No idea, sorry, and I can't even easily reproduce this on my system as C-arrows are caught by my window manager -- I'll need to reconfigure it before I can have a look. Once it hangs, can you get a backtrace? Either by C-c at the terminal, and typing "ba" in the debugger (without quotes), or by attaching GDB: gdb -p , followed by "ba" (again without quotes) in gdb, followed by "call backtrace_from_fp($rbp, 100)" (still no quotes)? Apropos, I hope you are not using Linedit as your _primary_ Lisp environment? It is definitely something of a fallback: you are going to be a gazillion times more productive using eg. Slime. > I've attempted to change the key mappings to use home/end keys for > bol/eol but came stuck... i know that the keycodes generated for > home/end etc are a two-code thing, but not sure how to specify it in the > keys file within linedit - the defcommand using "home" and "end" > seems to be ignored by these keys which get caught (on my system > atleast) by the defcommand for "M-O" (IIRC) and the 2nd part of their > keycodes comes out as 'F' or 'H' (IIRC) at the prompt. Not sure about the cause at all -- it's been a long while since I had to figure stuff like that out -- but one thing you can do: * Trace LINEDIT::READ-CHORD to see what your Home and End keys are translated into, if anything. * If they don't get reasonable translations, add the appropriate translations to terminal-translations.lisp. The whole way terminal stuff is translated is a bit hacky -- the proper way would be to try to find the stuff from terminfo db, I think. Cheers, -- Nikodemus From james at jwm-art.net Wed Jun 3 10:08:09 2009 From: james at jwm-art.net (james morris) Date: Wed, 3 Jun 2009 11:08:09 +0100 (BST) Subject: [linedit-devel] maybe a possible bug? In-Reply-To: <633d72b0906011002x3851c716radd10e2fdc7f5e6e@mail.gmail.com> Message-ID: Hi Nikodemus, I tried getting a backtrace, but C-c does not work. Attached GDB ok, but there appeared to be no debugging symbols for wherever it was stuck: ---------------------------------------------------- Reading symbols from /usr/bin/sbcl...(no debugging symbols found)...done. Reading symbols from /lib/libdl.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /lib/libpthread.so.0... (no debugging symbols found)...done. [Thread debugging using libthread_db enabled] [New Thread 0x7ff846da06e0 (LWP 3465)] Loaded symbols for /lib/libpthread.so.0 Reading symbols from /lib/libm.so.6...(no debugging symbols found)...done. Loaded symbols for /lib/libm.so.6 Reading symbols from /lib/libc.so.6... (no debugging symbols found)...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux-x86-64.so.2...(no debugging symbols found)...done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 Reading symbols from /var/cache/common-lisp-controller/1000/sbcl/local/home/james/.sbcl/site/osicat_0.5.0/osicat-glue.so...done. Loaded symbols for /var/cache/common-lisp-controller/1000/sbcl/local/home/james/.sbcl/site/osicat_0.5.0/osicat-glue.so Reading symbols from /var/cache/common-lisp-controller/1000/sbcl/local/home/james/.sbcl/site/linedit_0.16.1/terminal_glue.so...done. Loaded symbols for /var/cache/common-lisp-controller/1000/sbcl/local/home/james/.sbcl/site/linedit_0.16.1/terminal_glue.so Reading symbols from /var/cache/common-lisp-controller/1000/sbcl/local/home/james/.sbcl/site/linedit_0.16.1/signals.so...done. Loaded symbols for /var/cache/common-lisp-controller/1000/sbcl/local/home/james/.sbcl/site/linedit_0.16.1/signals.so 0x00007ff84626fc93 in select () from /lib/libc.so.6 (gdb) step Cannot find bounds of current function (gdb) finish Run till exit from #0 0x00007ff84626fc93 in select () from /lib/libc.so.6 ---------------------------------------------------- it hangs again. i go back to terminal running sbcl press a key and: Warning: Cannot insert breakpoint 0. Error accessing memory address 0x0: Input/output error. anyway i've discovered it's not just ctrl-left/right/up/down but shift and alt too. incidently, on x86 laptop the home/end keys work fine but not on amd64. .. I'm starting get the feeling i'm going to have to learn emacs :/ cheers, james. On 1/6/2009, "Nikodemus Siivola" wrote: >2009/6/1 james morris : > >> No problem. I'm still wondering though as to why CTRL-left/right/up/down >> cause sbcl/linedit to hang? Sorry, i'm only a humble beginner to common >> lisp so all i can do is report problems :| > >No idea, sorry, and I can't even easily reproduce this on my system as >C-arrows are caught by my window manager -- I'll need to reconfigure >it before I can have a look. > >Once it hangs, can you get a backtrace? Either by C-c at the terminal, >and typing "ba" in the debugger (without quotes), or by >attaching GDB: gdb -p , followed by "ba" (again >without quotes) in gdb, followed by "call backtrace_from_fp($rbp, >100)" (still no quotes)? > >Apropos, I hope you are not using Linedit as your _primary_ Lisp >environment? It is definitely something of a fallback: you are going >to be a gazillion times more productive using eg. Slime. > >> I've attempted to change the key mappings to use home/end keys for >> bol/eol but came stuck... i know that the keycodes generated for >> home/end etc are a two-code thing, but not sure how to specify it in the >> keys file within linedit - the defcommand using "home" and "end" >> seems to be ignored by these keys which get caught (on my system >> atleast) by the defcommand for "M-O" (IIRC) and the 2nd part of their >> keycodes comes out as 'F' or 'H' (IIRC) at the prompt. > >Not sure about the cause at all -- it's been a long while since I had >to figure stuff like that out -- but one thing you can do: > >* Trace LINEDIT::READ-CHORD to see what your Home and End keys are >translated into, if anything. > >* If they don't get reasonable translations, add the appropriate >translations to terminal-translations.lisp. > >The whole way terminal stuff is translated is a bit hacky -- the >proper way would be to try to find the stuff from terminfo db, I >think. > >Cheers, > > -- Nikodemus > >_______________________________________________ >linedit-devel mailing list >linedit-devel at common-lisp.net >http://common-lisp.net/cgi-bin/mailman/listinfo/linedit-devel > > From nikodemus at random-state.net Wed Jun 3 10:53:59 2009 From: nikodemus at random-state.net (Nikodemus Siivola) Date: Wed, 3 Jun 2009 13:53:59 +0300 Subject: [linedit-devel] maybe a possible bug? In-Reply-To: References: <633d72b0906011002x3851c716radd10e2fdc7f5e6e@mail.gmail.com> Message-ID: <633d72b0906030353s321f6d5aq7479d3a1d2e04e68@mail.gmail.com> 2009/6/3 james morris : > 0x00007ff84626fc93 in select () from /lib/libc.so.6 > (gdb) step > Cannot find bounds of current function > (gdb) finish Instead of "step", can you try "backtrace" and "call backtrace_from_fp($rbp,100)"? > I'm starting get the feeling i'm going to have to learn emacs :/ I really really really recommend that. The amount of Emacs you have to learn to be a gazillion times more productive than when working with SBCL in terminal -- Linedit or no -- is minimal. Slime is a really kick-ass environment. I feel I should not say this, because _everyone_ who has started out at a terminal and moved to Slime regrets every minute they spent at the terminal, but... if you want an inferior but immediate solution, use rlwrap. Cheers, -- Nikodemus From james at jwm-art.net Wed Jun 3 12:01:20 2009 From: james at jwm-art.net (james morris) Date: Wed, 3 Jun 2009 13:01:20 +0100 (BST) Subject: [linedit-devel] maybe a possible bug? In-Reply-To: <633d72b0906030353s321f6d5aq7479d3a1d2e04e68@mail.gmail.com> Message-ID: On 3/6/2009, "Nikodemus Siivola" wrote: >2009/6/3 james morris : > >> 0x00007ff84626fc93 in select () from /lib/libc.so.6 >> (gdb) step >> Cannot find bounds of current function >> (gdb) finish > >Instead of "step", can you try "backtrace" and "call >backtrace_from_fp($rbp,100)"? sorry, i meant to say i'd tried that, but without debug symbols it's uninformative: 0xb7fe3424 in __kernel_vsyscall () (gdb) ba #0 0xb7fe3424 in __kernel_vsyscall () #1 0xb7f0da7d in select () from /lib/i686/cmov/libc.so.6 #2 0x09d4c38f in ?? () #3 0x00000001 in ?? () #4 0xb7bb1f7c in ?? () #5 0xb7bb1efc in ?? () #6 0x00000000 in ?? () (gdb) call backtrace_from_fp($rbp,100) [Switching to Thread 0xb7e346b0 (LWP 2520)] $1 = 0 (gdb) ba #0 0xb7fe3424 in __kernel_vsyscall () #1 0xb7f0da7d in select () from /lib/i686/cmov/libc.so.6 #2 0x09d4c38f in ?? () #3 0x00000001 in ?? () #4 0xb7bb1f7c in ?? () #5 0xb7bb1efc in ?? () #6 0x00000000 in ?? () james. From nikodemus at random-state.net Wed Jun 3 12:29:09 2009 From: nikodemus at random-state.net (Nikodemus Siivola) Date: Wed, 3 Jun 2009 15:29:09 +0300 Subject: [linedit-devel] maybe a possible bug? In-Reply-To: References: <633d72b0906030353s321f6d5aq7479d3a1d2e04e68@mail.gmail.com> Message-ID: <633d72b0906030529q62256c0v93e30be722c83178@mail.gmail.com> 2009/6/3 james morris : > sorry, i meant to say i'd tried that, but without debug symbols it's > uninformative: Oh, ok. > (gdb) call backtrace_from_fp($rbp,100) > [Switching to Thread 0xb7e346b0 (LWP 2520)] This brought nothing up on the SBCL terminal? Cheers, -- Nikodemus From james at jwm-art.net Wed Jun 3 13:13:03 2009 From: james at jwm-art.net (james morris) Date: Wed, 3 Jun 2009 14:13:03 +0100 (BST) Subject: [linedit-devel] maybe a possible bug? In-Reply-To: <633d72b0906030529q62256c0v93e30be722c83178@mail.gmail.com> Message-ID: <0Vgy3n8O.1244034783.7782240.james@jwm-art.net> On 3/6/2009, "Nikodemus Siivola" wrote: >> (gdb) call backtrace_from_fp($rbp,100) >> [Switching to Thread 0xb7e346b0 (LWP 2520)] > >This brought nothing up on the SBCL terminal? ah, i see! i'm back on x86 - a quick google tells me to use $ebp instead: 0: SB-IMPL::SUB-SUB-SERVE-EVENT 1: SB-IMPL::SUB-SERVE-EVENT 2: (SB-C::HAIRY-ARG-PROCESSOR SB-SYS::WAIT-UNTIL-FD-USABLE) 3: SB-IMPL::REFILL-INPUT-BUFFER 4: SB-IMPL::INPUT-CHAR/UTF-8 5: (SB-C::HAIRY-ARG-PROCESSOR COMMON-LISP::READ-CHAR) 6: (SB-C::HAIRY-ARG-PROCESSOR COMMON-LISP::READ-CHAR) 7: (SB-PCL::FAST-METHOD LINEDIT::READ-CHORD (LINEDIT::TERMINAL)) 8: LINEDIT::NEXT-CHORD 9: (SB-C::TL-XEP LINEDIT::LINEDIT) 10: (SB-C::TL-XEP LINEDIT::FORMEDIT) 11: (COMMON-LISP::FLET LINEDIT::REPL-READER) 12: (COMMON-LISP::LAMBDA (LINEDIT::IN LINEDIT::OUT)) 13: SB-ACLREPL::REP-ONE 14: (SB-C::TL-XEP SB-ACLREPL::REPL) 15: (COMMON-LISP::LAMBDA (SB-ACLREPL::NOPRINT)) 16: (COMMON-LISP::LAMBDA ()) 17: (SB-C::XEP (COMMON-LISP::LAMBDA ())) 18: SB-IMPL::%WITH-REBOUND-IO-SYNTAX 19: SB-IMPL::TOPLEVEL-REPL 20: SB-IMPL::TOPLEVEL-INIT 21: (COMMON-LISP::LABELS SB-IMPL::RESTART-LISP) 22: Foreign fp = 0xb79b1f88, ra = 0x807f850 hope that helps! now i'm not sure i did this on amd64 at all... i'll try later when i've access. james. From nikodemus at random-state.net Wed Jun 3 13:29:03 2009 From: nikodemus at random-state.net (Nikodemus Siivola) Date: Wed, 3 Jun 2009 16:29:03 +0300 Subject: [linedit-devel] maybe a possible bug? In-Reply-To: <0Vgy3n8O.1244034783.7782240.james@jwm-art.net> References: <633d72b0906030529q62256c0v93e30be722c83178@mail.gmail.com> <0Vgy3n8O.1244034783.7782240.james@jwm-art.net> Message-ID: <633d72b0906030629n39dac738j6a2a98f883029d64@mail.gmail.com> 2009/6/3 james morris : > ah, i see! i'm back on x86 - a quick google tells me to use $ebp instead: > > ? 0: SB-IMPL::SUB-SUB-SERVE-EVENT > ? 1: SB-IMPL::SUB-SERVE-EVENT > ? 2: (SB-C::HAIRY-ARG-PROCESSOR SB-SYS::WAIT-UNTIL-FD-USABLE) > ? 3: SB-IMPL::REFILL-INPUT-BUFFER > ? 4: SB-IMPL::INPUT-CHAR/UTF-8 > ? 5: (SB-C::HAIRY-ARG-PROCESSOR COMMON-LISP::READ-CHAR) > ? 6: (SB-C::HAIRY-ARG-PROCESSOR COMMON-LISP::READ-CHAR) > ? 7: (SB-PCL::FAST-METHOD LINEDIT::READ-CHORD (LINEDIT::TERMINAL)) Ok, so Linedit is waiting for input, but not getting any. I'm guessing that those key-combos do something nasty to your terminal state. No ideas beyond that right now. What does (TRACE LINEDIT::READ-CHORD), and trying the system-hanging chords after that report? Cheers, -- Nikodemus From james at jwm-art.net Wed Jun 3 13:39:21 2009 From: james at jwm-art.net (james morris) Date: Wed, 3 Jun 2009 14:39:21 +0100 (BST) Subject: [linedit-devel] maybe a possible bug? In-Reply-To: <633d72b0906030629n39dac738j6a2a98f883029d64@mail.gmail.com> Message-ID: On 3/6/2009, "Nikodemus Siivola" wrote: >Ok, so Linedit is waiting for input, but not getting any. I'm guessing >that those key-combos do something nasty to your terminal state. No >ideas beyond that right now. > >What does (TRACE LINEDIT::READ-CHORD), and trying the system-hanging >chords after that report? > it seems to hang before the trace gets a change to report anything. From nikodemus at random-state.net Wed Jun 3 13:57:47 2009 From: nikodemus at random-state.net (Nikodemus Siivola) Date: Wed, 3 Jun 2009 16:57:47 +0300 Subject: [linedit-devel] maybe a possible bug? In-Reply-To: References: <633d72b0906030629n39dac738j6a2a98f883029d64@mail.gmail.com> Message-ID: <633d72b0906030657k613063c8r2b96b34024cccf50@mail.gmail.com> 2009/6/3 james morris : > it seems to hang before the trace gets a change to report anything. That seems to support the theory that the terminal does something abnormal. Cheers, -- Nikodemus From james at jwm-art.net Wed Jun 3 20:27:59 2009 From: james at jwm-art.net (james morris) Date: Wed, 3 Jun 2009 21:27:59 +0100 (BST) Subject: [linedit-devel] maybe a possible bug? In-Reply-To: <633d72b0906030657k613063c8r2b96b34024cccf50@mail.gmail.com> Message-ID: On 3/6/2009, "Nikodemus Siivola" wrote: >> it seems to hang before the trace gets a change to report anything. > >That seems to support the theory that the terminal does something abnormal. > Ok, I'd not thought of that - or of testing in different terminals. From running a few tests I can assert the following: 1) It's not the difference between x86 and amd64 that causes the home/end keys to not work. The home/end keys don't work in the XFCE terminal, but do work in xterm. 2) both xterm & xfce terminal cause problems with line edit + sbcl using the repl when pressing shift/ctrl direction/arrow. 3) everything is fine on the console! James.