[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using the GNU GMP Library for Bignums in Emacs

From: Paul Eggert
Subject: Re: Using the GNU GMP Library for Bignums in Emacs
Date: Sat, 21 Apr 2018 11:37:43 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

Markus Triska wrote:

Using GMP has a significant downside if you run out of memory: There’s
currently no defined way for the allocation functions to recover from an
error such as out of memory, they must *terminate* program execution.

This should not be a problem if we use GMP's mpn_* functions. They never allocate memory; it is the user's responsibility to allocate it. This should fit better with how Emacs does things internally.

Also, it may become hard to stop long GMP calculations, whereas you can
easily stop computations that are written in Elisp. Thus, long GMP
calculations may lead to denial of editing attacks.

Yes, this could be a problem. Perhaps we'll need to extend GMP to fix it. On the other hand, no doubt there are other, similar problems in GNU Emacs (just look for calls to memcpy :-), and perhaps this problem could just be added to the list.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]