GNU bug report logs - #31996
27.0.50; [w32] while dumping: assertion failed: specpdl_ptr->kind == SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func == xfree

Previous Next

Package: emacs;

Reported by: Noam Postavsky <npostavs <at> gmail.com>

Date: Thu, 28 Jun 2018 19:11:01 UTC

Severity: normal

Found in version 27.0.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31996 in the body.
You can then email your comments to 31996 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to eggert <at> cs.ucla.edu, bug-gnu-emacs <at> gnu.org:
bug#31996; Package emacs. (Thu, 28 Jun 2018 19:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Noam Postavsky <npostavs <at> gmail.com>:
New bug report received and forwarded. Copy sent to eggert <at> cs.ucla.edu, bug-gnu-emacs <at> gnu.org. (Thu, 28 Jun 2018 19:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; [w32] while dumping: assertion failed: specpdl_ptr->kind ==
 SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func == xfree
Date: Thu, 28 Jun 2018 15:10:30 -0400
[Message part 1 (text/plain, inline)]
X-Debbugs-CC: Paul Eggert <eggert <at> cs.ucla.edu>


gdb --args ./temacs --batch  --load loadup bootstrap

(gdb) p specpdl_ptr->kind
$1 = SPECPDL_UNWIND_ARRAY
(gdb) p specpdl_ptr->unwind_ptr.func
$2 = (void (*)(void *)) 0x53898
(gdb) p specpdl_ptr->unwind_array.func
$3 = (void (*)(Lisp_Object)) 0x53898

I guess it's related to the #31750 changes. The problem doesn't seem
especially platform-specific, but I've haven't seen this on my
GNU/Linux box.
The attached patch fixes it, though I'm not sure if it's
entirely correct.
[unwind-array.diff (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31996; Package emacs. (Thu, 28 Jun 2018 19:19:01 GMT) Full text and rfc822 format available.

Message #8 received at 31996 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: eggert <at> cs.ucla.edu, 31996 <at> debbugs.gnu.org
Subject: Re: bug#31996: 27.0.50;
 [w32] while dumping: assertion failed: specpdl_ptr->kind ==
 SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func == xfree
Date: Thu, 28 Jun 2018 22:18:19 +0300
> From: Noam Postavsky <npostavs <at> gmail.com>
> Date: Thu, 28 Jun 2018 15:10:30 -0400
> Cc: paul eggert <eggert <at> cs.ucla.edu>
> 
> The attached patch fixes it, though I'm not sure if it's
> entirely correct.

The second part seems unrelated, yes?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31996; Package emacs. (Thu, 28 Jun 2018 19:21:01 GMT) Full text and rfc822 format available.

Message #11 received at 31996 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 31996 <at> debbugs.gnu.org
Subject: Re: bug#31996: 27.0.50; [w32] while dumping: assertion failed:
 specpdl_ptr->kind == SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func ==
 xfree
Date: Thu, 28 Jun 2018 15:20:43 -0400
[Message part 1 (text/plain, inline)]
On 28 June 2018 at 15:18, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> From: Noam Postavsky <npostavs <at> gmail.com>
>> Date: Thu, 28 Jun 2018 15:10:30 -0400
>> Cc: paul eggert <eggert <at> cs.ucla.edu>
>>
>> The attached patch fixes it, though I'm not sure if it's
>> entirely correct.
>
> The second part seems unrelated, yes?

Oops, that patch is mixed up, here's what I meant instead.
[unwind-array.diff (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31996; Package emacs. (Thu, 28 Jun 2018 20:30:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andy Moreton <andrewjmoreton <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#31996: 27.0.50;
 [w32] while dumping: assertion failed: specpdl_ptr->kind ==
 SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func == xfree
Date: Thu, 28 Jun 2018 21:29:21 +0100
On Thu 28 Jun 2018, Noam Postavsky wrote:

> On 28 June 2018 at 15:18, Eli Zaretskii <eliz <at> gnu.org> wrote:
>>> From: Noam Postavsky <npostavs <at> gmail.com>
>>> Date: Thu, 28 Jun 2018 15:10:30 -0400
>>> Cc: paul eggert <eggert <at> cs.ucla.edu>
>>>
>>> The attached patch fixes it, though I'm not sure if it's
>>> entirely correct.
>>
>> The second part seems unrelated, yes?
>
> Oops, that patch is mixed up, here's what I meant instead.

Applying the fixed patch bootstraps cleanly for me with 64bit mingw64 on
Windows (MSYS2).

    AndyM





Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Thu, 28 Jun 2018 20:56:02 GMT) Full text and rfc822 format available.

Notification sent to Noam Postavsky <npostavs <at> gmail.com>:
bug acknowledged by developer. (Thu, 28 Jun 2018 20:56:02 GMT) Full text and rfc822 format available.

Message #19 received at 31996-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31996-done <at> debbugs.gnu.org, Andy Moreton <andrewjmoreton <at> gmail.com>
Subject: Re: bug#31996: 27.0.50; [w32] while dumping: assertion failed:
 specpdl_ptr->kind == SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func ==
 xfree
Date: Thu, 28 Jun 2018 13:55:50 -0700
[Message part 1 (text/plain, inline)]
Thanks for reporting that. I didn't observe the problem on Fedora 28. Anyway, I 
installed the attached patch, which should fix it.
[0001-Fix-recently-introduced-SAFE_FREE-bug.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31996; Package emacs. (Thu, 28 Jun 2018 21:06:01 GMT) Full text and rfc822 format available.

Message #22 received at 31996 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Andy Moreton <andrewjmoreton <at> gmail.com>, 31996 <at> debbugs.gnu.org
Subject: Re: bug#31996: 27.0.50; [w32] while dumping: assertion failed:
 specpdl_ptr->kind == SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func ==
 xfree
Date: Thu, 28 Jun 2018 17:05:37 -0400
On 28 June 2018 at 16:55, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> Thanks for reporting that. I didn't observe the problem on Fedora 28.
> Anyway, I installed the attached patch, which should fix it.

Thanks, works for me.

> Move array after nelts, as this is likely to generate more efficient
> code in safe_free, which can call xfree with the same value either
> way.

Maybe that kind of trick deserves a code comment?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31996; Package emacs. (Thu, 28 Jun 2018 22:58:01 GMT) Full text and rfc822 format available.

Message #25 received at 31996 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31996 <at> debbugs.gnu.org
Subject: Re: bug#31996: 27.0.50; [w32] while dumping: assertion failed:
 specpdl_ptr->kind == SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func ==
 xfree
Date: Thu, 28 Jun 2018 15:57:46 -0700
Noam Postavsky wrote:
> Maybe that kind of trick deserves a code comment?

I thought about doing that, but it seemed like the maintenance cost of having 
the comment there indefinitely wasn't worth the minor performance benefit (a 
benefit that applies only to typical platforms and when optimization is enabled, 
facts that'd also probably need to be in the comment). For what it's worth, this 
stuff is now documented in the bug report....




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31996; Package emacs. (Fri, 29 Jun 2018 06:14:01 GMT) Full text and rfc822 format available.

Message #28 received at 31996 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: npostavs <at> gmail.com, 31996 <at> debbugs.gnu.org
Subject: Re: bug#31996: 27.0.50;
 [w32] while dumping: assertion failed: specpdl_ptr->kind ==
 SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func == xfree
Date: Fri, 29 Jun 2018 09:13:46 +0300
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Thu, 28 Jun 2018 15:57:46 -0700
> Cc: 31996 <at> debbugs.gnu.org
> 
> Noam Postavsky wrote:
> > Maybe that kind of trick deserves a code comment?
> 
> I thought about doing that, but it seemed like the maintenance cost of having 
> the comment there indefinitely wasn't worth the minor performance benefit (a 
> benefit that applies only to typical platforms and when optimization is enabled, 
> facts that'd also probably need to be in the comment). For what it's worth, this 
> stuff is now documented in the bug report....

But maybe a comment explaining why the order might matter in general
could be of more value, and require less maintenance.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31996; Package emacs. (Fri, 29 Jun 2018 07:31:01 GMT) Full text and rfc822 format available.

Message #31 received at 31996 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: npostavs <at> gmail.com, 31996 <at> debbugs.gnu.org
Subject: Re: bug#31996: 27.0.50; [w32] while dumping: assertion failed:
 specpdl_ptr->kind == SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func ==
 xfree
Date: Fri, 29 Jun 2018 00:30:33 -0700
[Message part 1 (text/plain, inline)]
Eli Zaretskii wrote:
>   maybe a comment explaining why the order might matter in general
> could be of more value, and require less maintenance.

I gave that a shot by installing the attached.
[0001-src-lisp.h-Add-comment-Bug-31996-25.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31996; Package emacs. (Fri, 29 Jun 2018 08:53:02 GMT) Full text and rfc822 format available.

Message #34 received at 31996 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: npostavs <at> gmail.com, 31996 <at> debbugs.gnu.org
Subject: Re: bug#31996: 27.0.50; [w32] while dumping: assertion failed:
 specpdl_ptr->kind == SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func ==
 xfree
Date: Fri, 29 Jun 2018 11:52:06 +0300
> Cc: npostavs <at> gmail.com, 31996 <at> debbugs.gnu.org
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Fri, 29 Jun 2018 00:30:33 -0700
> 
> Eli Zaretskii wrote:
> >   maybe a comment explaining why the order might matter in general
> > could be of more value, and require less maintenance.
> 
> I gave that a shot by installing the attached.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31996; Package emacs. (Fri, 29 Jun 2018 12:32:01 GMT) Full text and rfc822 format available.

Message #37 received at 31996 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 31996 <at> debbugs.gnu.org
Subject: Re: bug#31996: 27.0.50;
 [w32] while dumping: assertion failed: specpdl_ptr->kind ==
 SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func == xfree
Date: Fri, 29 Jun 2018 08:30:51 -0400
Paul Eggert <eggert <at> cs.ucla.edu> writes:

> I thought about doing that, but it seemed like the maintenance cost of
> having the comment

Oh, this talk about comment maintenance reminds me, there's this comment
in lisp.h just above the enum specbind_tag:

/* Elisp uses several stacks:
   - the C stack.
   - the bytecode stack: used internally by the bytecode interpreter.
     Allocated from the C stack.
   - The specpdl stack:[...]

You removed the bytecode stack in [1: a815e5f195], right?

[1: a815e5f195]: 2016-12-23 21:46:53 -0800
  Remove interpreter’s byte stack
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a815e5f19581344af5e143636039064a7fbe83ed





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31996; Package emacs. (Fri, 29 Jun 2018 18:19:02 GMT) Full text and rfc822 format available.

Message #40 received at 31996 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31996 <at> debbugs.gnu.org
Subject: Re: bug#31996: 27.0.50; [w32] while dumping: assertion failed:
 specpdl_ptr->kind == SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func ==
 xfree
Date: Fri, 29 Jun 2018 11:18:31 -0700
[Message part 1 (text/plain, inline)]
On 06/29/2018 05:30 AM, Noam Postavsky wrote:
> You removed the bytecode stack in [1: a815e5f195], right?

Yes I did. Thanks for catching that. I fixed the comment by installing 
the attached into the emacs-26 branch.

[0001-src-lisp.h-Omit-obsolete-comment-re-bytecode-stack.patch (text/x-patch, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 28 Jul 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 324 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.