[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-janitors] #905: Unreliable behavior of hash-table-copy with
From: |
Chicken Trac |
Subject: |
Re: [Chicken-janitors] #905: Unreliable behavior of hash-table-copy with symbols as keys (regression wrt 4.7.4) (was: Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4)) |
Date: |
Mon, 27 Aug 2012 01:57:37 -0000 |
#905: Unreliable behavior of hash-table-copy with symbols as keys (regression
wrt
4.7.4)
-----------------------------+----------------------------------------------
Reporter: iraikov | Owner: sjamaan
Type: defect | Status: assigned
Priority: critical | Milestone: 4.8.0
Component: core libraries | Version: 4.8.x
Resolution: | Keywords:
-----------------------------+----------------------------------------------
Description changed by iraikov:
Old description:
> 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.
> The following code reproduces the issue:
>
> {{{
>
> (use srfi-1 srfi-69)
>
> (define t (make-hash-table hash: symbol-hash))
>
> (hash-table-set! t 'k1 1)
> (hash-table-ref t 'k1)
>
> (for-each
> (lambda (k v)
> (printf "hash-table-set! ~A ~A~%" k v)
> (hash-table-set! t k v))
> (list-tabulate 10 (lambda (i) (gensym 'k)))
> (list-tabulate 10 (lambda (i) i))
> )
>
> (print (hash-table->alist t))
> (print (hash-table-ref t 'k15))
> }}}
>
> 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.
New description:
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 hash-table-copy has been performed.
The following code reproduces the issue:
{{{
(import scheme chicken)
(require-extension srfi-69 srfi-1)
(define t (make-hash-table hash: symbol-hash))
(hash-table-set! t 'k1 1)
(define prefix (gensym "test"))
(for-each
(lambda (k v)
;; (printf "hash-table-set! ~A ~A~%" k v)
(hash-table-set! t k v))
(list-tabulate 10 (lambda (i) (string->symbol (string-append
(symbol->string prefix) ":" (symbol->string (gensym "k"))))))
(list-tabulate 10 (lambda (i) i))
)
(print (hash-table->alist t))
;; hash-table-ref works as expected
(print (hash-table-ref t 'k1))
(print (hash-table-ref t 'test17:k29))
(define t2 (hash-table-copy t))
(print (hash-table->alist t2))
;; hash-table-ref fails
(print (hash-table-ref t2 'k1))
(print (hash-table-ref t2 'test17:k29))
}}}
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.
--
--
Ticket URL: <http://bugs.call-cc.org/ticket/905#comment:9>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.
- [Chicken-janitors] #905: Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/22
- Re: [Chicken-janitors] #905: Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/22
- Re: [Chicken-janitors] #905: Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/22
- Re: [Chicken-janitors] #905: Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/23
- Re: [Chicken-janitors] #905: Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/23
- Re: [Chicken-janitors] #905: Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/23
- Re: [Chicken-janitors] #905: Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/24
- Re: [Chicken-janitors] #905: Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/26
- Re: [Chicken-janitors] #905: Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/26
- Re: [Chicken-janitors] #905: Unreliable behavior of hash-table-copy with symbols as keys (regression wrt 4.7.4) (was: Unreliable behavior of hash tables with symbols as keys (regression wrt 4.7.4)),
Chicken Trac <=
- Re: [Chicken-janitors] #905: Unreliable behavior of hash-table-copy with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/26
- Re: [Chicken-janitors] #905: Unreliable behavior of hash-table-copy with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/27
- Re: [Chicken-janitors] #905: Unreliable behavior of hash-table-copy with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/27
- Re: [Chicken-janitors] #905: Unreliable behavior of hash-table-copy with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/28
- Re: [Chicken-janitors] #905: Unreliable behavior of hash-table-copy with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/28
- Re: [Chicken-janitors] #905: Unreliable behavior of hash-table-copy with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/28
- Re: [Chicken-janitors] #905: Unreliable behavior of hash-table-copy with symbols as keys (regression wrt 4.7.4), Chicken Trac, 2012/08/28