COPY-TREE fails with stack overflow on long lists
COPY-TREE fails with a stack overflow when its argument is a long list. (I didn't try to find out what is the minimum length to trigger the error.)
COPY-LIST succeeds on a list of the same length.
Thank you for your attention to this. I searched the bug database but didn't find a similar report. I don't see anything about COPY-TREE in the change logs.
* (defvar x nil)
* (dotimes (i 65536) (push 1 x))
* (copy-tree x)
INFO: Control stack guard page unprotected
Control stack guard page temporarily disabled: proceed with caution
debugger invoked on a SB-KERNEL:
Control stack exhausted (no more space for function call frames).
This is probably due to heavily nested or infinitely recursive function
calls, or a tail call that SBCL cannot or has not optimized away.
PROCEED WITH CAUTION.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-
0: [ABORT] Exit debugger, returning to top level.
$ sbcl --version
(:ANSI-CL :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS
:SB-UNICODE :SB-EVAL :SB-SOURCE-
:LINUX :SB-THREAD :LARGEFILE :GENCGC :STACK-
:CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-
$ uname -a
Linux robert-laptop 2.6.24-16-generic #1 SMP Thu Apr 10 13:23:42 UTC 2008 i686 GNU/Linux