[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with new Windows 98 crash
From: |
Po Lu |
Subject: |
Re: Help with new Windows 98 crash |
Date: |
Tue, 06 Dec 2022 20:53:53 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
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.