fukamachi / lack

Lack, the core of Clack
MIT License
156 stars 33 forks source link

Unit test crashes on macOS on SBCL 2.3.7 #75

Open catap opened 1 year ago

catap commented 1 year ago

I'm using macOS 12 and SBCL-2.3.7 and 3745924e4682523b0969a7042bcdb39aa8f73e8f as local root. That leads to :

:info:test ; compilation finished in 0:00:00.534
:info:test WARNING:
:info:test    Deprecated recursive use of (ASDF/OPERATE:OPERATE 'ASDF/LISP-ACTION:LOAD-OP
:info:test    '("t-lack-request")) while visiting
:info:test    (ASDF/LISP-ACTION:TEST-OP "t-lack-request") - please use proper dependencies
:info:test    instead
:info:test Running a test file '/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-lack/cl-lack/work/build/source/cl-lack/t/request.lisp'
:info:test   ESC[32m✓ ESC[30m*REQUEST* is expected to be a type of REQUEST (got #S(REQUEST
:info:test                                                           :ENV (:CONTENT-TYPE
:info:test                                                                 "application/x-www-form-urlencoded; charset=utf-8"
:info:test                                                                 :CONTENT-LENGTH 20
:info:test                                                                 :URI-SCHEME :HTTP
:info:test                                                                 :QUERY-STRING
:info:test                                                                 "ediweitz=weitzedi&name=eitaro&q=C%2B%2B"
:info:test                                                                 :RAW-BODY
:info:test                                                                 #<CIRCULAR-STREAMS:CIRCULAR-INPUT-STREAM {100753FA03}>
:info:test                                                                 :HEADERS
:info:test                                                                 #<HASH-TABLE :TEST EQUAL :COUNT 4 {10073A9ED3}>
:info:test                                                                 :COOKIES
:info:test                                                                 (("hoge" . "1")
:info:test                                                                  ("fuga" . "semi")
:info:test                                                                  ("colon"))
:info:test                                                                 :QUERY-PARAMETERS
:info:test                                                                 (("ediweitz"
:info:test                                                                   . "weitzedi")
:info:test                                                                  ("name"
:info:test                                                                   . "eitaro")
:info:test                                                                  ("q" . "C++"))
:info:test                                                                 :BODY-PARAMETERS
:info:test                                                                 (("name"
:info:test                                                                   . "深町英太郎")))
:info:test                                                           :METHOD NIL
:info:test                                                           :SCRIPT-NAME NIL
:info:test                                                           :PATH-INFO NIL
:info:test                                                           :SERVER-NAME NIL
:info:test                                                           :SERVER-PORT NIL
:info:test                                                           :SERVER-PROTOCOL NIL
:info:test                                                           :URI NIL
:info:test                                                           :URI-SCHEME :HTTP
:info:test                                                           :REMOTE-ADDR NIL
:info:test                                                           :REMOTE-PORT NIL
:info:test                                                           :QUERY-STRING "ediweitz=weitzedi&name=eitaro&q=C%2B%2B"
:info:test                                                           :RAW-BODY #<CIRCULAR-STREAMS:CIRCULAR-INPUT-STREAM {100753FA03}>
:info:test                                                           :CONTENT-LENGTH 20
:info:test                                                           :CONTENT-TYPE "application/x-www-form-urlencoded; charset=utf-8"
:info:test                                                           :HEADERS #<HASH-TABLE :TEST EQUAL :COUNT 4 {10073A9ED3}>
:info:test                                                           :COOKIES (("hoge" . "1")
:info:test                                                                     ("fuga"
:info:test                                                                      . "semi")
:info:test                                                                     ("colon"))
:info:test                                                           :BODY-PARAMETERS (("name"
:info:test                                                                              . "深町英太郎"))
:info:test                                                           :QUERY-PARAMETERS (("ediweitz"
:info:test                                                                               . "weitzedi")
:info:test                                                                              ("name"
:info:test                                                                               . "eitaro")
:info:test                                                                              ("q"
:info:test                                                                               . "C++"))
:info:test                                                           :ACCEPT (#S(LACK.MEDIA-TYPE:MEDIA-TYPE
:info:test                                                                       :MAIN-TYPE "text"
:info:test                                                                       :SUB-TYPE "html"
:info:test                                                                       :PARAMS NIL))))ESC[30m 
:info:test ESC[0m
:info:test   ESC[32m✓ ESC[30mrequest-envESC[30m 
:info:test ESC[0m
:info:test   ESC[32m✓ ESC[30mrequest-content-typeESC[30m 
:info:test ESC[0m
:info:test   ESC[32m✓ ESC[30mrequest-query-parametersESC[30m 
:info:test ESC[0m
:info:test   ESC[32m✓ ESC[30mrequest-body-parametersESC[30m 
:info:test ESC[0m
:info:test   ESC[32m✓ ESC[30mrequest-cookiesESC[30m 
:info:test ESC[0m
:info:test   ESC[32m✓ ESC[30mT is expected to be TESC[30m 
:info:test ESC[0m
:info:test   ESC[32m✓ ESC[30mNIL is expected to be NILESC[30m 
:info:test While evaluating the form starting at line 59, column 0
:info:test   of #P"/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-lack/cl-lack/work/build/source/cl-lack/t/request.lisp":
:info:test Unhandled USOCKET:INVALID-ARGUMENT-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
:info:test                                                       {10013A0073}>:
:info:test   Condition USOCKET:INVALID-ARGUMENT-ERROR was signalled.
:info:test Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10013A0073}>
:info:test 0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<USOCKET:INVALID-ARGUMENT-ERROR {10045AF353}> #<unused argument> :QUIT T)
:info:test 1: (SB-DEBUG::RUN-HOOK SB-EXT:*INVOKE-DEBUGGER-HOOK* #<USOCKET:INVALID-ARGUMENT-ERROR {10045AF353}>)
:info:test 2: (INVOKE-DEBUGGER #<USOCKET:INVALID-ARGUMENT-ERROR {10045AF353}>)
:info:test 3: (ERROR USOCKET:INVALID-ARGUMENT-ERROR :SOCKET #<USOCKET:STREAM-USOCKET {10045576C3}>)
:info:test 4: (USOCKET::HANDLE-CONDITION #<SB-BSD-SOCKETS:INVALID-ARGUMENT-ERROR {10045AF323}> #<USOCKET:STREAM-USOCKET {10045576C3}> "127.0.0.1")
:info:test 5: (SB-KERNEL::%SIGNAL #<SB-BSD-SOCKETS:INVALID-ARGUMENT-ERROR {10045AF323}>)
:info:test 6: (ERROR #<SB-BSD-SOCKETS:INVALID-ARGUMENT-ERROR {10045AF323}>)
:info:test 7: (USOCKET:SOCKET-CONNECT "127.0.0.1" 4242 :PROTOCOL :STREAM :ELEMENT-TYPE (UNSIGNED-BYTE 8) :TIMEOUT 10 :DEADLINE NIL :NODELAY T :LOCAL-HOST NIL :LOCAL-PORT NIL)
:info:test 8: ((LABELS DEXADOR.BACKEND.USOCKET::MAKE-NEW-CONNECTION :IN DEXADOR.BACKEND.USOCKET:REQUEST) #<QURI.URI.HTTP:URI-HTTP http://127.0.0.1:4242/>)
:info:test 9: (DEXADOR.BACKEND.USOCKET:REQUEST #<unavailable argument> :METHOD :POST :CONTENT (("file" . #P"/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-lack/cl-lack/work/build/source/cl-lack/data/jellyfish.jpg")))
:info:test 10: ((LAMBDA NIL :IN "/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-lack/cl-lack/work/build/source/cl-lack/t/request.lisp"))
:info:test 11: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SUBTEST-APP "make-request" (LAMBDA (ENV) (MAKE-REQUEST ENV) (SB-INT:QUASIQUOTE (200 NIL (#)))) (MULTIPLE-VALUE-BIND (BODY STATUS) (DEXADOR:POST (LOCALHOST) :CONTENT (SB-INT:QUASIQUOTE (#))) (IS STATUS 200) (IS BODY "jellyfish.jpg")) (MULTIPLE-VALUE-BIND (BODY STATUS) (DEXADOR:POST (LOCALHOST) :CONTENT (SB-INT:QUASIQUOTE (#))) (IS STATUS 200) (IS BODY "jellyfish.jpg"))) #<NULL-LEXENV>)
:info:test 12: (SB-EXT:EVAL-TLF (SUBTEST-APP "make-request" (LAMBDA (ENV) (MAKE-REQUEST ENV) (SB-INT:QUASIQUOTE (200 NIL (#)))) (MULTIPLE-VALUE-BIND (BODY STATUS) (DEXADOR:POST (LOCALHOST) :CONTENT (SB-INT:QUASIQUOTE (#))) (IS STATUS 200) (IS BODY "jellyfish.jpg")) (MULTIPLE-VALUE-BIND (BODY STATUS) (DEXADOR:POST (LOCALHOST) :CONTENT (SB-INT:QUASIQUOTE (#))) (IS STATUS 200) (IS BODY "jellyfish.jpg"))) 13 NIL)
:info:test 13: ((LABELS SB-FASL::EVAL-FORM :IN SB-INT:LOAD-AS-SOURCE) (SUBTEST-APP "make-request" (LAMBDA (ENV) (MAKE-REQUEST ENV) (SB-INT:QUASIQUOTE (200 NIL (#)))) (MULTIPLE-VALUE-BIND (BODY STATUS) (DEXADOR:POST (LOCALHOST) :CONTENT (SB-INT:QUASIQUOTE (#))) (IS STATUS 200) (IS BODY "jellyfish.jpg")) (MULTIPLE-VALUE-BIND (BODY STATUS) (DEXADOR:POST (LOCALHOST) :CONTENT (SB-INT:QUASIQUOTE (#))) (IS STATUS 200) (IS BODY "jellyfish.jpg"))) 13)
:info:test 14: ((LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) (SUBTEST-APP "make-request" (LAMBDA (ENV) (MAKE-REQUEST ENV) (SB-INT:QUASIQUOTE (200 NIL (#)))) (MULTIPLE-VALUE-BIND (BODY STATUS) (DEXADOR:POST (LOCALHOST) :CONTENT (SB-INT:QUASIQUOTE (#))) (IS STATUS 200) (IS BODY "jellyfish.jpg")) (MULTIPLE-VALUE-BIND (BODY STATUS) (DEXADOR:POST (LOCALHOST) :CONTENT (SB-INT:QUASIQUOTE (#))) (IS STATUS 200) (IS BODY "jellyfish.jpg"))) :CURRENT-INDEX 13)
:info:test 15: (SB-C::%DO-FORMS-FROM-INFO #<FUNCTION (LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) {1006F61E6B}> #<SB-C::SOURCE-INFO {1006F57D93}> SB-C::INPUT-ERROR-IN-LOAD)
:info:test 16: (SB-INT:LOAD-AS-SOURCE #<SB-INT:FORM-TRACKING-STREAM for "file /opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-lack/cl-lack/work/build/source/cl-lack/t/request.lisp" {1006F479B3}> :VERBOSE NIL :PRINT NIL :CONTEXT "loading")
:info:test 17: ((LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) #<SB-INT:FORM-TRACKING-STREAM for "file /opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-lack/cl-lack/work/build/source/cl-lack/t/request.lisp" {1006F479B3}> NIL)
:info:test 18: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<FUNCTION (LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) {8C6E60B}> #<SB-INT:FORM-TRACKING-STREAM for "file /opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-lack/cl-lack/work/build/source/cl-lack/t/request.lisp" {1006F479B3}> NIL #<SB-INT:FORM-TRACKING-STREAM for "file /opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-lack/cl-lack/work/build/source/cl-lack/t/request.lisp" {1006F479B3}>)
:info:test 19: (LOAD #P"/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-lack/cl-lack/work/build/source/cl-lack/t/request.lisp" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST :ERROR :EXTERNAL-FORMAT :UTF-8)
:info:test 20: (UIOP/UTILITY:CALL-WITH-MUFFLED-CONDITIONS #<FUNCTION (LAMBDA NIL :IN UIOP/LISP-BUILD:LOAD*) {1006F4627B}> ("Overwriting already existing readtable ~S." #(#:FINALIZERS-OFF-WARNING :ASDF-FINALIZERS)))
:info:test 21: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-SOURCE-OP > #<TEST-FILE "t-lack-request" "t/request">)
:info:test 22: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
:info:test 23: (RUN-TEST-SYSTEM #<ASDF/SYSTEM:SYSTEM "t-lack-request">)
:info:test 24: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:TEST-OP > #<ASDF/SYSTEM:SYSTEM "t-lack-request">)
:info:test 25: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
:info:test 26: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:TEST-OP > #<ASDF/SYSTEM:SYSTEM "t-lack-request">) [fast-method]
:info:test 27: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {100327E693}>) [fast-method]
:info:test 28: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
:info:test 29: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {100327E693}>) [fast-method]
:info:test 30: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:TEST-OP > #<ASDF/SYSTEM:SYSTEM "t-lack-request"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
:info:test 31: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:TEST-OP > #<ASDF/SYSTEM:SYSTEM "t-lack-request">)
:info:test 32: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
:info:test 33: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:TEST-OP > #<ASDF/SYSTEM:SYSTEM "t-lack-request">) [fast-method]
:info:test 34: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:TEST-OP COMMON-LISP-USER::T-LACK-REQUEST)
:info:test 35: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
:info:test 36: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:TEST-OP COMMON-LISP-USER::T-LACK-REQUEST) [fast-method]
:info:test 37: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10027A4FBB}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
:info:test 38: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
:info:test 39: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {1002C2DC5B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
:info:test 40: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:TEST-OP COMMON-LISP-USER::T-LACK-REQUEST) [fast-method]
:info:test 41: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ASDF/OPERATE:OPERATE (QUOTE ASDF/LISP-ACTION:TEST-OP) (QUOTE COMMON-LISP-USER::T-LACK-REQUEST)) #<NULL-LEXENV>)
:info:test 42: (EVAL (ASDF/OPERATE:OPERATE (QUOTE ASDF/LISP-ACTION:TEST-OP) (QUOTE COMMON-LISP-USER::T-LACK-REQUEST)))
:info:test 43: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:EVAL . "(require \"asdf\")") (:EVAL . #<(SIMPLE-ARRAY CHARACTER (245)) (setf asdf:*central-registry* (list* (quote *default-pathname-defaults*) #p"/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-lack/cl-lack/work/build/system/" #p"/opt/local/share/c... {100236A1AF}>) (:EVAL . "(asdf:operate (quote asdf:test-op) (quote t-lack-request))") (:QUIT)))
:info:test 44: (SB-IMPL::TOPLEVEL-INIT)
:info:test 45: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
:info:test 46: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-IMPL::START-LISP))
:info:test 47: (SB-IMPL::%START-LISP)
catap commented 1 year ago

The very simmilar issue had happened with clack:

    Expect (EQUAL (DEXADOR:POST (LOCALHOST) :CONTENT "body") "body") to be true.
        at /opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-clack/cl-clack/work/build/source/cl-clack/src/test/suite.lisp:452:4
    INVALID-ARGUMENT-ERROR: Condition USOCKET:INVALID-ARGUMENT-ERROR was signalled.
      (EQUAL (DEXADOR:POST (CLACK.TEST.SUITE::LOCALHOST) :CONTENT . #1=("body"))
             . #1#)

      0: (USOCKET::HANDLE-CONDITION Socket error in "getpeername": EINVAL (Invalid argument) #<STREAM-USOCKET {100683FF73}> 127.0.0.1)
      1: (SB-KERNEL::%SIGNAL Socket error in "getpeername": EINVAL (Invalid argument))
      2: (ERROR Socket error in "getpeername": EINVAL (Invalid argument))
      3: (USOCKET:SOCKET-CONNECT 127.0.0.1 4949 PROTOCOL STREAM ELEMENT-TYPE (UNSIGNED-BYTE 8) TIMEOUT 10 DEADLINE NIL NODELAY T LOCAL-HOST NIL LOCAL-PORT NIL)
      4: ((LABELS DEXADOR.BACKEND.USOCKET::MAKE-NEW-CONNECTION :IN DEXADOR.BACKEND.USOCKET:REQUEST) http://127.0.0.1:4949/)
      5: (DEXADOR.BACKEND.USOCKET:REQUEST #<unavailable argument> METHOD GET)
      6: ((LAMBDA NIL :IN "/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-clack/cl-clack/work/build/source/cl-clack/src/test/suite.lisp"))
      7: (ROVE/CORE/TEST::CALL-WITH-TESTING-WITH-OPTIONS Do not crash when the app dies NIL #<FUNCTION (LAMBDA NIL :IN "/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-clack/cl-clack/work/build/source/cl-clack/src/test/suite.lisp") {53C277CB}>)
      8: (CLACK.TEST::%TESTING-APP #<FUNCTION (LAMBDA (CLACK.TEST.SUITE::ENV) :IN "/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-clack/cl-clack/work/build/source/cl-clack/src/test/suite.lisp") {53C2796B}> #<FUNCTION (LAMBDA NIL :IN "/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-clack/cl-clack/work/build/source/cl-clack/src/test/suite.lisp") {53C2777B}>)
      9: ((LAMBDA NIL :IN "/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-clack/cl-clack/work/build/source/cl-clack/src/test/suite.lisp"))
      10: (ROVE/CORE/TEST::CALL-WITH-TESTING-WITH-OPTIONS debug-tests DEBUG-TESTS #<FUNCTION (LAMBDA NIL :IN "/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-clack/cl-clack/work/build/source/cl-clack/src/test/suite.lisp") {53C2765B}>)
      11: ((:METHOD ROVE/CORE/SUITE/PACKAGE:RUN-SUITE (ROVE/CORE/SUITE/PACKAGE::SUITE)) #<SUITE {10060AA8C3}>)
      12: (CLACK.TEST.SUITE:RUN-SERVER-TESTS FCGI)
      13: ((LAMBDA NIL :IN "/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-clack/cl-clack/work/build/source/cl-clack/t/handler/fcgi.lisp"))
      14: (ROVE/CORE/TEST::CALL-WITH-TESTING-WITH-OPTIONS fcgi-tests FCGI-TESTS #<FUNCTION (LAMBDA NIL :IN "/opt/local/var/macports/build/_Users_catap_src_macports-ports_lisp_cl-clack/cl-clack/work/build/source/cl-clack/t/handler/fcgi.lisp") {53C27ADB}>)