#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.
#52: UNICODE-COMPLETE-NAME misses a completion
----------------------+-----------------------------------------------------
Reporter: rtoy | Owner:
Type: defect | Status: reopened
Priority: minor | Milestone:
Component: Unicode | Version: 2012-01
Resolution: | Keywords:
----------------------+-----------------------------------------------------
Changes (by rtoy):
* status: closed => reopened
* resolution: fixed =>
Comment:
The commit has been reverted, unfixing this. While it fixed the immediate
issue, it has other issues like not being able to complete
#\hangul_syllable_.
I find that much more useful than not being able to complete #\no-
break_space.
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/52#comment:2>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.
#63: {{{VM::READ-CYCLE-COUNTER}}} destroys live values in ebx and ecx
--------------------+-------------------------------------------------------
Reporter: rtoy | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone:
Component: Core | Version: 2012-09
Keywords: |
--------------------+-------------------------------------------------------
Consider the following code:
{{{
(eval-when (:compile-toplevel :execute)
(defmacro with-cycle-counter (&body body)
(let ((hi0 (gensym))
(hi1 (gensym))
(lo0 (gensym))
(lo1 (gensym)))
`(multiple-value-bind (,lo0 ,hi0)
(vm::read-cycle-counter)
(values (locally ,@body)
(multiple-value-bind (,lo1 ,hi1)
(vm::read-cycle-counter)
(+ (ash (- ,hi1 ,hi0) 32)
(- ,lo1 ,lo0)))))))
)
(defun bar (x)
(declare (type (and fixnum unsigned-byte) x)
(optimize speed (safety 0)))
(with-cycle-counter
(let ((sum 0d0))
(declare (double-float sum))
(dotimes (k x)
(declare (type (and fixnum unsigned-byte) k))
(incf sum k))
sum)))
}}}
When compiled, you get funny results like
{{{
* (bar 1000000)
0.0d0
408
}}}
This happens because {{{READ-CYCLE-COUNTER}}} uses the {{{CPUID}}}
instruction that writes values to the eax, ebx, ecx, and edx registers,
but the VOP for {{{READ-CYCLE-COUNTER}}} doesn't know that ebx and ecx are
written. Thus the vop can cause any live values in the ebx and ecx
registers to be destroyed, as happens in this example.
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/63>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.
#62: mk:defsystem no longer loads correctly
--------------------+-------------------------------------------------------
Reporter: rtoy | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone:
Component: Core | Version: 2012-06
Keywords: |
--------------------+-------------------------------------------------------
{{{(require 'defsystem)}}} causes errors on loading. This is very likely
related to the changes to {{{EXPORT}}} and friends which were treated
specially by the compiler but should not have been. Snapshot 2012-05
works but 2012-06 does not.
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/62>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.
#56: Heap overflow checking fails on darwin/x86
--------------------+-------------------------------------------------------
Reporter: rtoy | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone:
Component: Core | Version: 2012-01
Keywords: |
--------------------+-------------------------------------------------------
{{{
cmulisp -dynamic-space-size 64
* (defvar *1* (make-list 10000000))
; [GC threshold exceeded with 35,359,432 bytes in use. Commencing GC.]
; [GC completed with 21,504,336 bytes retained and 13,855,096 bytes
freed.]
; [GC will next occur when at least 53,504,336 bytes are in use.]
; [GC threshold exceeded with 53,514,472 bytes in use. Commencing GC.]
*A2 gc_alloc_new_region failed, nbytes=8.
CMUCL has run out of dynamic heap space (64 MB).
You can control heap size with the -dynamic-space-size commandline
option.
sigbus_handler: Real protection violation at 0xac3, PC = 0x4b3243e3
...
}}}
This probably happens in older versions too, but I didn't check. Works ok
on linux.
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/56>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.
#61: Darwin+clang doesn't produce a working lisp
--------------------+-------------------------------------------------------
Reporter: rtoy | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone:
Component: Core | Version: 2012-07
Keywords: |
--------------------+-------------------------------------------------------
Compiling the C runtime on Darwin with clang does not produce a working
lisp. The cause is that clang uses xmm registers in gencgc.c, but the
allocator calls {{{alloc()}}} directly without saving any live xmm
registers which eventually get trashed. For example the vop
{{{
(define-vop (move-from-single)
(:args (x :scs (single-reg) :to :save))
(:results (y :scs (descriptor-reg)))
(:node-var node)
(:note _N"float to pointer coercion")
(:save-p t)
(:generator 13
(with-fixed-allocation (y vm:single-float-type vm:single-float-size
node)
(inst movss (ea-for-sf-desc y) x))))
}}}
will save any live float registers, but not the arg {{{x}}}. If the
allocator calls {{{alloc()}}}, {{{x}}} could be destroyed.
Possible solutions:
1. Save and restore float args to the stack in every float vop that does
allocation.
1. Make {{{alloc()}}} save all the float registers.
The first solution is nice because only the registers that need to be
saved are saved. But it's not nice because every vop will save/restore
when most of the time {{{alloc()}}} will not be called.
The second solution is nice because it's always safe, even if some vop
forgot to save a register. But it's not nice because all float registers
are saved when only one (or a very small number) needs to be saved. But
it looks like {{{alloc()}}} is relatively expensive so perhaps the cost of
saving all registers is in the noise. (Should measure this.)
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/61>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.
#59: pcl failure
--------------------+-------------------------------------------------------
Reporter: rtoy | Owner: rtoy
Type: defect | Status: new
Priority: major | Milestone:
Component: PCL | Version: 20c
Keywords: |
--------------------+-------------------------------------------------------
Mentioned on the asdf-devel page.
1. start cmucl
1. {{{(require :asdf)}}}
1. push my asdf directory onto {{{asdf:*central-registry*}}}
1. {{{(asdf:load-system :asdf)}}}
The asdf directory in question is the directory containing the asdf
version 2.20.18.
The error produced is:
{{{
#(11) fell through ETYPECASE expression.
Wanted one of (FUNCTION PCL::FAST-INSTANCE-BOUNDP FIXNUM PCL::METHOD-CALL
PCL::FAST-METHOD-CALL).
[Condition of type CONDITIONS::CASE-FAILURE]
Restarts:
0: [TRY-RECOMPILING] Try recompiling asdf
1: [RETRY ] Retry compiling #<CL-SOURCE-FILE "asdf" "asdf">.
2: [ACCEPT ] Continue, treating
compiling #<CL-SOURCE-FILE "asdf" "asdf"> as
having been
successful.
3: [ABORT ] Return to Top-Level.
}}}
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/59>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.