"Argument list has holes" error after CASE change

Bug #2060059 reported by Yan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Committed
Undecided
Unassigned

Bug Description

Building "varjo" fails with
"The argument list (_ _) has holes. This is considered a malformed arg list"

since
sbcl-2.4.2-59-g04b9a5d97
"Make CASE expansion more human-readable"

at least until
sbcl-2.4.3-70-g5491a4948

To reproduce:
(ql:quickload :varjo)

End of bisect:
--------------------------------------------------------------------------------
; compiling file "/cl/quicklisp/dists/quicklisp/software/varjo-release-quicklisp-92f9c75b-git/src/varjo.internals/types/types.lisp" (written 16 OCT 2023 12:28:51 AM):

; file: /cl/quicklisp/dists/quicklisp/software/varjo-release-quicklisp-92f9c75b-git/src/varjo.internals/types/types.lisp
; in: DEFUN MAKE-INTO-BLOCK-STRUCT
; 'VARI.TYPES:V-STRUCT
;
; note: can't open-code test of unknown type V-STRUCT

;
; caught ERROR:
; READ error during COMPILE-FILE:
;
; The argument list (_ _) has holes. This is considered a malformed arg list
;
; (in form starting at line: 887, column: 0, position: 32475)

; compilation aborted after 0:00:00.315
Unhandled UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread #<SB-THREAD:THREAD tid=5444 "main thread" RUNNING
                                                          {1001638093}>:
  COMPILE-FILE-ERROR while
  compiling #<CL-SOURCE-FILE "varjo" "src/varjo.internals/types/types">

Backtrace for: #<SB-THREAD:THREAD tid=5444 "main thread" RUNNING {1001638093}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {1003EA2A83}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {1003EA2A83}>)
2: (INVOKE-DEBUGGER #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {1003EA2A83}>)
3: (ERROR UIOP/LISP-BUILD:COMPILE-FILE-ERROR :CONTEXT-FORMAT "~/asdf-action::format-action/" :CONTEXT-ARGUMENTS ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "varjo" "src/varjo.internals/types/types">)))
4: (UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T "~/asdf-action::format-action/" ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "varjo" "src/varjo.internals/types/types">)))
5: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "varjo" "src/varjo.internals/types/types">)
6: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
7: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "varjo" "src/varjo.internals/types/types">) [fast-method]
8: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {100417F2D3}>) [fast-method]
9: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
10: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {100417F2D3}>) [fast-method]
11: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "varjo"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
12: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "varjo"> :VERBOSE T :FORCE T)
13: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
14: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "varjo"> :VERBOSE T :FORCE T) [fast-method]
15: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:LOAD-OP "varjo" :VERBOSE T :FORCE T)
16: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
17: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "varjo" :VERBOSE T :FORCE T) [fast-method]
18: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10040F1D0B}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
19: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
20: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {1003EF153B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
21: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "varjo" :VERBOSE T :FORCE T) [fast-method]
22: (ASDF/OPERATE:LOAD-SYSTEM "varjo" :VERBOSE T :FORCE T)
23: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ASDF/OPERATE:LOAD-SYSTEM "varjo" :VERBOSE T :FORCE T) #<NULL-LEXENV>)
24: (EVAL (ASDF/OPERATE:LOAD-SYSTEM "varjo" :VERBOSE T :FORCE T))
25: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:LOAD . "/cl/quicklisp/setup.lisp") (:EVAL . "(asdf:load-system \"varjo\" :verbose t :force t)") (:EVAL . "(quit)")))
26: (SB-IMPL::TOPLEVEL-INIT)
27: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
28: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-IMPL::START-LISP))
29: (SB-IMPL::%START-LISP)

unhandled condition in --disable-debugger mode, quitting
;
; compilation unit aborted
; caught 2 fatal ERROR conditions
; caught 1 ERROR condition
; caught 6 STYLE-WARNING conditions
; printed 653 notes
Updated 0 paths from the index
04b9a5d9738142544b886675436e25db1707a5e9 is the first bad commit
commit 04b9a5d9738142544b886675436e25db1707a5e9
Author: Douglas Katzman <email address hidden>
Date: Mon Mar 4 10:55:25 2024 -0500

    Make CASE expansion more human-readable

    Try to avoid unnecessary QUOTE and OR forms and a random gensym.

 src/code/macros.lisp | 26 +++++++++++++++-----------
 xperfecthash63.lisp-expr | 3 +++
 2 files changed, 18 insertions(+), 11 deletions(-)

--------------------------------------------------------------------------------
Tested on both Linux and macOS:

Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jun 21 21:18:39 PDT 2022; root:xnu-6153.141.66~1/RELEASE_X86_64 x86_64

Linux 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64 GNU/Linux

(CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:X86-64 CFFI-FEATURES:UNIX :CFFI
 CFFI-SYS::FLAT-NAMESPACE ALEXANDRIA::SEQUENCE-EMPTYP :QUICKLISP :ASDF3.3
 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX :NON-BASE-CHARS-EXIST-P
 :ASDF-UNICODE :ARENA-ALLOCATOR :X86-64 :GENCGC :64-BIT :ANSI-CL :COMMON-LISP
 :ELF :IEEE-FLOATING-POINT :LINUX :LITTLE-ENDIAN :PACKAGE-LOCAL-NICKNAMES
 :SB-LDB :SB-PACKAGE-LOCKS :SB-THREAD :SB-UNICODE :SBCL :UNIX)

--------------------------------------------------------------------------------
bisect script:
-----
git clean -dxf
./make.sh
./run-sbcl.sh --no-sysinit --no-userinit --disable-debugger \
              --load /cl/quicklisp/setup.lisp \
              --eval '(asdf:load-system "varjo" :verbose t :force t)' \
              --eval '(quit)'
result=$?
git checkout .
exit $result
-----

Revision history for this message
Yan (metayan) wrote :

By the way, it compiles on CCL and ABCL.
And SBCL before sbcl-2.4.2-59-g04b9a5d97

Revision history for this message
Douglas Katzman (dougk) wrote :

the error is signaled by https://github.com/cbaggers/fn/blob/master/fn.lisp#L42

Unless you can point to a specific problem with how CASE expands, the bug needs to opened with the maintainer of 'fn'

Revision history for this message
Douglas Katzman (dougk) wrote :

I looked at this a tiny bit to make sure that I'm not incorrectly placing blame on 'fn', and my gut reaction was right: it is 'fn' and not either 'varjo' or SBCL doing something wrong.

And I'll say right off the bat that I'm not a fan of using these ultra-terse helper things.
Despite that, I made a small edit in 'fn' to ascertain that it's failing to accept valid inputs.

137c137,143
< (fn*-internals body nil)))
---
> (handler-case (fn*-internals body nil)
> (:no-error (x)
> (let ((*print-pretty* nil))
> (format t "~&OK expansion: ~S -> ~% ~S~%" body x)))
> (condition (c)
> (error "Failed to expand ~S~%[~a]"
> body c)))))

and then quickload prints as shown:
OK expansion: (OR (NULL _) (GLSL-CHUNK-P _)) ->
 (LAMBDA (_) (OR (NULL _) (GLSL-CHUNK-P _)))
OK expansion: (TYPEP _ (QUOTE COMPILED)) ->
 (LAMBDA (_) (TYPEP _ (QUOTE COMPILED)))
...
OK expansion: (SLOT-VALUE _ (QUOTE VAL)) ->
 (LAMBDA (_) (SLOT-VALUE _ (QUOTE VAL)))
OK expansion: (SLOT-VALUE _ (QUOTE VAL)) ->
 (LAMBDA (_) (SLOT-VALUE _ (QUOTE VAL)))
.
OK expansion: (SLOT-VALUE _ (QUOTE VAL)) ->
 (LAMBDA (_) (SLOT-VALUE _ (QUOTE VAL)))
..
OK expansion: (TYPEP _ (QUOTE V-DISCARDED)) ->
 (LAMBDA (_) (TYPEP _ (QUOTE V-DISCARDED)))
OK expansion: (TYPEP _ (QUOTE V-RETURNED)) ->
 (LAMBDA (_) (TYPEP _ (QUOTE V-RETURNED)))
.
OK expansion: (IF (EQ _ (QUOTE *)) "" _) ->
 (LAMBDA (_) (IF (EQ _ (QUOTE *)) "" _))
..
OK expansion: (OR (V-DISCARDED-P _) (V-RETURNED-P _)) ->
 (LAMBDA (_) (OR (V-DISCARDED-P _) (V-RETURNED-P _)))
...
OK expansion: (TYPEP _ (QUOTE V-TYPE)) ->
 (LAMBDA (_) (TYPEP _ (QUOTE V-TYPE)))
OK expansion: (V-TYPE-EQ _ (FIRST TYPES)) ->
 (LAMBDA (_) (V-TYPE-EQ _ (FIRST TYPES)))
OK expansion: (FIND TYPE _ :TEST (FUNCTION V-TYPE-EQ)) ->
 (LAMBDA (_) (FIND TYPE _ :TEST (FUNCTION V-TYPE-EQ)))
.;
; caught ERROR:
; READ error during COMPILE-FILE:
;
; Failed to expand (TYPECASE _
; (LIST _)
; (VECTOR (COERCE _ 'LIST))
; (OTHERWISE (LIST _)))
; [The argument list (_ _) has holes. This is considered a malformed arg list]

I don't know why 'fn' doesn't think this TYPECASE is valid for its particular brand of elliptical syntax

Changed in sbcl:
status: New → Won't Fix
Revision history for this message
Douglas Katzman (dougk) wrote :

ok fixed in https://sourceforge.net/p/sbcl/sbcl/ci/78db7e42b6ab despite not being an SBCL bug

Changed in sbcl:
status: Won't Fix → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.