From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Preview: portable dumper Date: Wed, 14 Feb 2018 21:07:20 +0200 Message-ID: <83r2pnwftj.fsf@gnu.org> References: <1775923222.898447.1518559575706@mail.libero.it> <83inb0xkfx.fsf@gnu.org> <87o9krdftc.fsf@gmail.com> <83a7wby1x4.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1518635205 4097 195.159.176.226 (14 Feb 2018 19:06:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Feb 2018 19:06:45 +0000 (UTC) Cc: rpluim@gmail.com, emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 14 20:06:40 2018 Return-path: Envelope-to: ged-emacs-devel@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 1em2Nx-0000Cf-1M for ged-emacs-devel@m.gmane.org; Wed, 14 Feb 2018 20:06:29 +0100 Original-Received: from localhost ([::1]:50557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em2Py-0002jP-Oo for ged-emacs-devel@m.gmane.org; Wed, 14 Feb 2018 14:08:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em2Oy-0002hf-3U for emacs-devel@gnu.org; Wed, 14 Feb 2018 14:07:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1em2Ot-0004Yt-Ue for emacs-devel@gnu.org; Wed, 14 Feb 2018 14:07:32 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em2Ot-0004Yp-R6; Wed, 14 Feb 2018 14:07:27 -0500 Original-Received: from [176.228.60.248] (port=1350 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1em2Os-0001It-Vu; Wed, 14 Feb 2018 14:07:27 -0500 In-reply-to: (message from Daniel Colascione on Wed, 14 Feb 2018 09:49:49 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:222746 Archived-At: > Cc: emacs-devel@gnu.org > From: Daniel Colascione > Date: Wed, 14 Feb 2018 09:49:49 -0800 > > > #3 0x01206274 in die ( > > msg=0x16ce7d2 "!pdumper_object_p (BEG_ADDR)", > > file=0x16ce674 "insdel.c", line=1937) > > at alloc.c:7789 > > #4 0x011acb8b in prepare_to_modify_buffer_1 (start=1, end=1, > > preserve_ptr=0x0) at insdel.c:1937 > > It's weird that we're failing there. If we're looking at a buffer with > dumped contents, we set b->text->beg to NULL, then use the normal > buffer-allocation procedure (whichever we're compiled to use) to > allocate memory for the contents. How can the resulting address ever be > equal to what we started with? Neither mmap_realloc nor r_re_alloc nor > xrealloc should ever reuse the address. You are talking about what enlarge_buffer_text does? IOW, this: if (pdumper_object_p (old_beg)) b->text->beg = NULL; else old_beg = NULL; #if defined USE_MMAP_FOR_BUFFERS p = mmap_realloc ((void **) &b->text->beg, new_nbytes); #elif defined REL_ALLOC p = r_re_alloc ((void **) &b->text->beg, new_nbytes); #else p = xrealloc (b->text->beg, new_nbytes); #endif I will try to look around this when I have time, and see what I find.