Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Failure on MacBook M2 & SBLC 2.5.0 #4

Open
mirkov opened this issue Dec 31, 2024 · 0 comments
Open

Test Failure on MacBook M2 & SBLC 2.5.0 #4

mirkov opened this issue Dec 31, 2024 · 0 comments

Comments

@mirkov
Copy link

mirkov commented Dec 31, 2024

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--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant