unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Help with new Windows 98 crash
Date: Tue, 06 Dec 2022 20:53:53 +0800	[thread overview]
Message-ID: <87r0xcn15q.fsf@yahoo.com> (raw)
In-Reply-To: <83wn747mt5.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Dec 2022 14:12:54 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: emacs-devel@gnu.org
>> Date: Tue, 06 Dec 2022 09:29:04 +0800
>> 
>> init_bignum must be called before make_initial_frame, because that
>> allocates a bignum in temacs (as set_window_buffer calls
>> bset_display_time and Fcurrent_time, which go through the time
>> arithmetic stuff), before our own allocator has been set up, which ends
>> up in the dumped Emacs, leading to a free of a pointer from the wrong
>> heap once the bignum is garbage collected.
>> 
>> I have installed the change on the Emacs 30 branch because I am not sure
>> it is safe for Emacs 29.  Can you think of a safer fix?
>
> There's nothing unsafe in what you did, but:
>
>   . the call to init_bignum inside the !initialized block should be
>     conditioned on HAVE_UNEXEC

But doesn't it have to come before init_window_once in any case?
Otherwise, the wrong malloc will be used even on pdumper builds.

>   . the call to init_bignum that is a few lines below that, and outside of
>     the !initialized condition should be conditioned using HAVE_UNEXEC and
>     initialized such that we don't invoke this function twice in any case,
>     whether this is during dumping or not and whether this is a pdumper
>     build or not

Okay, that's fine by me.



  reply	other threads:[~2022-12-06 12:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87o7sindcl.fsf.ref@yahoo.com>
2022-12-05 14:18 ` Help with new Windows 98 crash Po Lu
2022-12-05 14:52   ` Eli Zaretskii
2022-12-05 16:59     ` Eli Zaretskii
2022-12-06  1:29       ` Po Lu
2022-12-06 12:12         ` Eli Zaretskii
2022-12-06 12:53           ` Po Lu [this message]
2022-12-06 14:32             ` Eli Zaretskii
2022-12-07  0:59               ` Po Lu

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=87r0xcn15q.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).