[elephant-devel] Suspected bug in sleepycat.lisp file

Robert L. Read read at robertlread.net
Wed Sep 21 17:21:52 UTC 2005


Can you outline the responsibilities?

In addition to time, there are three reasons why I would not make a good
owner:

1)  I use only SBCL and plan to use only SBCL for the foreseeable
future.
2)  I am not a super-great LISP coder.
3)  I am modifying Elephant to use CL-SQL as a backend.  I plan to
"release and 
own" this, in any case.  However, fans of Sleepcat may not want to have
the nice
simple code of Elephant cluttered up with my SQL-related code.

Since I plan to own the CL-SQL based Elephant anyway, the real issue is
should that stuff be a fork from Elephant or part of Elephant?

And, since I'm only half-way done, people might be really unhappy when
the 
code review it.





On Tue, 2005-09-20 at 23:41 -0500, Ben Lee wrote:

> it looks like you're right.  but instead of sending me a patch...
> 
> who wants the keys to the car?  (actually i'm not exactly sure how to 
> hand them over.)
> 
> B
> 
> Robert L. Read wrote:
> > While working on implementing Elephant on top of CL-SQL, which 
> > led me to do base64 encoding of the serialized lisp objects, I discovered
> > what I suspect to be a (normally) unexercised bug in buffer-read-byte,
> > namely that it currently uses ":char" instead of :unsigned-byte.
> > 
> > This bug goes unnoticed because the serializer only puts values less than 
> > 128 into the position that it reads with this routine.  I discovered it
> > because I am using this routine to read out the whole buffer-stream into
> > a byte-vector for the purpose of base64 encoding so that I can put it into
> > a text field in PostGres safely.
> > 
> > If you make this change, all of the tests still run exactly as they did.
> > 
> > 
> > 
> > 
> > (defun buffer-read-byte (bs)
> >   "Read a byte."
> >   (declare (optimize (speed 3) (safety 0))
> > 	   (type buffer-stream bs))
> >   (let ((position (buffer-stream-position bs)))
> >     (incf (buffer-stream-position bs))
> >    (deref-array (buffer-stream-buffer bs) '(:array _*:unsigned-byte*_) position)))
> > 
> > @@ -733,7 +736,33 @@
> >            (type buffer-stream bs))
> >    (let ((position (buffer-stream-position bs)))
> >      (incf (buffer-stream-position bs))
> > -    (deref-array (buffer-stream-buffer bs) '(:array :char) position)))
> > +   (deref-array (buffer-stream-buffer bs) '(:array :unsigned-byte) position)))
> > 
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > _______________________________________________
> > elephant-devel site list
> > elephant-devel at common-lisp.net
> > http://common-lisp.net/mailman/listinfo/elephant-devel
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel

----
Robert L. Read, PhD                                     read &T
robertlread.net
Consider visiting Progressive Engineering:
http://robertlread.net/pe
In Austin: 912-8593                                        "Think
globally, Act locally." -- RBF


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20050921/672701d7/attachment.html>


More information about the elephant-devel mailing list