From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: freebsd-hackers@freebsd.org, brooks@freebsd.org,
emaste@freebsd.org, ashish.is@lostca.se, 24892@debbugs.gnu.org
Subject: bug#24892: {s, }brk removed from FreeBSD 11.x and later, arm64 architecture
Date: Sat, 19 Nov 2016 08:57:44 +0200 [thread overview]
Message-ID: <83vavkardj.fsf@gnu.org> (raw)
In-Reply-To: <1dc6fa8c-7378-6e4e-1d9e-86c962fc48bb@cs.ucla.edu> (message from Paul Eggert on Fri, 18 Nov 2016 14:22:07 -0800)
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Fri, 18 Nov 2016 14:22:07 -0800
> Cc: freebsd-hackers@freebsd.org, Brooks Davis <brooks@freebsd.org>,
> 24892@debbugs.gnu.org, Ashish SHUKLA <ashish.is@lostca.se>
>
> > it seems there's an implementation that allocates memory out of a large array in .bss used for some platforms - could we make use of that here?
>
> Quite possibly. Unfortunately the code that uses that array (in gmalloc.c) also
> uses sbrk to move the break past the end of the large array. The large array is
> intended for use only during the build process; during ordinary execution, sbrk
> is used.
>
> Perhaps Emacs could work around the problem by supplying a user-space sbrk
> emulator, which uses mmap to support the old-fashioned model where the heap is
> contiguous. Is that something that could be done easily? That is, is there some
> way to reserve the address space for a potentially-large Emacs heap right after
> .bss, such that library calls to malloc and mmap won't use this address space?
> That might do the trick.
>
> Brooks Davis wrote:
> > What does emacs actually need from sbrk()? Could it get by with something with the same interface allocating from .bss or does it need its allocations to be at the end of .bss?
>
> I think more the latter. The problem with a fixed-size .bss is that whatever
> size we pick during the build is likely to be wrong for users. Also, Emacs saves
> the entire build-time .bss into an executable, so an enormous .bss will be
> counterproductive.
I agree with everything Paul wrote.
There's one other factor you should be aware of: Emacs 25.2 will most
probably start its pretest in a week or so. If this problem can be
solved for FreeBSD on arm64 by providing a drop-in replacement for
sbrk, we could include that in 25.2, which is a strictly bug-fix
release that can only accept safe bug fixes. If not, the solution
will have to wait for Emacs 26.1, currently being developed on the
master branch, which is unlikely to be released before mid-2017 or
even the end of 2017. Not a catastrophe, given that Emacs never
worked on this host, but something to consider.
(It is, of course, possible to provide a simple and safe solution for
25.2 and a more elaborate one for 26.1.)
Thanks.
next prev parent reply other threads:[~2016-11-19 6:57 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-07 6:01 bug#24892: {s, }brk removed from FreeBSD 11.x and later, arm64 architecture Ashish SHUKLA
2016-11-07 15:19 ` Eli Zaretskii
2016-11-08 17:54 ` Paul Eggert
2016-11-08 20:11 ` Eli Zaretskii
2016-11-08 21:41 ` Paul Eggert
2016-11-09 3:34 ` Eli Zaretskii
2016-11-09 8:27 ` Paul Eggert
2016-11-09 15:49 ` Eli Zaretskii
2016-11-10 1:47 ` Paul Eggert
2016-11-10 16:13 ` Eli Zaretskii
2016-11-10 16:59 ` Paul Eggert
2016-11-10 17:24 ` Eli Zaretskii
2016-11-10 0:22 ` Richard Stallman
2016-11-10 1:40 ` Paul Eggert
2016-11-09 4:29 ` Ashish SHUKLA
2016-11-09 8:26 ` Paul Eggert
2016-11-09 9:46 ` Andreas Schwab
2016-11-09 15:50 ` Eli Zaretskii
2016-11-09 17:52 ` Paul Eggert
2016-11-10 9:52 ` Andreas Schwab
2016-11-10 16:23 ` Paul Eggert
2016-11-10 17:00 ` Andreas Schwab
2016-11-10 17:22 ` Paul Eggert
2016-11-10 17:33 ` Andreas Schwab
2016-11-11 2:48 ` Paul Eggert
2016-11-17 17:27 ` Eli Zaretskii
2016-11-18 12:29 ` Ashish SHUKLA
2016-11-18 16:21 ` Paul Eggert
2016-11-18 20:20 ` Ed Maste
2016-11-18 20:23 ` Brooks Davis
[not found] ` <CAPyFy2AL_OZWYpp+tiLSro_3WK1-H8Pdjy4-ZhUQChMQqageUw@mail.gmail.com>
2016-11-18 22:22 ` Paul Eggert
2016-11-19 6:57 ` Eli Zaretskii [this message]
2016-11-19 7:20 ` Eli Zaretskii
2017-09-02 13:37 ` Eli Zaretskii
2016-11-09 13:23 ` Ashish SHUKLA
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83vavkardj.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=24892@debbugs.gnu.org \
--cc=ashish.is@lostca.se \
--cc=brooks@freebsd.org \
--cc=eggert@cs.ucla.edu \
--cc=emaste@freebsd.org \
--cc=freebsd-hackers@freebsd.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.