Skip to content

Test Failure on MacBook M2 & SBLC 2.5.0 #4

@mirkov

Description

@mirkov

Hello,

After loading binary-types, three test fail. Here I will report the failure and what I learned from a bit of digging. My knowledge of SB internals is non-existent and I was unable to figure out the root cause. I could even be doing something incorrect here.

I will try this library on X86/Linux over next week.

Here is the test report and a bit of stack tracing that I did:

CLunit2 error output

CL-USER> (asdf:test-system "binary-types" :verbose t)

PROGRESS:
=========

    BINARY-TYPES: (Test Suite)
        COMPOSITE: E
        ARRAYS: E
        VECTORS: E

FAILURE DETAILS:
================

    BINARY-TYPES: (Test Suite)
        VECTORS: Value of SB-VM::NEW-VALUE in
(THE* (NIL CONTEXT AREF-CONTEXT) NEW-VALUE)
is
  1,
not a
  NIL.

        ARRAYS: Value of SB-VM::NEW-VALUE in
(THE* (NIL CONTEXT AREF-CONTEXT) NEW-VALUE)
is
  1,
not a
  NIL.

        COMPOSITE: Value of SB-VM::NEW-VALUE in
(THE* (NIL CONTEXT AREF-CONTEXT) NEW-VALUE)
is
  #(0.9143338203430176d0 0.21972346305847168d0 0.9707512855529785d0
    0.5962116718292236d0 0.6005609035491943d0 0.5940588712692261d0
    0.2837725877761841d0 0.009566903114318848d0 0.8435225486755371d0
    0.22492897510528564d0),

not a
  NIL.


SUMMARY:
========
    Test functions:
        Executed: 3
        Skipped:  0

    Tested 3 assertions.
        Errors: 3/3 all tests had errors
T

Experimenting at the REPL

At the REPL I executed the body of one unit test in package binary-types/tests

(let* ((binary-types:*endian* :little-endian)
	     (test-vector #(1 2 3 4 10 9 8 7))
	     binary-to                        ;write lisp vector INTO this variable
	     binary-from)                     ;read lisp vector OUT of this variable

  (eval `(define-binary-vector binary-seq u32 ,(length test-vector)))
  (setf binary-to (with-output-to-sequence (out)
		                (write-binary 'binary-seq out test-vector)))
  (setf binary-from (with-input-from-sequence (in binary-to)
		                  (read-binary 'binary-seq in)))
  (assert-true (num= test-vector binary-from)))

This dropped me into the debugger - I expanded the stack level one:

Value of SB-VM::NEW-VALUE in NEW-VALUE is 1, not a NIL.
   [Condition of type SIMPLE-TYPE-ERROR]

Restarts:
 0: [RETRY] Retry SLY mREPL evaluation request.
 1: [*ABORT] Return to SLY's top level.
 2: [ABORT] abort thread (#<THREAD tid=4867 "sly-channel-1-mrepl-remote-1" RUNNING {7005AA0623}>)

Backtrace:
 0: ((SB-VM::OPTIMIZED-DATA-VECTOR-SET NIL) #<unavailable argument> #<unavailable argument> #<unavailable argument>)
 1: (BINARY-TYPES::READ-BINARY-VECTOR #<FLEXI-STREAMS::VECTOR-INPUT-STREAM {7008CEEA93}> U32 8)
      Locals:
        BYTES = 4
        I = 0
        READ-BYTES = 0
        SIZE = 8
        STREAM = #<FLEXI-STREAMS::VECTOR-INPUT-STREAM {7008CEEA93}>
        TYPE = U32
        VEC = #<(SIMPLE-ARRAY NIL (8)) {7008DBDB2F}>
 2: ((LAMBDA ()))
 3: (SB-INT:SIMPLE-EVAL-IN-LEXENV (LET* ((*ENDIAN* :LITTLE-ENDIAN) (TEST-VECTOR #) BINARY-TO BINARY-FROM) (EVAL (SB-INT:QUASIQUOTE #)) (SETF BINARY-TO (WITH-OUTPUT-TO-SEQUENCE # #)) (SETF BINARY-FROM (WIT..
 4: (EVAL (LET* ((*ENDIAN* :LITTLE-ENDIAN) (TEST-VECTOR #) BINARY-TO BINARY-FROM) (EVAL (SB-INT:QUASIQUOTE #)) (SETF BINARY-TO (WITH-OUTPUT-TO-SEQUENCE # #)) (SETF BINARY-FROM (WITH-INPUT-FROM-SEQUENCE # ..
 5: ((LAMBDA NIL :IN SLYNK-MREPL::MREPL-EVAL-1))
 --more--

I proceeded to examine the value of vec and encountered the SB-Kernel message that I don't understand

An attempt to access an array of element-type NIL was made.  Congratulations!
   [Condition of type SB-KERNEL:NIL-ARRAY-ACCESSED-ERROR]

Restarts:
 0: [ABORT] Return to sly-db level 1.
 1: [RETRY] Retry SLY mREPL evaluation request.
 2: [*ABORT] Return to SLY's top level.
 3: [ABORT] abort thread (#<THREAD tid=4867 "sly-channel-1-mrepl-remote-1" RUNNING {7005AA0623}>)

Backtrace:
 0: ((SB-VM::OPTIMIZED-DATA-VECTOR-REF NIL) #<unavailable argument> #<unavailable argument>)
 1: ((LABELS SLYNK::K :IN SLYNK-BACKEND:EMACS-INSPECT) 0 8)
 --more--

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions