I am trying to debug a control stack overflow caused by an infinite
loop with a CLIM program.  I use CMUCL 19a-pre3 and the latest McCLIM
CVS sources under Debian Woody.

The program causing the infinite loop, which is part of a collection
of grapher code, is taken from the CLIM section of the CMU Common Lisp
Repository:

  
ftp://ftp.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/gui/clim/clim_2/browsers/graphers.tgz

The file indented-lists.lisp displays tree structures as indented lists
analogous to Mac OS 7 or later directories.  The file needs a few
changes before it can run with McCLIM:

- replace the 2 calls to STREAM-SET-CURSOR-POSITION with
  CLIM-INTERNALS::STREAM-SET-CURSOR-POSITION

- add this definition, which is missing from the file:

    (defun draw-triangle* (stream x1 y1 x2 y2 x3 y3 &key (filled nil))
      (draw-polygon* stream (list x1 y1 x2 y2 x3 y3) :filled filled))

- in the group-viewer application frame definition, replace:

    (:command-table (:group-viewer :inherit-from (:indented-lists)))

  with:

    (:command-table (group-viewer :inherit-from (:indented-lists)))

  i.e. remove the colon just in front of `group-viewer'.

When I run the program with:

  (in-package :clim-user)

  (view-directory "/home/paolo/")

a window with the tree's root correctly appears.  But when I click the
triangle next to the directory name, I get the error included below.
The backtrace, which includes a few hundred stack frames, aborts due
to another stack overflow. It looks like there is an infinite loop
involving CLIM:RECOMPUTE-EXTENT-FOR-CHANGED-CHILD.

How can I find who is calling RECOMPUTE-EXTENT-FOR-CHANGED-CHILD at
the time the loop starts?


Paolo

----------------------------------------------------------------------
A control stack overflow has occurred: the program has entered the yellow
control stack guard zone.  Please note that you will be returned to the
Top-Level if you enter the red control stack guard zone while debugging.



Control stack overflow
   [Condition of type KERNEL:STACK-OVERFLOW]

Restarts:
  0: [ABORT] Return to application command loop
  1:         Return to Top-Level.

Debug  (type H for help)

(KERNEL:YELLOW-ZONE-HIT)
Source: Error finding source:
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM:  Source file no longer exists:  
target:code/interr.lisp.
0] backtrace

0: (KERNEL:YELLOW-ZONE-HIT)
1: ("Foreign function call land")
2: ((METHOD RECOMPUTE-EXTENT-FOR-CHANGED-CHILD NIL
     (CLIM-INTERNALS::COMPOUND-OUTPUT-RECORD T T T T ...))
    (#(4 5 0 2 6 ...) . #(# # #)) #<unused-arg>
    #<STANDARD-UPDATING-OUTPUT-RECORD X 7:43/2 Y 1/2:31/2 :UPDATING {58939965}>     
#<CLIM-INTERNALS::UPDATING-OUTPUT-CHILDREN-RECORD X 7:43/2 Y 1/2:31/2
      {584810FD}>
    ...)
3: ((METHOD RECOMPUTE-EXTENT-FOR-CHANGED-CHILD NIL
     (CLIM-INTERNALS::COMPOUND-OUTPUT-RECORD T T T T ...))
    (#(4 5 0 2 6 ...) . #(# # #)) #<unused-arg>
    #<CLIM-INTERNALS::UPDATING-OUTPUT-CHILDREN-RECORD X 7:43/2 Y 1/2:31/2
      {584810FD}>
    #<STANDARD-UPDATING-OUTPUT-RECORD X 7:43/2 Y 1/2:31/2 :UPDATING {58939965}>     
...)
4: ((METHOD RECOMPUTE-EXTENT-FOR-CHANGED-CHILD NIL
     (CLIM-INTERNALS::COMPOUND-OUTPUT-RECORD T T T T ...))
    (#(4 5 0 2 6 ...) . #(# # #)) #<unused-arg>
    #<STANDARD-UPDATING-OUTPUT-RECORD X 7:43/2 Y 1/2:31/2 :UPDATING {58939965}>     
#<CLIM-INTERNALS::UPDATING-OUTPUT-CHILDREN-RECORD X 7:43/2 Y 1/2:31/2
      {584810FD}>
    ...)
5: ((METHOD RECOMPUTE-EXTENT-FOR-CHANGED-CHILD NIL
     (CLIM-INTERNALS::COMPOUND-OUTPUT-RECORD T T T T ...))
    (#(4 5 0 2 6 ...) . #(# # #)) #<unused-arg>
    #<CLIM-INTERNALS::UPDATING-OUTPUT-CHILDREN-RECORD X 7:43/2 Y 1/2:31/2
      {584810FD}>
    #<STANDARD-UPDATING-OUTPUT-RECORD X 7:43/2 Y 1/2:31/2 :UPDATING {58939965}>     
...)
  .
  .
[...more similar stack frames...]
  .
  .
419: ((METHOD RECOMPUTE-EXTENT-FOR-CHANGED-CHILD NIL
       (CLIM-INTERNALS::COMPOUND-OUTPUT-RECORD T T T T ...))
      (#(4 5 0 2 6 ...) . #(# # #)) #<unused-arg>
      #<CLIM-INTERNALS::UPDATING-OUTPUT-CHILDREN-RECORD X 7:43/2 Y 1/2:31/2
        {583A6E25}>
      #<STANDARD-UPDATING-OUTPUT-RECORD X 7:43/2 Y 1/2:31/2 :UPDATING
        {58823BB5}>
      ...)
420: ((METHOD RECOMPUTE-EXTENT-FOR-CHANGED-CHILD NIL
       (CLIM-INTERNALS::COMPOUND-OUTPUT-RECORD T T T T ...))
      (#(4 5 0 2 6 ...) . #(# # #)) #<unused-arg>
      #<STANDARD-UPDATING-OUTPUT-RECORD X 7:43/2 Y 1/2:31/2 :UPDATING
        {58823BB5}>
      #<CLIM-INTERNALS::UPDATING-OUTPUT-CHILDREN-RECORD X 7:43/2 Y 1/2:31/2
        {583A6E25}>
      ...)

A control stack overflow has occurred: the program has entered the yellow
control stack guard zone.  Please note that you will be returned to the
Top-Level if you enter the red control stack guard zone while debugging.


Control stack overflow
   [Condition of type KERNEL:STACK-OVERFLOW]

Restarts:
  0: [ABORT] Return to debug level 1.
  1:         Return to application command loop
  2:         Return to Top-Level.

Debug  (type H for help)

(KERNEL:YELLOW-ZONE-HIT)
Source: Error finding source: 
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM:  Source file no longer exists:
  target:code/interr.lisp.
0]] 
----------------------------------------------------------------------


-- 
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

Reply via email to