[Ecls-list] sxhash broken? [WAS: About name collisions]

William Robinson airbaggins at gmail.com
Fri Feb 1 16:53:33 UTC 2008


Juan Jose Garcia-Ripoll wrote:
> The current naming algorithm is shown below. It is currently being tested.
>
> (defun unique-init-name (pathname)
>   (let ((tag (concatenate 'base-string
> 			  "_ecl"
> 			  (encode-number-in-name (sxhash pathname))
> 			  "_"
> 			  (encode-number-in-name (get-universal-time)))))
>     (cmpnote "Creating tag: ~S" tag)
>     tag))
>
>   
Hi again,

I was just trying out the latest CVS and found that sxhash appears to be 
“broken”. It seems to return the exact same hash for any string I put in 
it, that being 401622548. I saw this when my asdf:make-build :type :fasl 
failed to link, due to:

;;; Note: Scanning 
#P"/home/bill/programming/cl-glfw/lib/opengl-extensions.o"
;;; Note: Found tag: "_eclSgP9R_CUfpi3"
;;; Note: Scanning 
#P"/home/bill/programming/cl-glfw/lib/opengl-convenience.o"
;;; Note: Found tag: "_eclSgP9R_3Ufpi3"
;;; Note: Scanning #P"/home/bill/programming/cl-glfw/lib/opengl.o"
;;; Note: Found tag: "_eclSgP9R_SQfpi3"
;;; Note: Scanning #P"/home/bill/programming/cl-glfw/lib/opengl-library.o"
;;; Note: Found tag: "_eclSgP9R_EOfpi3"
;;; Note: Scanning #P"/home/bill/programming/cl-glfw/lib/opengl-type-map.o"
;;; Note: Found tag: "_eclSgP9R_EOfpi3"
;;; Note: Scanning #P"/home/bill/programming/cl-glfw/lib/opengl-package.o"
;;; Note: Found tag: "_eclSgP9R_COfpi3"
;;; Note: Scanning #P"/home/bill/programming/cl-glfw/lib/scaffolding.o"
;;; Note: Found tag: "_eclSgP9R_7Ofpi3"


And thus:

/home/bill/programming/cl-glfw/lib/opengl-library.o: In function 
`_eclSgP9R_EOfpi3':
/home/bill/programming/cl-glfw/lib/opengl-library.c:10: multiple 
definition of `_eclSgP9R_EOfpi3'
/home/bill/programming/cl-glfw/lib/opengl-type-map.o:/home/bill/programming/cl-glfw/lib/opengl-type-map.c:10: 
first defined here
collect2: ld returned 1 exit status




$ ecl
ECL (Embeddable Common-Lisp) 0.9j (CVS 2008-02-01 14:01)
 > (sxhash "opengl-library.c")
401622548
 > (sxhash "opengl-type-map.c")
401622548
 > (sxhash "o")
401622548
 > (sxhash "something completely different")
401622548
 > (sxhash "")
401622548
 > (sxhash 1)
445307638





More information about the ecl-devel mailing list