Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#1333 closed defect (fixed)

stack overflow when inspecting circular data with Mac IDE

Reported by: brooks Owned by:
Priority: normal Milestone:
Component: IDE Version: 1.11
Keywords: inspector crash Cc:

Description

Hello CCL

First I want to thank you for your excellent Lisp. This ticket applies to the Mac IDE for 1.11-r16651 (DarwinX8664).

Having looked at the code for printing, I realize that there are some structural issues that make it more difficult to detect circularity when inspecting. However:

Inspecting a circular list works fine, but if the circles are within structs, CLOS objects, etc., then the inspector generates a stack overflow, and no recovery is possible.

I know you are busy, and perhaps the Mac IDE is not a priority. I have seen that there are efforts underway to build an IDE from Atom. I understand this.

So, if you plan to fix this inspection crash problem for the Mac IDE, I will be glad to wait. But if you are not planning to fix it, then please let me know {brooks.martin@ sympatico.ca} and I will become very motivated to find another way to work with CCL.

thanks, Martin

Change History (5)

comment:1 follow-up: Changed 6 years ago by rme

Any chance you can provide a test case, with steps to reproduce?

Something like this, for example (where you would provide a definition of MAKE-THING-WITH-CIRCULARITY):

(defparameter *junk* (make-thing-with-circularity))
(inspect *junk*)  ;graphical inspector

comment:2 in reply to: ↑ 1 Changed 6 years ago by brooks

Replying to rme:

(defstruct foo bar)
(defparameter *junk* (make-foo))
(setf (foo-bar *junk*) *junk*)
(inspect *junk*) ; ... and away you go !

Any chance you can provide a test case, with steps to reproduce?

Something like this, for example (where you would provide a definition of MAKE-THING-WITH-CIRCULARITY):

(defparameter *junk* (make-thing-with-circularity))
(inspect *junk*)  ;graphical inspector

comment:3 Changed 6 years ago by rme

(In [16662]) Bind *print-circle* to t in get-child method on inspector-item Objective-C class.

See ticket:1333.

comment:4 Changed 6 years ago by rme

  • Resolution set to fixed
  • Status changed from new to closed

(In [16663]) Merge from trunk. Closes ticket:1333.

comment:5 Changed 6 years ago by rme

Please re-open this ticket if this doesn't actually solve the problem you were seeing.

If you can't easily rebuild ccl (per the instructions at UpdatingFromSource), you can put this little snippet in a .lisp file and load it after the IDE starts. You should be able to put it in ~/ccl-ide-init.lisp. That file should load after the IDE finishes starting up.

(in-package :gui)

(defmethod get-child ((ii inspector-item) index)
  (let ((arr (inspector-item-children ii))
        (i (1+ index)))
    (or (svref arr i)
	(setf (svref arr i)
	      (let ((li (lisp-inspector ii))
		    (inspector::*inspector-disassembly* t)
		    (*print-length* 20)
		    (*print-circle* t))
		(multiple-value-bind (child label-string value-string) (inspector::inspector-line li i)
		  (make-inspector-item child (or label-string "") (or value-string ""))))))))

Thanks for your polite bug report.

Note: See TracTickets for help on using tickets.