Thomas Chust
2018-08-19 01:40:26 UTC
Hello,
while trying to port some code from CHICKEN 4 to CHICKEN 5 I have just
spent several hours tracking down a crash to a call of
hash-table-ref/default for a table which happened to use eq? as the
comparison function and was loaded with various types of objects as
keys.
Then I realized that eq?-hash simply cannot be called on certain types
of objects:
$ chicken-status
[...]
srfi-69 ....................................................... version: 0.2
[...]
$ csi
CHICKEN
(c) 2008-2018, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 5.0.0rc1 (prerelease) (rev 9d480412)
linux-unix-gnu-x86-64 [ 64bit dload ptables ]
#;1> (import srfi-69)
; loading /opt/chicken/lib/chicken/9/srfi-69.import.so ...
; loading /opt/chicken/lib/chicken/9/srfi-69.so ...
#;2> (eq?-hash 2/3)
[panic] out of memory - heap has reached its maximum size - execution terminated
Apart from fractions, complex numbers also seem to trigger the crash
reliably.
Since I don't see any obvious reason why hashing by object identity
should be impossible for certain values, I consider this a serious
bug :-/
Ciao,
Thomas
while trying to port some code from CHICKEN 4 to CHICKEN 5 I have just
spent several hours tracking down a crash to a call of
hash-table-ref/default for a table which happened to use eq? as the
comparison function and was loaded with various types of objects as
keys.
Then I realized that eq?-hash simply cannot be called on certain types
of objects:
$ chicken-status
[...]
srfi-69 ....................................................... version: 0.2
[...]
$ csi
CHICKEN
(c) 2008-2018, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 5.0.0rc1 (prerelease) (rev 9d480412)
linux-unix-gnu-x86-64 [ 64bit dload ptables ]
#;1> (import srfi-69)
; loading /opt/chicken/lib/chicken/9/srfi-69.import.so ...
; loading /opt/chicken/lib/chicken/9/srfi-69.so ...
#;2> (eq?-hash 2/3)
[panic] out of memory - heap has reached its maximum size - execution terminated
Apart from fractions, complex numbers also seem to trigger the crash
reliably.
Since I don't see any obvious reason why hashing by object identity
should be impossible for certain values, I consider this a serious
bug :-/
Ciao,
Thomas
--
The greatest victory is that which requires no battle.
-- Sun Tzu, "The Art of War"
The greatest victory is that which requires no battle.
-- Sun Tzu, "The Art of War"