[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-janitors] #1041: -d0 causes different application behavior
From: |
Chicken Trac |
Subject: |
Re: [Chicken-janitors] #1041: -d0 causes different application behavior |
Date: |
Fri, 20 Nov 2015 16:35:13 -0000 |
#1041: -d0 causes different application behavior
-----------------------+----------------------
Reporter: mario | Owner:
Type: defect | Status: reopened
Priority: critical | Milestone: 4.11.0
Component: unknown | Version: 4.8.x
Resolution: | Keywords:
-----------------------+----------------------
Comment (by sjamaan):
OK, here we go:
{{{
#;1> (use awful-path-matchers srfi-69)
#;2> (##sys#peek-fixnum (path-match "foo" <int>) 0)
140289424854051
#;3> (##sys#size (path-match "foo" <int>))
3
#;4> (##sys#slot (path-match "foo" <int>) 0)
70144712427025
#;5> (##sys#slot (path-match "foo" <int>) 1)
("foo" #<procedure (awful-path-matchers#<int> thing17)>)
#;6> (##sys#slot (path-match "foo" <int>) 2)
#<lambda info (f_525 path90)>
#;7> (define equiv? (hash-table-equivalence-function (make-hash-table)))
#;8> (equiv? (path-match "foo" <int> <int>) (path-match "foo" <int>))
#f
}}}
Without lambda info:
{{{
#;1> (use awful-path-matchers srfi-69)
#;2> (##sys#peek-fixnum (path-match "foo" <int>) 0)
140155045890064
#;3> (##sys#size (path-match "foo" <int>))
2
#;4> (##sys#slot (path-match "foo" <int>) 0)
70178053519952
#;5> (##sys#slot (path-match "foo" <int>) 1)
("foo" #<procedure>)
#;6> (##sys#size (cadr #5))
1
#;7> (define equiv? (hash-table-equivalence-function (make-hash-table)))
#;8> (equiv? (path-match "foo" <int> <int>) (path-match "foo" <int>))
#t
}}}
I think the problem here is the fact that, for example, (path-match "foo"
<int>) creates a closure containing a rest list with the string "foo" and
a procedure which is not inspectable. If then you do (path-match "foo"
<string>), it also creates a closure containing a rest list with the
string "foo" and a procedure which is not inspectable.
If you look at the way the srfi-69 hashing works, it will hash "special"
objects (closures are such) by looking at all the slots except the first
(because it doesn't contain a Scheme object). Without lambda info, the
closure objects have one less slot.
See {{{%%special-vector-hash}}}. The very strange thing is that it uses
{{{##sys#peek-fixnum}}} to extract the procedure's memory location from
the closure and convert it to a fixnum, which it then uses as a random
seed!
And all of that aside, like I said the lists are NOT equivalent so that
should not make a difference, I think... Tweaking {{{recursive-hash-max-
length}}} or {{{recursive-hash-max-depth}}} doesn't seem to help.
--
Ticket URL: <http://bugs.call-cc.org/ticket/1041#comment:17>
CHICKEN Scheme <http://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.