cosmos72 / stmx

High performance Transactional Memory for Common Lisp
http://stmx.org/
241 stars 14 forks source link

CLISP: sporadic failures of test GHASH-TABLE-EQUALP #10

Open cosmos72 opened 9 years ago

cosmos72 commented 9 years ago

It usually only happens when tests are executed in a batch. Failure details:


key

S(HASH-TABLE :TEST EQUALP

(#S(HASH-TABLE :TEST EQUALP (2 . 1)) . #S(HASH-TABLE :TEST EQUALP (1 . 2))) (#S(HASH-TABLE :TEST EQUALP (1 . 2)) . #S(HASH-TABLE :TEST EQUALP (2 . 1)))) has value 18 in GHASH-TABLE, but is missing from HASH-TABLE.

cosmos72 commented 9 years ago

It seems to be a CLISP bug. Reproducible with:

(defun make-cuckoo-hash-table ()
  (let ((h1 (make-hash-table :test 'equalp))
        (h2 (make-hash-table :test 'equalp))
        (h  (make-hash-table :test 'equalp)))
    (setf (gethash 1 h1) 2 (gethash 2 h2) 1 (gethash h1 h) h2 (gethash h2 h) h1)
    h))

(loop for i from 0
    for h1 = (make-cuckoo-hash-table)
    for h2 = (make-cuckoo-hash-table)
    unless (progn (print i) (princ (equalp h1 h2)))
    do (return (values h1 h2)))

It usually takes between 500 and 15000 iterations for the bug to appear once...

cosmos72 commented 9 years ago

opened CLISP ticket https://sourceforge.net/p/clisp/bugs/671/ now waiting for feedback