marcomaggi / vicare

A native compiler for Scheme compliant with R6RS
http://marcomaggi.github.com/vicare.html
Other
200 stars 34 forks source link

apply crashes when passed large lists #7

Closed marcomaggi closed 13 years ago

marcomaggi commented 14 years ago
> (apply + (make-list 10000000 1))
Bus error

Matches bug 163689 at the Ikarus bug tracker.

marcomaggi commented 14 years ago

The following does not crash:

(define n 1057111)
(apply + (make-list n 1))

the following does crash:

(define n 1057112)
(apply + (make-list n 1))

it fails with a "large closure size" warning message from "ikarus-collect.c".

marcomaggi commented 13 years ago

Fixed in devel branch by introducing an artificial limit to the arguments APPLY accepts in its final list:

Vicare Scheme version 0.2d1
Revision devel/be907ca0640d027d32ca638fc969fc886efc6ddb
Build 2011-11-01

Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors
Copyright (c) 2011 Marco Maggi

vicare> (apply + (make-list 5000 1))
Unhandled exception
 Condition components:
   1. &assertion
   2. &who: apply
   3. &message: "expected proper list as argument with maximum length 1024"
   4. &irritants: ((1 1 1 1 1 ...))
vicare>

the limit is hard-coded in the file "ikarus.apply.ss" as:

(define CALL-ARGUMENTS-LIMIT 1024)

as comparison, from its own documentation: LispWorks for Unix sets this value to 300, LispWorks for Windows and LispWorks for Linux set this value to 255.