Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#821 closed defect (invalid)

handler-case cannot handle stack overflow

Reported by: rfateman Owned by:
Priority: normal Milestone:
Component: IDE Version: trunk
Keywords: Cc:

Description

(defun f (n) (if (> n 0) (1+ (f (1- n))) 0))

In GCL,

(handler-case (f 100000)(error (x)(format t "~% handler-case caught error ~s" x) 'boohoo))

results in this:

handler-case caught error #<CONDITIONS::INTERNAL-SIMPLE-STREAM-ERROR.0>

BOOHOO

In Allegro CL, it results in this:

handler-case caught error #<synchronous-operating-system-signal @ #x221524ca>

boohoo

but in CCL we get this...

(handler-case (f 100000)(error (x)(format t "~% handler-case caught error ~s" x) 'boohoo))

Error: Stack overflow on value stack. While executing: F, in process listener(1). Type :POP to abort, :R for a list of available restarts. Type :? for other options

So CCL does not have error handling for this kind of error. If it is to be used seriously as a replacement for GCL on Windows, it has to recover better than this.

version: Welcome to Clozure Common Lisp Version 1.6-r14468M (WindowsX8632)!

Thanks

Richard Fateman fateman@…

Change History (2)

comment:1 Changed 8 years ago by gb

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

The condition signaled by stack overflow in CCL isn't a subtype of ERROR; it is a subtype of SERIOUS-CONDITION.

? (defun f (n) (if (> n 0) (1+ (f (1- n))) 0))
F
? (handler-case (f 100000)
    (serious-condition (x)
      (format t "~% handler-case caught serious-condition: ~a" x) 'boohoo))
 handler-case caught serious-condition: Stack overflow on value stack.
BOOHOO

comment:2 Changed 8 years ago by gb

And more to the point, the condition type in question is a subtype of STORAGE-CONDITION; see the CLHS dictionary entry for STORAGE-CONDITION. http://www.lispworks.com/documentation/HyperSpec/Body/e_storag.htm#storage-condition

Note: See TracTickets for help on using tickets.