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

Quickloading :mgl-pax/document generates error #1649

Open
drmeister opened this issue Nov 9, 2024 · 3 comments
Open

Quickloading :mgl-pax/document generates error #1649

drmeister opened this issue Nov 9, 2024 · 3 comments
Labels

Comments

@drmeister
Copy link
Collaborator

Describe the bug
Quickloading :mgl-pax/document generates a compile time error

Expected behavior
The system should load

Actual behavior
Compilation of the system fails with the error

Condition of type: UNDEFINED-FUNCTION
The function MGL-PAX::PRINT-UNRESOLVABLE-REFLINK is undefined.
Available restarts:
(use :r1 to invoke restart 1, etc.)

Code at issue

(ql:quickload :mgl-pax/document)

I can "fix" the problem by editing the mgl-pax/src/document/document.lisp file and move
the (defun print-unresolvable-reflink ... before the (define-condition unresolvable-reflink (warning)

This problem doesn't happen with ECL or SBCL.

Context

@drmeister drmeister added the bug label Nov 9, 2024
@drmeister
Copy link
Collaborator Author

Here is a complete sldb backtrace...

The function MGL-PAX::PRINT-UNRESOLVABLE-REFLINK is undefined.
   [Condition of type UNDEFINED-FUNCTION]

Restarts:
 0: [TRY-RECOMPILING] Recompile document and try loading it again
 1: [RETRY] Retry loading FASL for #<CL-SOURCE-FILE "mgl-pax/document" "src/document/" "document">.
 2: [ACCEPT] Continue, treating loading FASL for #<CL-SOURCE-FILE "mgl-pax/document" "src/document/" "document"> as having been successful.
 3: [RETRY] Retry ASDF operation.
 4: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
 5: [ABORT] Give up on "mgl-pax/document"
 --more--

Backtrace:
  0: ERROR
  1: :BYTECODE
  2: (CLOS::FREEZE-CLASS-SLOT-INITFUNCTION (:NAME CORE::REPORTER :INITFUNCTION #<CORE::BYTECODE-SIMPLE-FUN (LAMBDA NIL)> :INITFORM #'MGL-PAX::PRINT-UNRESOLVABLE-REFLINK ...))
      Locals:
        CLOS::SLOTD = (:NAME CORE::REPORTER :INITFUNCTION #<CORE::BYTECODE-SIMPLE-FUN (LAMBDA NIL)> :INITFORM #'MGL-PAX::PRINT-UNRESOLVABLE-REFLINK ...)
  3: (CLOS::CANONICAL-SLOT-TO-DIRECT-SLOT #<error printing #<STANDARD-CLASS STANDARD-CLASS> (:NAME CORE::REPORTER :INITFUNCTION #<CORE::BYTECODE-SIMPLE-FUN (LAMBDA NIL)> :INITFORM #'MGL-PAX::PRINT-UNRESOLV..
  4: ((LAMBDA (CLASS CLOS::SLOT-NAMES &REST CLOS::INITARGS &KEY :DIRECT-SUPERCLASSES ...)) #<error printing #<STANDARD-CLASS STANDARD-CLASS> T :NAME MGL-PAX:UNRESOLVABLE-REFLINK :DIRECT-SUPERCLASSES (#<STA..
  5: ((METHOD SHARED-INITIALIZE (CLASS T)) #<CORE::SIMPLE-CORE-FUN (METHOD SHARED-INITIALIZE (T T))> #<error printing #<STANDARD-CLASS STANDARD-CLASS> T :NAME MGL-PAX:UNRESOLVABLE-REFLINK :DIRECT-SUPERCLAS..
  6: ((LAMBDA (#:REQ-ARG81633 #:REQ-ARG81634 &REST CLOS::SATIATED-MORE)) #<error printing #<STANDARD-CLASS STANDARD-CLASS> T :NAME MGL-PAX:UNRESOLVABLE-REFLINK :DIRECT-SUPERCLASSES (#<STANDARD-CLASS WARNIN..
  7: ((METHOD INITIALIZE-INSTANCE (T)) #<error printing #<STANDARD-CLASS STANDARD-CLASS> :NAME MGL-PAX:UNRESOLVABLE-REFLINK :DIRECT-SUPERCLASSES (#<STANDARD-CLASS WARNING>) :DIRECT-SLOTS ((:NAME CORE::REPO..
  8: ((LAMBDA (#:REQ-ARG81566 &REST CLOS::SATIATED-MORE)) #<error printing #<STANDARD-CLASS STANDARD-CLASS> :NAME MGL-PAX:UNRESOLVABLE-REFLINK :DIRECT-SUPERCLASSES (#<STANDARD-CLASS WARNING>) :DIRECT-SLOTS..
  9: ((METHOD MAKE-INSTANCE (CLASS)) #<STANDARD-CLASS STANDARD-CLASS> :NAME MGL-PAX:UNRESOLVABLE-REFLINK :DIRECT-SUPERCLASSES (#<STANDARD-CLASS WARNING>) :DIRECT-SLOTS ((:NAME CORE::REPORTER :INITFUNCTION ..
 10: (MAKE-INSTANCE #<STANDARD-CLASS STANDARD-CLASS> :NAME MGL-PAX:UNRESOLVABLE-REFLINK :DIRECT-SUPERCLASSES (#<STANDARD-CLASS WARNING>) :DIRECT-SLOTS ((:NAME CORE::REPORTER :INITFUNCTION #<CORE::BYTECODE-..
 11: (LAMBDA (&OPTIONAL CLOS::METACLASS CLOS:DIRECT-SUPERCLASSES CLOS::OPTIONS &REST #:G74991))
 12: ((METHOD CLOS:ENSURE-CLASS-USING-CLASS (NULL T)) NIL MGL-PAX:UNRESOLVABLE-REFLINK :DIRECT-SUPERCLASSES (WARNING) :DIRECT-SLOTS ((:NAME CORE::REPORTER :INITFUNCTION #<CORE::BYTECODE-SIMPLE-FUN (LAMBDA ..
 13: (CLOS:ENSURE-CLASS MGL-PAX:UNRESOLVABLE-REFLINK :DIRECT-SUPERCLASSES (WARNING) :DIRECT-SLOTS ((:NAME CORE::REPORTER :INITFUNCTION #<CORE::BYTECODE-SIMPLE-FUN (LAMBDA NIL)> :INITFORM #'MGL-PAX::PRINT-U..
 14: (CLOS:LOAD-DEFCLASS MGL-PAX:UNRESOLVABLE-REFLINK (WARNING) ((:NAME CORE::REPORTER :INITFUNCTION #<CORE::BYTECODE-SIMPLE-FUN (LAMBDA NIL)> :INITFORM #'MGL-PAX::PRINT-UNRESOLVABLE-REFLINK ...) ..) (:DOC..
 15: LOAD
 16: ((LAMBDA ()))
 17: (UIOP/UTILITY:CALL-WITH-MUFFLED-CONDITIONS #<CORE::CLOSURE (LAMBDA NIL)> ("Overwriting already existing readtable ~S." #(#:FINALIZERS-OFF-WARNING :ASDF-FINALIZERS)))
 18: (UIOP/LISP-BUILD:CALL-WITH-MUFFLED-LOADER-CONDITIONS #<CORE::CLOSURE (LAMBDA NIL)>)
 19: (UIOP/LISP-BUILD:LOAD* #P"/home/meister/.cache/common-lisp/clasp-eclasp-boehmprecise-2.6.0-230-g4e3ceeab6-g1d7bd4fa-cst-linux-x64/home/meister/Development/cando/src/lisp/kernel/contrib/mgl-pax/src/doc..
 --more--

@drmeister
Copy link
Collaborator Author

It is here that it tries to call the function before it is defined...

https://github.com/clasp-developers/clasp/blob/main/src/lisp/kernel/clos/slot.lisp#L68

@drmeister
Copy link
Collaborator Author

A simple demonstrator...

% cat test.lisp 
(in-package #:cl-user)
(defpackage #:some-test
  (:use #:cl))
(in-package #:some-test)
(define-condition some-condition (error)
  ((message :initarg :message :reader some-condition-message))
  (:report some-function))
(defun some-function (condition stream)
  (format stream "~a~%" (some-condition-message condition)))
(error (make-condition 'some-condition :message "Test!"))


# Expected behavior?
% sbcl --script test.lisp              
Unhandled SOME-CONDITION in thread #<SB-THREAD:THREAD tid=2112264 "main thread" RUNNING
                                      {1000B98003}>:     
  Test!        


user@92dbe3b21e1a:~/clasp/src/lisp/modules/docs$ clasp --load test.lisp 
Starting clasp-boehmprecise-2.6.0-231-ge3287eda5 from base image
Loading resource file /home/user/.clasprc

Condition of type: UNDEFINED-FUNCTION
The function SOME-TEST::SOME-FUNCTION is undefined.
No restarts available.

Top level in: #<PROCESS CORE::TOP-LEVEL @0x7fafa70d0f09 (Running)>.
COMMON-LISP-USER>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant