chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-janitors] #818: string-hash error


From: Chicken Trac
Subject: Re: [Chicken-janitors] #818: string-hash error
Date: Wed, 18 Apr 2012 23:09:41 -0000

#818: string-hash error
-----------------------------+----------------------------------------------
  Reporter:  zbigniew        |       Owner:       
      Type:  defect          |      Status:  new  
  Priority:  critical        |   Milestone:  4.8.0
 Component:  core libraries  |     Version:  4.7.x
Resolution:                  |    Keywords:       
-----------------------------+----------------------------------------------

Comment(by zbigniew):

 Indirectly only.  It's actually an interaction with srfi-13.

 (use srfi-69 srfi-13) and the errors will occur.
 (use srfi-13 srfi-69) and they will not.

 srfi-13's string-hash is apparently leaking and conflicting with srfi-69's
 definition.  My assumption is that this has always happened, as srfi-69
 takes no precautions in make-hash-table or *make-hash-function to ensure
 that its own version of string-hash is being used when string=? is
 specified.  However, now srfi-13's version does not comply with the
 required API.

 Ultimately this was introduced by two commits, the first of which
 coincides with the beginning of test failures, 2012/01/04:
 2d722205ee1d827d1555761df72f330519c6c1c5, which changed the signature of
 string-hash to add a randomization parameter
 and the second of which coincides with a change in the error format,
 2012/02/01:
 5ddfa715e50a6bf9c117d7c3bbd17298a6d8061a, which uses #f to indicate
 missing start/end parameters

 make-hash-table and *make-hash-function identify "string-hash" as being
 the built-in (i.e. non-user) version even when srfi-13's version has
 overridden it, as they just do a global lookup at runtime.  They then
 attempt to pass it #f/#f for start/end.  Unfortunately, srfi-13 doesn't
 accept #f for these parameters, as it uses let-optionals.  Hence, the
 error.

 Prior to the second commit, it did not pass #f/#f/seed to string-hash, but
 simply a randomization seed.  Indeed, the test output reflects this change
 and between 2012/01/04 and 2012/02/01 the error was different:

 {{{
 Error: (string-parse-start+end) Illegal substring START/END spec
 #<procedure (string-hash s1126 . maybe-bound+start+end1127)>
 306135522
 15
 }}}

 Probably the fix is to use a LET around the definition of *make-hash-
 function and make-hash-table to avoid the runtime lookup and ensure
 srfi-69's versions are the ones checked for.

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/818#comment:2>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]