You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the IDE in CCL 1.12.2 DarwinX8664, assuming there is some editor window open behind the listener, (describe (gui::target)) consistently throws 'invalid memory operation' . Usually it thows to the Altconsole, from which it is rarely recoverable without restarting CCL.
Narrowing this down a bit: (slot-value (gui::target) 'NS:_SIZE-LIMITS)
consistently throws an error in the Listener.
But that's only one of the problems.
Further clue: (slot-value (gui::target) 'NS:_FRAME) ; doesn't throw an error, but it returns nonsense float values
The following two patches completely fix the error throws:
;;; Pretty sure the standard definition of nsobject-description is causing crashes
(defun ccl::nsobject-description (nsobject)
(if (ccl::initialized-nsobject-p nsobject)
"initialized generic nsobject"
"uninitialized generic nsobject"))
; Without this patch, following form throws an error:
; (slot-value (gui::target) 'NS:_SIZE-LIMITS)
(defmethod print-object ((s ns::ns-size) stream)
(flet ((maybe-round (x)
(multiple-value-bind (q r) (round x)
(if (zerop r) q x))))
(unless nil ; (ccl::%null-ptr-p s)
(print-unreadable-object (s stream :type t :identity t)
(format stream "~s X ~s"
"foo" ;(maybe-round (ns::ns-size-width s)) ; <-- these are the problem
"bar" ;(maybe-round (ns::ns-size-height s))
)))
(ccl::describe-macptr-allocation-and-address s stream)
))
With the above two dummy redefinitions, (describe (gui::target)) does not crash.
But those patches are useless beyond stopping the errors because they fail to return enough information or they return nonsense.
I need help tracking this down. Obviously I'd like to fix the above issues, but there's also a systemic problem that has crept in some time over the last few versions of MacOS that's causing our assumptions about how to inspect ObjC objects to fail. I'd like to fix the systemic issue.
The text was updated successfully, but these errors were encountered:
/***********************************************************************
* Tagged pointer objects.
*
* Tagged pointer objects store the class and the object value in the
* object pointer; the "pointer" does not actually point to anything.
*
* Tagged pointer objects currently use this representation:
* (LSB)
* 1 bit set if tagged, clear if ordinary object pointer
* 3 bits tag index
* 60 bits payload
* (MSB)
* The tag index defines the object's class.
* The payload format is defined by the object's class.
*
* If the tag index is 0b111, the tagged pointer object uses an
* "extended" representation, allowing more classes but with smaller payloads:
* (LSB)
* 1 bit set if tagged, clear if ordinary object pointer
* 3 bits 0b111
* 8 bits extended tag index
* 52 bits payload
* (MSB)
*
* Some architectures reverse the MSB and LSB in these representations.
*
* This representation is subject to change. Representation-agnostic SPI is:
* objc-internal.h for class implementers.
* objc-gdb.h for debuggers.
**********************************************************************/
I wonder if we need to deal with that case. (I haven't actually looked; I'm just noting that here in this issue in the hopes that I or someone can look at it later.)
If we could somehow manage to stick to the published Objective-C runtime API (e.g., object_getClassName), that would be great, because they already deal with the tagged pointer case
In the IDE in CCL 1.12.2 DarwinX8664, assuming there is some editor window open behind the listener,
(describe (gui::target))
consistently throws 'invalid memory operation' . Usually it thows to the Altconsole, from which it is rarely recoverable without restarting CCL.Narrowing this down a bit:
(slot-value (gui::target) 'NS:_SIZE-LIMITS)
consistently throws an error in the Listener.
But that's only one of the problems.
Further clue:
(slot-value (gui::target) 'NS:_FRAME) ; doesn't throw an error, but it returns nonsense float values
The following two patches completely fix the error throws:
With the above two dummy redefinitions,
(describe (gui::target))
does not crash.But those patches are useless beyond stopping the errors because they fail to return enough information or they return nonsense.
I need help tracking this down. Obviously I'd like to fix the above issues, but there's also a systemic problem that has crept in some time over the last few versions of MacOS that's causing our assumptions about how to inspect ObjC objects to fail. I'd like to fix the systemic issue.
The text was updated successfully, but these errors were encountered: