unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Philip Kaludercic <philipk@posteo.net>
Cc: Eli Zaretskii <eliz@gnu.org>, 61896@debbugs.gnu.org
Subject: bug#61896: 30.0.50; Emacs crashes because of an invalid free
Date: Thu, 2 Mar 2023 13:20:03 +0100	[thread overview]
Message-ID: <981CDB22-6430-44B5-8316-BD8268B22C83@acm.org> (raw)
In-Reply-To: <875ybjcz4t.fsf@posteo.net>

2 mars 2023 kl. 09.53 skrev Philip Kaludercic <philipk@posteo.net>:

>> Byte-code saw quite a bit of changes on master.  Adding Mattias in
>> case he has some ideas.
> 
> From what I recall, the address being freed was on the stack.  How does
> the byte-code interpreter behave when the input is broken?  Is there
> some way of validating if the byte-code is "coherent"?  If I manually
> modify the byte code and replace random bytes, is the interpreter
> written to expect this kind of issue?

The very first thing is to make sure you don't have any lingering *.elc files generated during the period of incompatibility regarding `save-restriction`. That issue should have been resolved by now; let's not chase ghosts. The indication of a specpdl imbalance does point to this being a possible cause.

The byte-code interpreter normally assumes the code to be correct and performs few checks since every cycle counts here. There are some additional checks to be enabled: the general --enable-checking=all, and/or compiling with -DBYTE_CODE_SAFE=1 (or just adding

#define BYTE_CODE_SAFE 1

early in bytecode.c, which is what I tend to do).

These checks do not audit the specpdl balance directly but that would be something to add if you don't make further progress.






  parent reply	other threads:[~2023-03-02 12:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01 20:25 bug#61896: 30.0.50; Emacs crashes because of an invalid free Philip Kaludercic
2023-03-02  6:15 ` Eli Zaretskii
2023-03-02  8:53   ` Philip Kaludercic
2023-03-02  9:41     ` Eli Zaretskii
2023-03-02 12:20     ` Mattias Engdegård [this message]
2023-03-02 15:21       ` Mattias Engdegård
2023-03-02 17:41         ` Philip Kaludercic
2023-03-02 10:30 ` Rah Guzar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-02 10:58   ` Philip Kaludercic
2023-03-03 10:51     ` Rah Guzar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-03 18:00       ` Philip Kaludercic
2023-03-06 19:52         ` Rah Guzar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-06  0:02           ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=981CDB22-6430-44B5-8316-BD8268B22C83@acm.org \
    --to=mattiase@acm.org \
    --cc=61896@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).