Paste number 78304: ccl hunchentoot thread safety string-stream fail

Index of paste annotations: 1 | 2

Paste number 78304: ccl hunchentoot thread safety string-stream fail
Pasted by: antifuchs
When:3 years, 1 month ago
Share:Tweet this! | http://paste.lisp.org/+1OF4
Channel:#lisp
Paste contents:
Raw Source | XML | Display As
This backtrace comes up reliably if I run ab -c 10 against a hunchentoot instance I've running on ccl 1.3-dev-r11912  (DarwinX8664). ab -c 1 works perfectly.

value #<STRING-OUTPUT-STREAM  #x300041E811ED> is not of the expected type STRUCTURE.
   [Condition of type TYPE-ERROR]

Restarts:
 0: [ABORT-BREAK] Reset this thread
 1: [ABORT] Kill this thread

Backtrace:
  0: (#<Anonymous Function #x30004100FF3F> #<Compiled-function SWANK:SWANK-DEBUGGER-HOOK #x3000410C047F> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK:INVOKE-SLIME-DEBUGGER) #x300041FB433F>)
  1: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-OUTPUT* . #<SWANK-BACKEND::SLIME-OUTPUT-STREAM #x30004111958D>) (*STANDARD-INPUT* . #<SWANK-BACKEND::SLIME-INPUT-STREAM #x30004111154D>) ..)))
  2: (SWANK::CALL-WITH-CONNECTION #<CONNECTION #x3000410F279D> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK:INVOKE-SLIME-DEBUGGER) #x300041ECCA1F>)
  3: (SWANK:INVOKE-SLIME-DEBUGGER #<TYPE-ERROR #x300041ECCA9D>)
  4: (#<Anonymous Function #x30004100FF3F> #<Compiled-function SWANK:SWANK-DEBUGGER-HOOK #x3000410C047F> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK:SWANK-DEBUGGER-HOOK) #x300041ECCA5F>)
  5: (SWANK:SWANK-DEBUGGER-HOOK #<TYPE-ERROR #x300041ECCA9D> #<Compiled-function SWANK:SWANK-DEBUGGER-HOOK #x3000410C047F>)
  6: (CCL::BREAK-LOOP-HANDLE-ERROR #<TYPE-ERROR #x300041ECCA9D> 3190155)
  7: (CCL::%ERROR #<TYPE-ERROR #x300041ECCA9D> NIL 3190155)
  8: ((:INTERNAL CCL::%XERR-DISP))
  9: (CCL::FUNCALL-WITH-ERROR-REENTRY-DETECTION #<COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%XERR-DISP) #x196787F>)
 10: (CCL::%XERR-DISP 370385030)
 11: (CCL::%PASCAL-FUNCTIONS% 2 370385030)
 12: (CCL::CREATE-STRING-OUTPUT-STREAM-IOBLOCK :STREAM #<STRING-OUTPUT-STREAM  :CLOSED #x300041ECCB2D> :STRING "" :ELEMENT-TYPE CHARACTER :WRITE-CHAR-FUNCTION CCL::STRING-OUTPUT-STREAM-IOBLOCK-WRITE-CHAR :..
 13: (CCL::%%MAKE-STRING-OUTPUT-STREAM #<BUILT-IN-CLASS STRING-OUTPUT-STREAM> "" CCL::STRING-OUTPUT-STREAM-IOBLOCK-WRITE-CHAR CCL::STRING-OUTPUT-STREAM-IOBLOCK-WRITE-SIMPLE-STRING)
 14: (FORMAT #<STRING-OUTPUT-STREAM  :CLOSED #x300041ECCB2D> "~A.~A.~A.~A" 127 0 0 1)
 15: (HUNCHENTOOT::CLIENT-AS-STRING #<USOCKET:STREAM-USOCKET #x300041ECCBDD>)
      Locals:
        HUNCHENTOOT::SOCKET = #<USOCKET:STREAM-USOCKET #x300041ECCBDD>
        HUNCHENTOOT::ADDRESS = #(127 0 0 1)
        HUNCHENTOOT::PORT = 53102
 16: (#<STANDARD-METHOD HUNCHENTOOT:HANDLE-INCOMING-CONNECTION (HUNCHENTOOT:ONE-THREAD-PER-CONNECTION-TASKMASTER ..)
 17: (#<STANDARD-METHOD HUNCHENTOOT:ACCEPT-CONNECTIONS (HUNCHENTOOT:ACCEPTOR)> #<DEBUGGABLE-ACCEPTOR (host *, port 4242)>)
 18: ((:INTERNAL BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
 19: (CCL::RUN-PROCESS-INITIAL-FORM #<PROCESS Hunchentoot listener (*:4242)(57) [Reset] #x300041ECA7ED> (#<COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #x300041ECA58F>))
 20: ((:INTERNAL ..))
 21: ((:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION))

Annotations for this paste:

Annotation number 1: Here's a smaller test case. ccl, darwin x86_64.
Pasted by: antifuchs
When:3 years, 1 month ago
Share:Tweet this! | http://paste.lisp.org/+1OF4/1
Paste contents:
Raw Source | Display As
(cl:in-package :cl-user)

(hunchentoot:start (make-instance 'hunchentoot:acceptor :port 4242))

(hunchentoot:define-easy-handler (static-json :uri "/bench/json/dummy")
    ()
  "[[[1114370936000, 3.016666666666667e-1], [1117131100000, 3.12e-1], [1119903045000, 3.1266666666666665e-1], [1122330766000, 3.1266666666666665e-1], [1125075618000, 3.12e-1], [1127825895000, 3.116666666666667e-1], [1130373796000, 3.113333333333333e-1], [1133196772000, 3.113333333333333e-1], [1135700334000, 3.08e-1], [1138300151000, 3.12e-1], [1141006083000, 3.1066666666666665e-1], [1143413954000, 3.013333333333333e-1], [1146065363000, 3.013333333333333e-1], [1148759200000, 3.036666666666667e-1], [1151343632000, 3.0e-1], [1153943420000, 3.0e-1], [1156537602000, 3.0266666666666664e-1], [1159288015000, 2.9866666666666664e-1], [1161784720000, 2.9866666666666664e-1], [1164850603000, 3.0e-1], [1167141464000, 3.1066666666666665e-1], [1169736694000, 3.053333333333333e-1], [1172603022000, 3.16e-1], [1174837194000, 3.053333333333333e-1], [1177782478000, 3.1866666666666665e-1], [1180224808000, 3.16e-1], [1182984249000, 3.133333333333333e-1], [1185367173000, 3.093333333333333e-1], [1188169815000, 3.093333333333333e-1], [1190733504000, 3.053333333333333e-1], [1193344083000, 3.1066666666666665e-1], [1196033635000, 3.1466666666666665e-1], [1198757549000, 3.0266666666666664e-1], [1201469587000, 3.133333333333333e-1], [1204033707000, 3.08e-1], [1208047141000, 3.12e-1], [1211972404000, 3.1066666666666665e-1], [1214766685000, 3.133333333333333e-1], [1220231141000, 3.12e-1], [1222951242000, 2.9466666666666663e-1], [1225400326000, 3.013333333333333e-1], [1228140273000, 3.0e-1], [1230726441000, 3.0266666666666664e-1], [1233625752000, 2.92e-1]], [[1114370936000, 3.0217584174388123e-1, 3.0115749158945215e-1], [1117131100000, 3.1266666666666854e-1, 3.1133333333333146e-1], [1119903045000, 3.1336055533315643e-1, 3.1197277800017686e-1], [1122330766000, 3.130515668461293e-1, 3.12281766487204e-1], [1125075618000, 3.123333333333381e-1, 3.116666666666619e-1], [1127825895000, 3.1236055533315504e-1, 3.1097277800017836e-1], [1130373796000, 3.1171823351279326e-1, 3.109484331538733e-1], [1133196772000, 3.121722038261422e-1, 3.104944628405244e-1], [1135700334000, 3.09333333333334e-1, 3.06666666666666e-1], [1138300151000, 3.13333333333334e-1, 3.10666666666666e-1], [1141006083000, 3.114364670255865e-1, 3.0989686630774677e-1], [1143413954000, 3.021031336922545e-1, 3.005635329744121e-1], [1146065363000, 3.018425084105519e-1, 3.008241582561147e-1], [1148759200000, 3.0468501682110083e-1, 3.0264831651223256e-1], [1151343632000, 3.0133333333333323e-1, 2.9866666666666675e-1], [1153943420000, 3.023094010767592e-1, 2.976905989232408e-1], [1156537602000, 3.034364670255865e-1, 3.0189686630774676e-1], [1159288015000, 2.994364670255865e-1, 2.9789686630774675e-1], [1161784720000, 3.0174586810234516e-1, 2.955874652309881e-1], [1164850603000, 3.0133333333333323e-1, 2.9866666666666675e-1], [1167141464000, 3.114364670255865e-1, 3.0989686630774677e-1], [1169736694000, 3.061031336922545e-1, 3.045635329744121e-1], [1172603022000, 3.1952766841475283e-1, 3.124723315852472e-1], [1174837194000, 3.068729340511724e-1, 3.037937326154942e-1], [1177782478000, 3.194364670255852e-1, 3.178968663077481e-1], [1180224808000, 3.1952766841475283e-1, 3.124723315852472e-1], [1182984249000, 3.1537003364220256e-1, 3.1129663302446403e-1], [1185367173000, 3.101031336922545e-1, 3.085635329744121e-1], [1188169815000, 3.108729340511724e-1, 3.077937326154942e-1], [1190733504000, 3.0737003364220306e-1, 3.032966330244635e-1], [1193344083000, 3.114364670255865e-1, 3.0989686630774677e-1], [1196033635000, 3.1543646702558653e-1, 3.1389686630774677e-1], [1198757549000, 3.047033669755359e-1, 3.006299663577974e-1], [1201469587000, 3.1537003364220256e-1, 3.1129663302446403e-1], [1204033707000, 3.080000020277912e-1, 3.079999979722088e-1], [1208047141000, 3.120000014338649e-1, 3.119999985661351e-1], [1211972404000, 3.127033669755364e-1, 3.086299663577969e-1], [1214766685000, 3.1487293405117306e-1, 3.1179373261549354e-1], [1220231141000, 3.120000014338649e-1, 3.119999985661351e-1], [1222951242000, 2.967033669755364e-1, 2.9262996635779687e-1], [1225400326000, 3.021031336922545e-1, 3.005635329744121e-1], [1228140273000, 3.01333333333334e-1, 2.9866666666666597e-1], [1230726441000, 3.042062673845064e-1, 3.011270659488269e-1], [1233625752000, 2.943094010767592e-1, 2.896905989232408e-1]]]")

;;; Now run:
;;;; ab -c 100 -n 2000 http://localhost:4242/bench/json/dummy
;;;; should result in hilarity.

Annotation number 2: FreeBSD results
Pasted by: H4ns
When:3 years, 1 month ago
Share:Tweet this! | http://paste.lisp.org/+1OF4/2
Paste contents:
Raw Source | Display As
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 200 requests
Completed 400 requests
Completed 600 requests
Completed 800 requests
Completed 1000 requests
Completed 1200 requests
Completed 1400 requests
Completed 1600 requests
Completed 1800 requests
Finished 2000 requests


Server Software:        Hunchentoot
Server Hostname:        localhost
Server Port:            4242

Document Path:          /bench/json/dummy
Document Length:        4260 bytes

Concurrency Level:      100
Time taken for tests:   2.984606 seconds
Complete requests:      2000
Failed requests:        0
Write errors:           0
Total transferred:      8858000 bytes
HTML transferred:       8520000 bytes
Requests per second:    670.11 [#/sec] (mean)
Time per request:       149.230 [ms] (mean)
Time per request:       1.492 [ms] (mean, across all concurrent requests)
Transfer rate:          2898.20 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       2
Processing:     5   11  38.3      8     936
Waiting:        4    9  23.9      7     898
Total:          5   11  38.3      8     936

Percentage of the requests served within a certain time (ms)
  50%      8
  66%      9
  75%      9
  80%      9
  90%     11
  95%     19
  98%     61
  99%     66
 100%    936 (longest request)

Colorize as:
Show Line Numbers
Index of paste annotations: 1 | 2

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.