#65: Different results for {{{expt}}} between compiled and interpreted code
--------------------+-------------------------------------------------------
Reporter: rtoy | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone:
Component: Core | Version: 2012-12
Keywords: |
--------------------+-------------------------------------------------------
Consider
{{{
(defun sqr (x)
(declare (type (complex double-float) x))
(expt x 2))
}}}
Compare the results:
{{{
* (sqr #c(0d0 1d0))
#C(-1d0 0d0)
* (expt #c(0d0 1d0))
#C(-1.0d0 1.2246467991473532d-16)
}}}
The difference is caused by a deftransform for {{{expt}}} that converts
{{{(expt x 2)}}} to {{{(* x x)}}}.
Perhaps the {{{expt}}} should be modified to do the same transformation
when the power is one of the special values in the deftransform? (The
deftransform handles 2, 3, 4, and 1/2.)
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/65>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.
#68: bit-bash-copy can't handle very large objects
--------------------+-------------------------------------------------------
Reporter: rtoy | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone:
Component: Core | Version: 2012-12
Keywords: |
--------------------+-------------------------------------------------------
{{{BIT-BASH-COPY}}} takes bit indices as offsets for copying random
objects. This is very useful if we're copying bit-arrays or arrays with
elements smaller than a byte. However, when copying strings or arrays
with elements larger than a byte, the bit index exceeds 32 bits when the
index is near {{{MOST-POSITIVE-FIXNUM}}}.
{{{BIT-BASH-COPY}}} needs to be updated to handle this, or a {{{BYTE-BASH-
COPY}}} should be added to handle the case where the element size is at
least a byte in size.
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/68>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.
#67: deftransform for replace is unsafe
--------------------+-------------------------------------------------------
Reporter: rtoy | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone:
Component: Core | Version: 2012-12
Keywords: |
--------------------+-------------------------------------------------------
Consider this function
{{{
(defun bad (s)
(declare (simple-string s))
(replace s s :start2 100 :end2 105))
}}}
After compiling this,
{{{
(bad (copy-seq "1234567890"))
}}}
Produces a totally bogus result, filling in the first 4 characters of the
resulting string with garbage.
The problem is that the deftransform for replace just calls {{{BIT-BASH-
COPY}}} without verifying that the start and end indices make sense for
the given string. Note that it also doesn't check to see that end >=
start, but this gets handled by {{{BIT-BASH-COPY}}} which gets a negative
length and signals an error.
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/67>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.
#66: replace on simple-strings
--------------------+-------------------------------------------------------
Reporter: heller | Owner: somebody
Type: defect | Status: new
Priority: minor | Milestone:
Component: Core | Version: 2012-12
Keywords: |
--------------------+-------------------------------------------------------
This code
{{{
(deftype index () `(integer 0 #.array-total-size-limit))
(defun %move-string (from start end to index)
(declare (type simple-string from to) (type index start end index))
(replace to from :start1 index :start2 start :end2 end))
(let ((x (make-string 35893164)))
(%move-string x 4 4 x 35893164)
nil)
}}}
when executed with `(load (compile-file "test.lisp"))`
produces this error:
{{{
Type-error in kernel::object-not-type-error-handler:
-499451136 is not of type (mod 536870911)
[Condition of type type-error]
}}}
I don't see the bug in my code, so it seems to be a bug in CMUCL.
lisp-implementation-version returns "snapshot-2012-12 (20D Unicode)"
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/66>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.
#60: compile-file and export problem
--------------------+-------------------------------------------------------
Reporter: rtoy | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone:
Component: Core | Version: 2012-05
Keywords: |
--------------------+-------------------------------------------------------
Put the following in a file and {{{compile-file}}}. This shouldn't cause
any problems but it does.
{{{
(defpackage fail (:use cl))
(in-package fail)
(defvar *x* '^)
(export *x*)
}}}
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/60>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.