[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bignum speedup patch causes crash at startup
From: |
Eli Zaretskii |
Subject: |
Re: Bignum speedup patch causes crash at startup |
Date: |
Tue, 04 Sep 2018 18:10:30 +0300 |
> From: Andy Moreton <address@hidden>
> Date: Tue, 04 Sep 2018 15:21:11 +0100
>
> The recent changes in commit fe042e9d ("Speed up (+ 2 2) by a factor of
> 10") cause an immediate crash in 64bit emacs on Windows.
Based on the backtrace I see here, crystal ball says that the new
function init_bignum_once is the problem: it is called during dumping,
before the call to mp_set_memory_functions, which tells GMP to use our
memory-allocation functions. So GMP uses the "normal" malloc/free to
allocate the data, and then Emacs crashes when it tries to realloc
that after dumping.
I wonder how this was supposed to work on other platforms, since you
cannot generally assume that memory allocated by a function from some
malloc family can be safely freed/reallocated using a function from
another family. One must use the same family.
Paul, why do we need to call init_bignum_once at dump time?
Re: Bignum speedup patch causes crash at startup, Paul Eggert, 2018/09/04