(subtypep '(cons (or (simple-array ratio) simple-array) nil) nil)
==>
failed AVER: (NOT (EQ SB-KERNEL::TYPE2 SB-KERNEL:*WILD-TYPE*))
This is probably a bug in SBCL itself. (Alternatively, SBCL
might have been corrupted by bad user code, e.g. by an undefined
Lisp operation like (FMAKUNBOUND 'COMPILE), or by stray pointers
from alien code or from unsafe Lisp code; or there might be a
bug in the OS or hardware that SBCL is running on.) If it seems
to be a bug in SBCL itself, the maintainers would like to know
about it. Bug reports are welcome on the SBCL mailing lists,
which you can find at <http://sbcl.sourceforge.net/>.
[Condition of type SB-INT:BUG]
Restarts:
0: [RETRY] Retry SLIME REPL evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [REMOVE-FD-HANDLER] Remove #<SB-IMPL::HANDLER INPUT on descriptor 4: #<FUNCTION (LABELS SWANK/SBCL::RUN :IN SWANK/BACKEND:ADD-FD-HANDLER) {104571A4DB}>>
3: [ABORT] Exit debugger, returning to top level.
Backtrace:
0: (SB-KERNEL::NAMED-COMPLEX-SUBTYPEP-ARG2-TYPE-METHOD #<SB-KERNEL:NUMERIC-TYPE RATIONAL> #<SB-KERNEL:NAMED-TYPE *>)
1: (SB-KERNEL:CSUBTYPEP #<SB-KERNEL:NUMERIC-TYPE RATIONAL> #<SB-KERNEL:NAMED-TYPE *>)
2: (SB-KERNEL::HIERARCHICAL-INTERSECTION2 #<SB-KERNEL:NUMERIC-TYPE RATIONAL> #<SB-KERNEL:NAMED-TYPE *>)
3: (SB-KERNEL::%TYPE-INTERSECTION2 #<SB-KERNEL:NAMED-TYPE *> #<SB-KERNEL:NUMERIC-TYPE RATIONAL>)
4: (SB-KERNEL:TYPE-INTERSECTION2 #<SB-KERNEL:NAMED-TYPE *> #<SB-KERNEL:NUMERIC-TYPE RATIONAL>)
5: (SB-KERNEL::INTERSECTION-COMPLEX-=-TYPE-METHOD #<SB-KERNEL:NAMED-TYPE *> #<SB-KERNEL:INTERSECTION-TYPE RATIO>)
6: (SB-KERNEL::INVOKE-COMPLEX-=-OTHER-METHOD #<SB-KERNEL:INTERSECTION-TYPE RATIO> #<SB-KERNEL:NAMED-TYPE *>)
7: (SB-KERNEL:TYPE= #<SB-KERNEL:INTERSECTION-TYPE RATIO> #<SB-KERNEL:NAMED-TYPE *>)
8: (SB-KERNEL::UNITE-ARRAY-TYPES-ELEMENT-TYPES #<SB-KERNEL:ARRAY-TYPE (SIMPLE-ARRAY RATIO)> #<SB-KERNEL:ARRAY-TYPE SIMPLE-ARRAY>)
9: (SB-KERNEL::ARRAY-SIMPLE-UNION2-TYPE-METHOD #<SB-KERNEL:ARRAY-TYPE (SIMPLE-ARRAY RATIO)> #<SB-KERNEL:ARRAY-TYPE SIMPLE-ARRAY>)
10: (SB-KERNEL::%TYPE-UNION2 #<SB-KERNEL:ARRAY-TYPE (SIMPLE-ARRAY RATIO)> #<SB-KERNEL:ARRAY-TYPE SIMPLE-ARRAY>)
11: (SB-KERNEL::TYPE-UNION2 #<SB-KERNEL:ARRAY-TYPE (SIMPLE-ARRAY RATIO)> #<SB-KERNEL:ARRAY-TYPE SIMPLE-ARRAY>)
12: (SB-KERNEL::SIMPLIFY-UNIONS (#<SB-KERNEL:ARRAY-TYPE (SIMPLE-ARRAY RATIO)> #<SB-KERNEL:ARRAY-TYPE SIMPLE-ARRAY>))
13: (SB-KERNEL::%TYPE-UNION (#<SB-KERNEL:ARRAY-TYPE (SIMPLE-ARRAY RATIO)> #<SB-KERNEL:ARRAY-TYPE SIMPLE-ARRAY>))
14: (SB-KERNEL::PARSE-<OR> #S(SB-KERNEL::TYPE-CONTEXT :SPEC (CONS (OR # SIMPLE-ARRAY) NIL) :PROTO-CLASSOID NIL :CACHEABLE T) (OR (SIMPLE-ARRAY RATIO) SIMPLE-ARRAY))
15: (SB-KERNEL::%PARSE-TYPE (OR (SIMPLE-ARRAY RATIO) SIMPLE-ARRAY) #S(SB-KERNEL::TYPE-CONTEXT :SPEC (CONS (OR # SIMPLE-ARRAY) NIL) :PROTO-CLASSOID NIL :CACHEABLE T))
16: (SB-KERNEL::BASIC-PARSE-TYPESPEC (OR (SIMPLE-ARRAY RATIO) SIMPLE-ARRAY) #S(SB-KERNEL::TYPE-CONTEXT :SPEC (CONS (OR # SIMPLE-ARRAY) NIL) :PROTO-CLASSOID NIL :CACHEABLE T))
17: (SB-KERNEL:SPECIFIER-TYPE (OR (SIMPLE-ARRAY RATIO) SIMPLE-ARRAY) #S(SB-KERNEL::TYPE-CONTEXT :SPEC (CONS (OR # SIMPLE-ARRAY) NIL) :PROTO-CLASSOID NIL :CACHEABLE T) NIL)
18: (SB-KERNEL::PARSE-<CONS> #S(SB-KERNEL::TYPE-CONTEXT :SPEC (CONS (OR # SIMPLE-ARRAY) NIL) :PROTO-CLASSOID NIL :CACHEABLE T) (CONS (OR (SIMPLE-ARRAY RATIO) SIMPLE-ARRAY) NIL))
19: (SB-KERNEL::%PARSE-TYPE (CONS (OR (SIMPLE-ARRAY RATIO) SIMPLE-ARRAY) NIL) #S(SB-KERNEL::TYPE-CONTEXT :SPEC (CONS (OR # SIMPLE-ARRAY) NIL) :PROTO-CLASSOID NIL :CACHEABLE T))
20: (SB-KERNEL::BASIC-PARSE-TYPESPEC (CONS (OR (SIMPLE-ARRAY RATIO) SIMPLE-ARRAY) NIL) #S(SB-KERNEL::TYPE-CONTEXT :SPEC (CONS (OR # SIMPLE-ARRAY) NIL) :PROTO-CLASSOID NIL :CACHEABLE T))
21: (SB-KERNEL:SPECIFIER-TYPE (CONS (OR (SIMPLE-ARRAY RATIO) SIMPLE-ARRAY) NIL) NIL NIL)
22: (SUBTYPEP (CONS (OR (SIMPLE-ARRAY RATIO) SIMPLE-ARRAY) NIL) NIL #<unused argument>)
This bug was found by a property based tester of subtypep in ansi-test. To run this:
1) Get ansi-test from https:/ /github. com/pfdietz/ ansi-test
2) In the root directory of that checked out repo, start sbcl and load enough of the tests:
(load "run.lsp") types-aux. lsp") random- aux.lsp" ) random- types.lsp" )
(load "auxilliary/
(load "auxilliary/
(load "random/
3) In the package CL-TEST, execute test-mutated-types
(in-package :cl-test) mutated- types 10000 10 :reps 2)
(test-
If the result is nonempty, it will be a list of type pairs on which a property failed.
Simplify the pairs
(mapcar #'prune-type-pair *)
4) Additional testing can be done with test-types and test-type-triples. The latter has its own pruner, prune-type-triple.
5) If you run this long enough sbcl bogs down, probably because some internal cache of types has filled up. There should be some way of flushing this cache, or it should be flushed automatically when it gets too full.