From joel at whylisp.com Fri Oct 13 14:57:51 2006 From: joel at whylisp.com (Joel Reymont) Date: Fri, 13 Oct 2006 15:57:51 +0100 Subject: [kpax-devel] Dropping into the debugger Message-ID: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> Folks, I'm trying to bring up KPAX with ACL 8.0. It works with alisp (case- insensitive) but not with mlisp. Apart from that, I'm seeing errors like the one below. ;; KPAX 20061013T124418 ERROR error Not an open string-output stream: NIL How can I make KPAX drop into a debugger so that I can see where the error is? I'm just trying to recreate the Reddit example. Thanks, Joel -- http://whylisp.com From scaekenberghe at common-lisp.net Fri Oct 13 15:18:06 2006 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Fri, 13 Oct 2006 17:18:06 +0200 Subject: [kpax-devel] Dropping into the debugger In-Reply-To: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> References: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> Message-ID: <067D7914-ED24-4205-A74E-9EAE6DC49D2A@common-lisp.net> On 13 Oct 2006, at 16:57, Joel Reymont wrote: > Folks, > > I'm trying to bring up KPAX with ACL 8.0. It works with alisp (case- > insensitive) but not with mlisp. Apart from that, I'm seeing errors > like the one below. > > ;; KPAX 20061013T124418 ERROR error Not > an > open > string-output > stream: > NIL > > How can I make KPAX drop into a debugger so that I can see where > the error is? > > I'm just trying to recreate the Reddit example. I have a (demo) version of acl8 on my mac, I will try to find some time later today to get KPAX and the reddit example up and running and I will report back! Sven From joel at whylisp.com Fri Oct 13 15:26:39 2006 From: joel at whylisp.com (Joel Reymont) Date: Fri, 13 Oct 2006 16:26:39 +0100 Subject: [kpax-devel] Dropping into the debugger In-Reply-To: <067D7914-ED24-4205-A74E-9EAE6DC49D2A@common-lisp.net> References: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> <067D7914-ED24-4205-A74E-9EAE6DC49D2A@common-lisp.net> Message-ID: <1C7ACE96-0AF8-47AE-A5C2-EA557DF29729@whylisp.com> On Oct 13, 2006, at 4:18 PM, Sven Van Caekenberghe wrote: > I have a (demo) version of acl8 on my mac, I will try to find some > time later today to get KPAX and the reddit example up and running > and I will report back! Thank you Sven! Still, is there a way to have KPAX _not_ trap errors so that I can catch them in SLIME? Thanks, Joel -- http://whylisp.com From scaekenberghe at common-lisp.net Fri Oct 13 15:52:36 2006 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Fri, 13 Oct 2006 17:52:36 +0200 Subject: [kpax-devel] Dropping into the debugger In-Reply-To: <1C7ACE96-0AF8-47AE-A5C2-EA557DF29729@whylisp.com> References: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> <067D7914-ED24-4205-A74E-9EAE6DC49D2A@common-lisp.net> <1C7ACE96-0AF8-47AE-A5C2-EA557DF29729@whylisp.com> Message-ID: <665C0EF0-D2BD-4F01-899E-568AE1C6604E@common-lisp.net> On 13 Oct 2006, at 17:26, Joel Reymont wrote: > > On Oct 13, 2006, at 4:18 PM, Sven Van Caekenberghe wrote: > >> I have a (demo) version of acl8 on my mac, I will try to find some >> time later today to get KPAX and the reddit example up and running >> and I will report back! > > Thank you Sven! Still, is there a way to have KPAX _not_ trap > errors so that I can catch them in SLIME? > > Thanks, Joel Well, normally, if you do start-kpax, it should start in debug-mode (inspect *web-app-server*). Have a look at how handle-request-response deals with conditions and restarts... There are many configuration options, I'm afraid. Sven From joel at whylisp.com Fri Oct 13 16:03:37 2006 From: joel at whylisp.com (Joel Reymont) Date: Fri, 13 Oct 2006 17:03:37 +0100 Subject: [kpax-devel] Dropping into the debugger In-Reply-To: <665C0EF0-D2BD-4F01-899E-568AE1C6604E@common-lisp.net> References: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> <067D7914-ED24-4205-A74E-9EAE6DC49D2A@common-lisp.net> <1C7ACE96-0AF8-47AE-A5C2-EA557DF29729@whylisp.com> <665C0EF0-D2BD-4F01-899E-568AE1C6604E@common-lisp.net> Message-ID: <5D91C578-85A8-4C67-A056-58E521CB39E3@whylisp.com> On Oct 13, 2006, at 4:52 PM, Sven Van Caekenberghe wrote: > Well, normally, if you do start-kpax, it should start in debug-mode > (inspect *web-app-server*). KPAX-USER> *web-app-server* # > Have a look at how handle-request-response deals with conditions > and restarts... Maybe I should be more precise. I'm running KPAX under ACL 8.0 and SLIME. I see this upon an error: ;; KPAX 20061013T124418 ERROR error Not an open string-output stream: NIL KPAX-USER> (get-debug-mode *web-app-server*) T Still, I don't see SLDB invoked despite the code handle-request- response that should be re-throwing the condition. I'll poke around more and wait for the results of your ACL test. Thanks, Joel -- http://whylisp.com From joel at whylisp.com Fri Oct 13 16:26:19 2006 From: joel at whylisp.com (Joel Reymont) Date: Fri, 13 Oct 2006 17:26:19 +0100 Subject: [kpax-devel] Dropping into the debugger In-Reply-To: <665C0EF0-D2BD-4F01-899E-568AE1C6604E@common-lisp.net> References: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> <067D7914-ED24-4205-A74E-9EAE6DC49D2A@common-lisp.net> <1C7ACE96-0AF8-47AE-A5C2-EA557DF29729@whylisp.com> <665C0EF0-D2BD-4F01-899E-568AE1C6604E@common-lisp.net> Message-ID: If it helps, this is the stack trace. I do drop into the debugger if I insert (break) right above (error condition) in handle-request- response. I'm still trying to figure out why get-output-stream-string is being passed nil. 10: (SIGNAL #) 11: (ERROR SIMPLE-ERROR :FORMAT-CONTROL "Not an open string-output stream: ~s" :FORMAT-ARGUMENTS (NIL)) 12: (GET-OUTPUT-STREAM-STRING NIL) 13: ((METHOD KPAX::COMMIT (KPAX::PASERVE-REQUEST-RESPONSE)) # @ #x10b8f18a>) 14: ((METHOD KPAX::HANDLE-REQUEST-RESPONSE (KPAX::DISPATCHER KPAX:REQUEST-RESPONSE)) # # @ #x10b8f18a>) 15: ((FLET (METHOD KPAX:INIT (KPAX:PASERVE)) KPAX::PASERVE-HANDLER) # #) 16: ((METHOD NET.ASERVE:PROCESS-ENTITY (NET.ASERVE:HTTP-REQUEST NET.ASERVE:COMPUTED-ENTITY)) # #) 17: ((METHOD NET.ASERVE:HANDLE-REQUEST (NET.ASERVE:HTTP-REQUEST)) #) 18: (NET.ASERVE::PROCESS-CONNECTION #) 19: (NET.ASERVE::HTTP-WORKER-THREAD) -- http://whylisp.com From scaekenberghe at common-lisp.net Fri Oct 13 17:58:58 2006 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Fri, 13 Oct 2006 19:58:58 +0200 Subject: [kpax-devel] Dropping into the debugger In-Reply-To: <5D91C578-85A8-4C67-A056-58E521CB39E3@whylisp.com> References: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> <067D7914-ED24-4205-A74E-9EAE6DC49D2A@common-lisp.net> <1C7ACE96-0AF8-47AE-A5C2-EA557DF29729@whylisp.com> <665C0EF0-D2BD-4F01-899E-568AE1C6604E@common-lisp.net> <5D91C578-85A8-4C67-A056-58E521CB39E3@whylisp.com> Message-ID: Joel, On 13 Oct 2006, at 18:03, Joel Reymont wrote: > I'll poke around more and wait for the results of your ACL test. I tried compiling, loading and running KPAX, all the standard examples as well as the reddit example, and from a first look, everything went fine - see the transcript below. I am using the s-http-server variant (standalone http server in lisp, no need for mod_lisp stuff). BTW, the best starting point is the PI web app: http://localhost:2001/kpax/dynamic/pi Log in using admin/trustno1. Everything is in very verbose debugging/logging mode. When you make an error, the debugger is invoked (see the end of the transcript). How to debug a multithreaded app from a single listener is implementation specific: I am only used to LispWorks' IDE and I am very happy with it. I am absolutely no expert on SLIME, certainly not in that area. I think you might have some issues there. Still, it remain possible that the 'port' to acl is not perfect, have a look at s-sysdeps when in doubt. Success! - Don't hesitate to ask more questions. HTH, Sven [sven at voyager:~]$ alisp International Allegro CL Free Express Edition 8.0 [Mac OS X] (Jul 21, 2006 11:33) Copyright (C) 1985-2006, Franz Inc., Oakland, CA, USA. All Rights Reserved. This development copy of Allegro CL is licensed to: Sven Van Caekenberghe, Beta Nine ;; Optimization settings: safety 1, space 1, speed 1, debug 2. ;; For a complete description of all compiler switches given the ;; current optimization settings evaluate (EXPLAIN-COMPILER-SETTINGS). CL-USER(1): (load "~/apps/asdf/init-asdf.lisp") ; Loading /Users/sven/apps/asdf/init-asdf.lisp ; Fast loading /Users/sven/apps/asdf/asdf.fasl ;Pushed #P"/Users/sven/apps/asdf/systems/" onto ASDF central registry T CL-USER(2): (asdf:oos 'asdf:load-op :kpax-examples) ; loading system definition from ; /Users/sven/apps/asdf/systems/kpax-examples.asd into ; # ; Loading /Users/sven/apps/asdf/systems/kpax-examples.asd ; registering # as KPAX-EXAMPLES ; loading system definition from /Users/sven/apps/asdf/systems/kpax.asd ; into # ; Loading /Users/sven/apps/asdf/systems/kpax.asd ; registering # as KPAX ; loading system definition from ; /Users/sven/apps/asdf/systems/kpax-s-http-server.asd into ; # ; Loading /Users/sven/apps/asdf/systems/kpax-s-http-server.asd ; registering # as ; KPAX-S-HTTP-SERVER ; loading system definition from ; /Users/sven/apps/asdf/systems/s-http-server.asd into ; # ; Loading /Users/sven/apps/asdf/systems/s-http-server.asd ; registering # as S-HTTP-SERVER ; loading system definition from /Users/sven/apps/asdf/systems/puri.asd ; into # ; Loading /Users/sven/apps/asdf/systems/puri.asd ; registering # as PURI ; registering # as PURI-TESTS ; loading system definition from ; /Users/sven/apps/asdf/systems/s-base64.asd into # ; Loading /Users/sven/apps/asdf/systems/s-base64.asd ; registering # as S-BASE64 ; loading system definition from ; /Users/sven/apps/asdf/systems/s-sysdeps.asd into # ; Loading /Users/sven/apps/asdf/systems/s-sysdeps.asd ; registering # as S-SYSDEPS ; loading system definition from ; /Users/sven/apps/asdf/systems/s-utils.asd into # ; Loading /Users/sven/apps/asdf/systems/s-utils.asd ; registering # as S-UTILS ; loading system definition from ; /Users/sven/apps/asdf/systems/kpax-core.asd into # ; Loading /Users/sven/apps/asdf/systems/kpax-core.asd ; registering # as KPAX-CORE ; loading system definition from ; /Users/sven/apps/asdf/systems/cl-who.asd into # ; Loading /Users/sven/apps/asdf/systems/cl-who.asd ; registering # as CL-WHO ; loading system definition from ; /Users/sven/apps/asdf/systems/kpax-mod-lisp.asd into ; # ; Loading /Users/sven/apps/asdf/systems/kpax-mod-lisp.asd ; registering # as KPAX-MOD-LISP ; Fast loading /Users/sven/apps/portableaserve/libs/puri-1.3.1/src.fasl ; Fast loading /Users/sven/darcs/s-base64/src/package.fasl ; Fast loading /Users/sven/darcs/s-base64/src/base64.fasl ; Fast loading /Users/sven/darcs/s-sysdeps/src/package.fasl ; Fast loading /Users/sven/darcs/s-sysdeps/src/sysdeps.fasl ; Fast loading /Users/sven/darcs/s-utils/src/package.fasl ; Fast loading /Users/sven/darcs/s-utils/src/utils.fasl ; Fast loading /Users/sven/darcs/s-http-server/src/package.fasl ; Fast loading /Users/sven/darcs/s-http-server/src/http-server.fasl ; Fast loading /Users/sven/apps/cl-who/packages.fasl ; Fast loading /Users/sven/apps/cl-who/who.fasl ; Fast loading /Users/sven/darcs/kpax/src/package-kpax.fasl ; Fast loading /Users/sven/darcs/kpax/src/log.fasl ; Fast loading /Users/sven/darcs/kpax/src/util.fasl ; Fast loading /Users/sven/darcs/kpax/src/localization.fasl ; Fast loading /Users/sven/darcs/kpax/src/sha1.fasl Warning: Ignoring declaration of unrecognized ftype: (FUNCTION (UB32 UB32 UB32) UB32) Warning: The type subform of the FTYPE declaration must be a subtype of FUNCTION: (FTYPE (FUNCTION (UB32 UB32 UB32) UB32) F1 F2 F3 F4) Warning: Ignoring declaration of unrecognized ftype: (FUNCTION (UB32 UB32) UB32) Warning: The type subform of the FTYPE declaration must be a subtype of FUNCTION: (FTYPE (FUNCTION (UB32 UB32) UB32) MOD32+) Warning: Ignoring declaration of unrecognized ftype: (FUNCTION (UB32 (UNSIGNED-BYTE 5)) UB32) Warning: The type subform of the FTYPE declaration must be a subtype of FUNCTION: (FTYPE (FUNCTION (UB32 (UNSIGNED-BYTE 5)) UB32) ROL32) ; Fast loading /Users/sven/darcs/kpax/src/md5.fasl ; Fast loading /Users/sven/darcs/kpax/src/mersenne-twister-random.fasl ; Fast loading /Users/sven/darcs/kpax/src/hmac.fasl ; Fast loading /Users/sven/darcs/kpax/src/crypto.fasl ; Autoloading for EXCL::GRAY-OPEN: ; Fast loading from bundle code/streamc.fasl. ; Fast loading from bundle code/efft-utf8-base.fasl. ; Fast loading from bundle code/efft-void.fasl. ; Fast loading from bundle code/efft-latin1-base.fasl. ; Fast loading /Users/sven/darcs/kpax/src/html-macro.fasl ; Fast loading /Users/sven/darcs/kpax/src/html.fasl ; Fast loading /Users/sven/darcs/kpax/src/globals.fasl ; Fast loading /Users/sven/darcs/kpax/src/constants.fasl ; Fast loading /Users/sven/darcs/kpax/src/attributes-mixin.fasl ; Fast loading /Users/sven/darcs/kpax/src/session.fasl ; Fast loading /Users/sven/darcs/kpax/src/server.fasl ; Fast loading /Users/sven/darcs/kpax/src/request-response.fasl ; Fast loading /Users/sven/darcs/kpax/src/translator.fasl ; Fast loading /Users/sven/darcs/kpax/src/web-app-in-server.fasl ; Fast loading /Users/sven/darcs/kpax/src/session-tracking.fasl ; Fast loading /Users/sven/darcs/kpax/src/web-app.fasl ; Fast loading /Users/sven/darcs/kpax/src/dispatcher.fasl ; Fast loading /Users/sven/darcs/kpax/src/debug.fasl ; Fast loading /Users/sven/darcs/kpax/src/kpax.fasl ; Fast loading /Users/sven/darcs/kpax/src/run.fasl ; Fast loading /Users/sven/darcs/kpax/src/multipart-form-encoding.fasl ; Fast loading /Users/sven/darcs/kpax/src/extensions.fasl ; Fast loading /Users/sven/darcs/kpax/src/options.fasl ; Fast loading /Users/sven/darcs/kpax/src/constraints.fasl ; Fast loading /Users/sven/darcs/kpax/src/menubar.fasl ; Fast loading /Users/sven/darcs/kpax/src/data-set-view.fasl ; Fast loading /Users/sven/darcs/kpax/src/web-form.fasl ; Fast loading /Users/sven/darcs/kpax/src/package-kpax-user.fasl ; Fast loading /Users/sven/darcs/kpax/src/s-http-server.fasl ; Fast loading /Users/sven/darcs/kpax/src/mod-lisp.fasl ; Fast loading /Users/sven/darcs/kpax/example/helloworld1.fasl ; Fast loading /Users/sven/darcs/kpax/example/factorial1.fasl ; Fast loading /Users/sven/darcs/kpax/example/session1.fasl ; Fast loading /Users/sven/darcs/kpax/example/no-session1.fasl ; Fast loading /Users/sven/darcs/kpax/example/snoop1.fasl ; Fast loading /Users/sven/darcs/kpax/example/forms1.fasl ; Fast loading /Users/sven/darcs/kpax/example/forms2.fasl ; Fast loading /Users/sven/darcs/kpax/example/benchmark1.fasl ; Fast loading /Users/sven/darcs/kpax/example/todo-list.fasl ; Fast loading /Users/sven/darcs/kpax/example/secure1.fasl ; Fast loading /Users/sven/darcs/kpax/example/upload1.fasl ; Fast loading /Users/sven/darcs/kpax/example/upload2.fasl ; Fast loading /Users/sven/darcs/kpax/example/upload3.fasl ; Fast loading /Users/sven/darcs/kpax/example/calculator.fasl ; Fast loading /Users/sven/darcs/kpax/example/list-web-apps.fasl ; Fast loading /Users/sven/darcs/kpax/example/menu1.fasl ; Fast loading /Users/sven/darcs/kpax/example/tabs1.fasl ; Fast loading /Users/sven/darcs/kpax/example/browser1.fasl ; Fast loading /Users/sven/darcs/kpax/example/secure-login.fasl ; Fast loading /Users/sven/darcs/kpax/example/pi.fasl ; Fast loading /Users/sven/darcs/kpax/example/lsp.fasl ; Fast loading /Users/sven/darcs/kpax/example/wiki.fasl NIL CL-USER(3): :ok :ok CL-USER(4): (in-package :kpax) # KPAX(5): (start-kpax :server-class 's-http-server) ;; S-HTTP-SERVER: Started a new server on port 2001 # KPAX(6): (describe *) # is an instance of #: The following slots have :INSTANCE allocation: CUTOFF 200 LOGGER-LOCK # APPENDERS (# #) LAST-FLUSHED-TIMESTAMP 3369750109 ATTRIBUTES NIL SESSIONS # SESSION-LIFETIME 3600 SESSIONS-LAST-REAPED 3369750109 SESSION-ID-SEED 3111288172 SESSION-LOCK # DYNAMIC-PREFIX "/kpax/dynamic/" STATIC-PREFIX "/kpax/static/" HOSTNAME "localhost" SERVER-ID "KPAX1" DISPATCHER # DEBUG-MODE T STREAM-APPENDER # DEBUG-STREAM-APPENDER # STATE :RUNNING S-HTTP-SERVER # KPAX(7): (asdf:oos 'asdf:load-op :s-http-client) ; loading system definition from ; /Users/sven/apps/asdf/systems/s-http-client.asd into ; # ; Loading /Users/sven/apps/asdf/systems/s-http-client.asd ; registering # as S-HTTP-CLIENT ; Fast loading /Users/sven/darcs/s-http-client/src/package.fasl ; Fast loading /Users/sven/darcs/s-http-client/src/http-client.fasl NIL KPAX(8): (load "~/darcs/kpax/example/reddit.lisp") ; Loading /Users/sven/darcs/kpax/example/reddit.lisp T KPAX(9): ;; S-HTTP-SERVER: [1] Handling # ;; S-HTTP-SERVER: Running KPAX s-http-server-handler ;; KPAX 20061013T174359 INFO handling /kpax/dynamic/reddit ;; KPAX 20061013T174359 INFO created new session 2tiw9yidl02rr [13362880952977667847] ;; KPAX 20061013T174359 INFO replied 578 bytes with status OK ;; S-HTTP-SERVER: [1] Handling # ;; S-HTTP-SERVER: [1] Handling # ;; S-HTTP-SERVER: Running KPAX s-http-server-handler ;; KPAX 20061013T174418 INFO handling /kpax/dynamic/reddit/reddit-new- link ;; KPAX 20061013T174418 INFO replied 725 bytes with status OK ;; S-HTTP-SERVER: [1] Handling # ;; S-HTTP-SERVER: [1] Handling # ;; S-HTTP-SERVER: Running KPAX s-http-server-handler ;; KPAX 20061013T174457 INFO handling /kpax/dynamic/reddit/reddit- submit-new-link ; Fast loading from bundle code/acldns.fasl. ;;; Installing acldns patch, version 1 ;; KPAX 20061013T174458 INFO replied 0 bytes with status MOVED ;; S-HTTP-SERVER: [2] Handling # ;; S-HTTP-SERVER: Running KPAX s-http-server-handler ;; KPAX 20061013T174458 INFO handling /kpax/dynamic/reddit/reddit-home ;; KPAX 20061013T174458 INFO replied 1148 bytes with status OK ;; S-HTTP-SERVER: [2] Handling # KPAX(9): *last-request-response* # @ #x10680a1a> KPAX(10): *before-last-request-response* # @ #x1068eb72> KPAX(11): (describe *) # @ #x1068eb72> is an instance of #: The following slots have :INSTANCE allocation: ATTRIBUTES ((:DISPATCH-TIMESTAMP . 7287069527)) URI-STRING "/kpax/dynamic/reddit/reddit-submit-new-link" URI NIL SERVER # APPLICATION # SESSION # SUB-PATH ("reddit-submit-new-link") REQUEST-STATE :BODY-READ RESPONSE-STATE :RESPONSE-FLUSHED RESPONSE-STATUS :MOVED RESPONSE-MIME-TYPE "text/html" RESPONSE-HEADERS (("Content-Type" . "text/html") ("Content-Length" . "0") ("Location" . "/kpax/dynamic/reddit/reddit-home")) BODY "url=http%3A%2F%2Fcommon- lisp.net&title=Common-Lisp.net" CONTENT-STREAM NIL S-HTTP-SERVER-REQUEST # SOCKET-STREAM # PARAMETERS (("url" . "http://common-lisp.net") ("title" . "Common-Lisp.net")) KPAX(12): ;; S-HTTP-SERVER: [3] Handling # ;; S-HTTP-SERVER: Running KPAX s-http-server-handler ;; KPAX 20061013T175031 INFO handling /kpax/dynamic/admin ;; KPAX 20061013T175031 ERROR error No web app found for "/kpax/dynamic/admin" Error: No web app found for "/kpax/dynamic/admin" [condition type: SIMPLE-ERROR] Restart actions (select using :continue): 0: Retry handling failed request 1: Continue by returning an error page 2: Abort entirely from this (lisp) process. [Current process: connection-handler-3] [1] CL-USER(1): From joel at whylisp.com Fri Oct 13 19:01:21 2006 From: joel at whylisp.com (Joel Reymont) Date: Fri, 13 Oct 2006 20:01:21 +0100 Subject: [kpax-devel] Dropping into the debugger In-Reply-To: References: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> <067D7914-ED24-4205-A74E-9EAE6DC49D2A@common-lisp.net> <1C7ACE96-0AF8-47AE-A5C2-EA557DF29729@whylisp.com> <665C0EF0-D2BD-4F01-899E-568AE1C6604E@common-lisp.net> <5D91C578-85A8-4C67-A056-58E521CB39E3@whylisp.com> Message-ID: On Oct 13, 2006, at 6:58 PM, Sven Van Caekenberghe wrote: > I tried compiling, loading and running KPAX, all the standard > examples as well as the reddit example, > and from a first look, everything went fine - see the transcript > below. I'm not sure how production-ready or performant s-http-server is so I was trying to use AllegroServe. > I am using the s-http-server variant (standalone http server in > lisp, no need for mod_lisp stuff). Would you mind trying with with AllegroServe, the built-in variant, not Portable AllegroServe that comes as as a component. Thanks, Joel -- http://whylisp.com From scaekenberghe at common-lisp.net Fri Oct 13 20:34:51 2006 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Fri, 13 Oct 2006 22:34:51 +0200 Subject: [kpax-devel] Dropping into the debugger In-Reply-To: References: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> <067D7914-ED24-4205-A74E-9EAE6DC49D2A@common-lisp.net> <1C7ACE96-0AF8-47AE-A5C2-EA557DF29729@whylisp.com> <665C0EF0-D2BD-4F01-899E-568AE1C6604E@common-lisp.net> <5D91C578-85A8-4C67-A056-58E521CB39E3@whylisp.com> Message-ID: <0BA8FB8D-46BA-4B96-B791-DE043C23A8AD@common-lisp.net> On 13 Oct 2006, at 21:01, Joel Reymont wrote: > Would you mind trying with with AllegroServe, the built-in variant, > not Portable AllegroServe that comes as as a component. Well I only ever used paserve, not the original, and I don't know how much they differ... Unless the API and packages are identical, you might have to make another front-end (server-class): just copy paserve.lisp file, rename the web-app-server and request- response subclasses, and adjust the methods all methods signatures, and some implementations where necessary - it wont be difficult, and you'll get a free look behind the scenes. Sven From joel at whylisp.com Sat Oct 14 17:13:39 2006 From: joel at whylisp.com (Joel Reymont) Date: Sat, 14 Oct 2006 18:13:39 +0100 Subject: [kpax-devel] Dropping into the debugger In-Reply-To: <0BA8FB8D-46BA-4B96-B791-DE043C23A8AD@common-lisp.net> References: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> <067D7914-ED24-4205-A74E-9EAE6DC49D2A@common-lisp.net> <1C7ACE96-0AF8-47AE-A5C2-EA557DF29729@whylisp.com> <665C0EF0-D2BD-4F01-899E-568AE1C6604E@common-lisp.net> <5D91C578-85A8-4C67-A056-58E521CB39E3@whylisp.com> <0BA8FB8D-46BA-4B96-B791-DE043C23A8AD@common-lisp.net> Message-ID: <719CEBF3-7819-41F9-9300-AA6F0FFB73D5@whylisp.com> On Oct 13, 2006, at 9:34 PM, Sven Van Caekenberghe wrote: > Unless the API and packages are identical, you might have to make > another front-end (server-class): The problem is that commit is called internally after redirect-to. The function is implemented differently for paserve and s-http- server, though. s-http-server: (defmethod commit ((request-response s-http-server-request-response)) (with-slots (response-state content-stream socket-stream request- state) request-response (unless (eql request-state :body-read) (get-request-body request-response)) (unless (eql response-state :response-written) (let* ((output (when content-stream (get-output-stream-string content-stream))) (size (if output (length output) 0))) (commit-headers request-response size) (when (plusp size) (write-string output socket-stream)))) (finish-output socket-stream) (setf response-state :response-flushed))) Notice how nothing is done above, basically, when there's no content stream. (defmethod commit ((request-response paserve-request-response)) (with-slots (paserve-request paserve-entity content-stream response-status response-mime-type) request-response (net.aserve:with-http-response (paserve-request paserve-entity :content-type response-mime-type :response (response-status-to-paserve-status response-status)) (net.aserve:with-http-body (paserve-request paserve-entity) (let ((output (get-output-stream-string content-stream))) (setf (net.aserve:request-reply-content-length paserve- request) (length output)) (write-string output net.aserve::*html-stream*) (log-info request-response "replied ~d bytes with status ~a" (length output) response-status)))))) Thanks, Joel -- http://whylisp.com From scaekenberghe at common-lisp.net Sat Oct 14 19:56:25 2006 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Sat, 14 Oct 2006 21:56:25 +0200 Subject: [kpax-devel] Dropping into the debugger In-Reply-To: <719CEBF3-7819-41F9-9300-AA6F0FFB73D5@whylisp.com> References: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> <067D7914-ED24-4205-A74E-9EAE6DC49D2A@common-lisp.net> <1C7ACE96-0AF8-47AE-A5C2-EA557DF29729@whylisp.com> <665C0EF0-D2BD-4F01-899E-568AE1C6604E@common-lisp.net> <5D91C578-85A8-4C67-A056-58E521CB39E3@whylisp.com> <0BA8FB8D-46BA-4B96-B791-DE043C23A8AD@common-lisp.net> <719CEBF3-7819-41F9-9300-AA6F0FFB73D5@whylisp.com> Message-ID: <8699B5A3-47E3-4D07-84FA-E931013C45B9@common-lisp.net> On 14 Oct 2006, at 19:13, Joel Reymont wrote: > Notice how nothing is done above, basically, when there's no > content stream. There was even more wrong in commit in paserve.lisp (custom response headers were not passed to paserve). The following version (also available in the darcs repository) makes the redirect work in the reddit example: (defmethod commit ((request-response paserve-request-response)) (with-slots (paserve-request paserve-entity content-stream response-status response-mime-type response-headers) request-response (net.aserve:with-http-response (paserve-request paserve-entity :content-type response-mime-type :response (response-status-to-paserve- status response-status)) (net.aserve:with-http-body (paserve-request paserve-entity :headers response-headers) (let* ((output (when content-stream (get-output-stream- string content-stream))) (size (if output (length output) 0))) (setf (net.aserve:request-reply-content-length paserve- request) size) (when (plusp size) (write-string output net.aserve::*html- stream*)) (log-info request-response "replied ~d bytes with status ~a" size response-status)))))) There might be more bitrot in the paserve.lisp file - I haven't actually ran or used paserve in a very long while. Anyway, thanks for pointing this out and spotting the actual problem! I guess you did get multithreaded debugging working under slime ;-) Anyway, the following might also help: (net.aserve::debug-on :notrap) (net.aserve::note-debug-set) The first form causes paserve to enter the debugger on errors (itself, apart from kpax), the second form reports the current debug settings. Sven From joel at whylisp.com Sun Oct 15 12:39:11 2006 From: joel at whylisp.com (Joel Reymont) Date: Sun, 15 Oct 2006 13:39:11 +0100 Subject: [kpax-devel] Dropping into the debugger In-Reply-To: <8699B5A3-47E3-4D07-84FA-E931013C45B9@common-lisp.net> References: <7E858E19-E4C9-47B2-954C-4A82CB5A476E@whylisp.com> <067D7914-ED24-4205-A74E-9EAE6DC49D2A@common-lisp.net> <1C7ACE96-0AF8-47AE-A5C2-EA557DF29729@whylisp.com> <665C0EF0-D2BD-4F01-899E-568AE1C6604E@common-lisp.net> <5D91C578-85A8-4C67-A056-58E521CB39E3@whylisp.com> <0BA8FB8D-46BA-4B96-B791-DE043C23A8AD@common-lisp.net> <719CEBF3-7819-41F9-9300-AA6F0FFB73D5@whylisp.com> <8699B5A3-47E3-4D07-84FA-E931013C45B9@common-lisp.net> Message-ID: On Oct 14, 2006, at 8:56 PM, Sven Van Caekenberghe wrote: > There was even more wrong in commit in paserve.lisp (custom > response headers were not passed to paserve). That's basically how I fixed it. Thanks for the official patch! -- http://whylisp.com