Closed autrimpo closed 1 year ago
Hi autrimpo - this is a bug in Woo caused by using mutation functions on a string literal. I was able to fix it with a patch: you can test by running nix run github:uthar/woo-repro?rev=1be6991d8198efa5cf1384f2fbf6649a4dc04ec4
.
It also happens using regular sbcl with quicklisp. So I submitted a patch to upstream: https://github.com/fukamachi/woo/pull/106
Thank you for the new Lisp infrastructure, it's much more pleasant to work with!
I'm glad you're enjoying it :-)
Awesome, thank you for the patch :)
Describe the bug
Lisp packages using Woo seem unable to be compiled into a binary.
I began working on a small project today which uses Clack with Woo. When running the program in Sly REPL, everything worked fine. Once I attempted to make a Nix package to deploy, every HTTP request would segfault the program. I managed to track down the issue to
woo.response::current-rfc-1123-timestamp
- my Lisp skills are not good enough to determine whether this is a Nix issue, SBCL issue or Woo issue, but since it works in the REPL, I'm assuming the first case.The binary packaging was taken from the Lem flake.
Steps To Reproduce
Steps to reproduce the behavior:
nix run
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT] Exit from the current thread.
(WOO.RESPONSE::CURRENT-RFC-1123-TIMESTAMP) source: (DEFUN CURRENT-RFC-1123-TIMESTAMP () (DECLARE (OPTIMIZE (SPEED 3) (SAFETY 0))) (MACROLET ((WRITE-DATE (VAL START &OPTIONAL (LEN ')) `(REPLACE DATE-HEADER* (THE # ,VAL) :START1 ,START)) (WRITE-CHAR-TO-DATE (CHAR IDX)
(SETF # ,CHAR)) (WRITE-INT-TO-DATE (VAL START) (CHECK-TYPE START INTEGER)
(IF (< ,VAL 10) (PROGN # #) (MULTIPLE-VALUE-BIND # # # #)))) (MULTIPLE-VALUE-BIND (SEC MINUTE HOUR DAY MONTH YEAR WEEKDAY) (DECODE-UNIVERSAL-TIME (GET-UNIVERSAL-TIME) 0) (DECLARE (TYPE FIXNUM SEC MINUTE HOUR DAY MONTH YEAR WEEKDAY)) (WRITE-DATE (SVREF #("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun") WEEKDAY) 0 3) (WRITE-INT-TO-DATE DAY 5) (WRITE-DATE (SVREF("" "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep"
0]
CL-USER> (woo-repro:main) "Mon, 28 Aug 2023 17:43:12 GMT" CL-USER>