1 | | The nemo program relies heavily on performing transformations over hash tables with symbols as keys. It works fine with Chicken 4.7.4, but unfortunately there seems to have been a regression in 4.8.0rc1, which results in hash-table-exists? and hash-table-ref failing to find any of the existing keys in the table after a number of transformations have been performed. I have not been able to create a small test case yet, but I suspect the hash tables stop working after some garbage collections have been performed. This issue is not entirely new; nemo previously used the environments egg, which was also exhibiting similar unreliable behavior, so I had resorted to using strings instead of symbols as keys. Any advice on how to debug this would be appreciated. |
| 1 | The nemo program relies heavily on performing transformations over hash tables with symbols as keys. It works fine with Chicken 4.7.4, but unfortunately there seems to have been a regression in 4.8.0rc1, which results in hash-table-exists? and hash-table-ref failing to find any of the existing keys in the table after a number of transformations have been performed. |
| 2 | The following code reproduces the issue: |
| 3 | |
| 4 | {{{ |
| 5 | |
| 6 | (use srfi-1 srfi-69) |
| 7 | |
| 8 | (define t (make-hash-table hash: symbol-hash)) |
| 9 | |
| 10 | (hash-table-set! t 'k1 1) |
| 11 | (hash-table-ref t 'k1) |
| 12 | |
| 13 | (for-each |
| 14 | (lambda (k v) |
| 15 | (printf "hash-table-set! ~A ~A~%" k v) |
| 16 | (hash-table-set! t k v)) |
| 17 | (list-tabulate 10 (lambda (i) (gensym 'k))) |
| 18 | (list-tabulate 10 (lambda (i) i)) |
| 19 | ) |
| 20 | |
| 21 | (print (hash-table-ref t 'k15)) |
| 22 | }}} |
| 23 | |
| 24 | Perhaps the hash tables stop working after some garbage collections have been performed. This issue is not entirely new; nemo previously used the environments egg, which was also exhibiting similar unreliable behavior, so I had resorted to using strings instead of symbols as keys. Any advice on how to debug this would be appreciated. |