Re: Jumping back to REPL prompt on ^C
Taylor Venable writes: > Hi there, I'm writing a piece of code with a web server component, and > part of that being that I want to jump back to the REPL when one hits > ^C. So it would go something like this: > > scheme@(guile-user)> (start-server) > ;;; handling requests > ^C > scheme@(guile-user)> > > What I tried doing was essentially this: > > (call/cc (lambda (k) (sigaction SIGINT (lambda (_) (k))) (start-server))) Just a couple of notes here. First, continuations usually take an argument: the value which will be the return value of the (call/cc ...) expression. So '(k)' may be wrong. Second, I wonder if you meant (lambda _ ...) instead of (lambda (_) ...). I often use the former when I want a lambda that accepts any number of arguments. > Except *sometimes* when I hit ^C I ended up with an error that stops > the guile program completely, seemingly due to the readline library > that I've enabled in the REPL. When I simplify my test I'm able to > get the same fatal error all the time. [..] > In unknown file: >?: 0 [catch-closure misc-error "%readline" "readline is not reentrant" () > #f] This suggests to me that the code was already inside readline when you hit ^C. Does (start-server) ever return naturally? If it does, there's a window where it's just returned and the REPL is calling readline to read the next line of input, but the terminal may not have shown the prompt yet. So if you type ^C in that window, the error above would be expected. Alternatively, does the code inside (start-server) ever use readline? Perhaps by mistake it is using '(readline)' instead of '(read-line)' from (ice-9 rdelim)? In this case there'd obviously be loads more chances of seeing the above error. Regards, Neil
Re: guile-gnome2 - Segmentation fault
Hi Andy, I patched the debian source/debuild/dpkg -i with the 2 patches you mentioned and that were not in the debian ... but it still crash. this time the backtrace is larger, would it gives us more info? I'll try to make a short example which 'mimics' what my app mainly do and try to make it crashing as well, if that 'works' I'll send it ... I will patch the git checkout for gtk > 2.18 and install from source in order to be able to do react in a 'quicker way' to suggestions: I am thinking that I should, with your help maybe, insert 'printf' 'everywhere until we can discover the source of my problem, what do toy think? Cheers, David ;; -- Le Sat, 03 Jul 2010 18:25:48 +0100, Andy Wingo a écrit : > Hi, > > I had said: > > >> Can you check to see that the following patches are applied to the > >> debian package: > >> > >> 0ca1de9d89ed7b2899e49f273f27f810540a6508 > >> 3d11c93b290992b2c4d9eeef57c2a7a54f808783 > > These are git commits. > > You replied: > > On Fri 02 Jul 2010 17:32, David Pirotte writes: > > > I don't know, on the debian patch tracking system page for > > guile-gnome-platform, > > patches are listed by names. I don't see these [MD5sum?] numbers you > > mentioned, > > Chdir into gtk/ in your guile-gnome platform checkout, and do "gitk > REVNAME", and see if that patch is in debian. > > Regards, > > Andy backtrace.txt.gz Description: GNU Zip compressed data