chicken-janitors
[Top][All Lists]
Advanced

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

Re: #768: s11n: reconstruction of hash-tables incorrect on de-serializat


From: Chicken Trac
Subject: Re: #768: s11n: reconstruction of hash-tables incorrect on de-serialization
Date: Thu, 20 Aug 2020 13:44:06 -0000

#768: s11n: reconstruction of hash-tables incorrect on de-serialization
-----------------------------------------+--------------------
            Reporter:  felix winkelmann  |      Owner:  (none)
                Type:  defect            |     Status:  new
            Priority:  critical          |  Milestone:
           Component:  extensions        |    Version:  4.7.x
          Resolution:                    |   Keywords:  s11n
Estimated difficulty:  hard              |
-----------------------------------------+--------------------

Comment (by Idiomdrottning):

 I have fixed the bug: https://ellen.idiomdrottning.org/s11n

 I've changed `deserialize` and `chicken-dump` while I've left `serialize`
 alone.

 Here is what was wrong:
 srfi-69 hash-tables in chicken 5 have eleven slots, more than I guess
 previous versions must've had because the deserializer stops fetching
 after just fetching the test & the hash function. Leading the *next*
 fetcher to fetch things that were actually emitted as part of the hash-
 table. It was not just hash-tables in hash-tables that was borked, it was
 hash-tables in lists too.

 Slot 5 is the min-load value but the deserializer believes that it is
 about to read the cdr of the linked-list that the hash-table is inside. So
 it sets the cdr to 0.5 or whatever, terminating the list prematurely,
 losing the other values that was in the list.

 `(list 'blue 'jeans ht1 'white 't-shirt)` was also borked, it'd lose the
 white t-shirt because it thought cdr was 0.5 instead of the remaining
 links to the list.

-- 
Ticket URL: <https://bugs.call-cc.org/ticket/768#comment:8>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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