Opened 5 years ago

Last modified 5 years ago

#1157 new defect


Reported by: avodonosov Owned by:
Priority: minor Milestone:
Component: other Version: 1.9
Keywords: Cc:


I encountered a situation when CCL signals an error:

NO-APPLICABLE-METHOD-EXISTS is signaled: There is no applicable method for the generic function:

Full log:

The error is strange. It happens when loading the cl-l10n library after ASDF upgrade is performed.

The easiest way to reproduce:

  • start ccl 1.9 with quicklisp installed
  • load newer asdf.lisp so that ASDF upgrade is performed (in the attache you can fine ASDF
  • load cl-l10n
    (load "~/asdf/build/asdf.lisp")
    (ql:quickload :cl-l10n)

We did some investigation. Quoting Fare (

That's very weird. The cl-l10n error is in a class unrelated to ASDF. Maybe on CCL the upgrade corrupts the CLOS data structures in a subtle way that somehow only shows up for cl-l10n, but none of the hundreds other systems?

Even weirder: if I try loading cl-l10n *after* I load the :hu.dwim.computed-class+hu.dwim.logger system (but not, say, :fare-utils), it works, though if I try to load it before, it fails. WTF? Maybe CCL fails to finalize-inheritance or some such thing, but something happens in the meantime that causes it to do it?

Attachments (1)

asdf.lisp (523.1 KB) - added by avodonosov 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by avodonosov


comment:1 Changed 5 years ago by gb

  • Component changed from IDE to other

Calling SLOT-VALUE-USING-CLASS with arguments of the wrong type will generally signal a runtime error. The code in question is calling SLOT-VALUE-USING-CLASS with 3 argunents:

b) something that appears to be an instance of that class
c) the integer 0; this is generally not meaningful (the third argument to SLOT-VALUE-USING-CLASS
is typicallly a  SLOT-DEFINITION metaobject.) 

An error is signaled in this case, as it should be.

I have no idea why your code is calling SLOT-VALUE-USING-CLASS with the wrong arguments or why you think that such an apparent bug would be more interesting than it seems to be,

If there's a CCL bug here, I see no evidence to support that.

comment:2 Changed 5 years ago by avodonosov

  • Priority changed from normal to minor

The code is not mine, I noticed this bug while running tests for new ASDF release.

I decided to record this in CCL issue tracker because the code fails or not fails, depending on unrelated libraries being loaded into lisp image. The impression is that CLOS data structures may be corrupted somehow while loading other code. E.g. without ASDF upgrade it doesn't fail. See Fare's comment above for other examples.

I found the relevant source, it just calls SLOT-VALUE, with hardcoded slot name.

The LOOKUP local function:

    (flet ((lookup (type)
             (let ((value (slot-value-unless-nil
                           (flexml:first-child-with-type node type)
               (assert (or (null value)
                           (stringp value)))

And the slot-value-unless-nil macro is defined as

(defmacro slot-value-unless-nil (instance slot-name)
  (once-only (instance)
    `(when ,instance
       (slot-value ,instance ,slot-name))))

As you see, slot name here is 'ldml::type. Looks like CCL's implementation of SLOT-VALUE passes this 0 as the 3-rd parameter for SLOT-VALUE-USING-CLASS.

For me personally this bug is not a problem, it does not affect any of my code. I saw it happening only with one library - cl-l10n.

comment:3 Changed 5 years ago by avodonosov

Also CCL is the only lisp where it happens; this fact also supports the hypothesis that it might be a CCL bug.

Note: See TracTickets for help on using tickets.