From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#29220: 26.0.90; eieio-persistent-read fail to restore saved object. Date: Sat, 18 Nov 2017 10:14:49 -0800 Message-ID: <87h8trzc6e.fsf@ericabrahamsen.net> References: <87y3nga0lv.fsf@killashandra.ballybran.fr> <87po8s8k02.fsf@ericabrahamsen.net> <87zi7udorn.fsf@killashandra.ballybran.fr> <8760aim2a5.fsf@ericabrahamsen.net> <87375j2tzd.fsf@users.sourceforge.net> <87inecwl1v.fsf@killashandra.ballybran.fr> <87y3n81eq7.fsf@users.sourceforge.net> <87h8ts1cfp.fsf@users.sourceforge.net> <87zi7kyzcf.fsf@ericabrahamsen.net> <87efov1zzn.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1511029034 21156 195.159.176.226 (18 Nov 2017 18:17:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 18 Nov 2017 18:17:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 29220@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 18 19:17:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eG7ft-000544-Uu for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Nov 2017 19:17:06 +0100 Original-Received: from localhost ([::1]:50821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eG7g1-0000ex-9R for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Nov 2017 13:17:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eG7fv-0000eg-My for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2017 13:17:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eG7fr-0001kn-NR for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2017 13:17:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37865) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eG7fr-0001kH-IR for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2017 13:17:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eG7fp-0006rC-KU for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2017 13:17:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Nov 2017 18:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29220 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29220-submit@debbugs.gnu.org id=B29220.151102899726326 (code B ref 29220); Sat, 18 Nov 2017 18:17:01 +0000 Original-Received: (at 29220) by debbugs.gnu.org; 18 Nov 2017 18:16:37 +0000 Original-Received: from localhost ([127.0.0.1]:46546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eG7fR-0006qY-H3 for submit@debbugs.gnu.org; Sat, 18 Nov 2017 13:16:37 -0500 Original-Received: from mail.ericabrahamsen.net ([50.56.99.223]:56892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eG7fQ-0006qQ-7Y for 29220@debbugs.gnu.org; Sat, 18 Nov 2017 13:16:36 -0500 Original-Received: from localhost (71-212-22-173.tukw.qwest.net [71.212.22.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id B5F9EC018D; Sat, 18 Nov 2017 18:16:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1511028994; bh=sZR9ev7mGENhaoFsyp7P03g9DTUz3yo9kLGrgHBVxHg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=PPxlgoWmaEmKXsEP5DitEhyzZDalpCcpZd/mUa0s1Acxqdc12e2D7+f6fRCUTVgVh 8pXxREvFxezBY/UB6vUTwvR1abyGLJCwcO776sjC9+fEKDDTXkB3pttyb/vN+bcVV1 j/IVeDtWKIDayzzcJWKTpzM2kMFUB34jXEoVQ5No= In-Reply-To: <87efov1zzn.fsf@users.sourceforge.net> (Noam Postavsky's message of "Sat, 18 Nov 2017 08:24:28 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140063 Archived-At: Noam Postavsky writes: > Eric Abrahamsen writes: > >> (Are you guys looking at a different version of the pcache repo? The one >> on Github uses `constructor', not `make-instance'.) > > The version mentioned in #23: > > I've put an branch (pte/emacs-26) on github > (https://github.com/PierreTechoueyres/pcache.git) with some tests that > you can launch with Oops, I missed that. [...] >> But I still think the problem isn't in reading, it's in writing: the >> entries in the hash table are being written incorrectly, and so this >> validation step is exploding. > > Yes, the way structs and classes are encoded in emacs-26 changed, so the > way they're written changed also. It seems the round-tripping loses the > class/type maybe? I can still see the '44' entry in the hash table, so > the hash table itself is still in there... Here's what I think is going on: (defclass person () ((name :type string :initarg :name))) (defclass classy (eieio-persistent) ((teacher :type person :initarg :teacher) (students :initarg :students :initform (make-hash-table)))) (setq jane (make-instance 'person :name "Jane")) (setq bob (make-instance 'person :name "Bob")) (setq class (make-instance 'classy :teacher jane)) (puthash "Bob" bob (slot-value class 'students)) (object-write class) => (classy "classy-52080cc" :teacher (person "person-52080c4" :name "Jane") :students #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data ("Bob" #s(#s(eieio--class person nil nil [#s(cl-slot-descriptor name unbound string nil)] #s(hash-table size 65 test eq rehash-size 1.5 rehash-threshold 0.8125 data (name 0)) nil ((:name . name)) [] [] #s(#2 unbound) (:custom-groups nil)) "Bob")))) Jane is `read'-able, Bob isn't. `object-write' will recurse and use `object-write' on any member objects, but the hashtable gets sent to `prin1', which I assume uses `prin1' on all its values instead: (object-write bob) => (person "person-482ca1c" :name "Bob") (prin1 bob) => #s(#s(eieio--class person nil nil [#s(cl-slot-descriptor name unbound string nil)] #s(hash-table size 65 test eq rehash-size 1.5 rehash-threshold 0.8125 data (name 0 ...)) nil ((:name . name)) [] [] #s(#1 unbound) (:custom-groups nil)) "Bob") And I see I have yet again screwed up the changes to `object-write' in master; off to fix that now.