From: Mark Seaborn <mseaborn@onetel.com>
Subject: "/lib/ld-linux.so.2 /usr/bin/emacs" fails: "Memory exhausted"
Date: Fri, 11 Nov 2005 19:57:52 +0000 (GMT) [thread overview]
Message-ID: <20051111.195752.730551918.mrs@localhost> (raw)
The problem can be summarised very simply:
$ /lib/ld-linux.so.2 /usr/bin/emacs
Memory exhausted--use M-x save-some-buffers RET
$ emacs --version
GNU Emacs 21.4.1
...
In other words, starting GNU Emacs by invoking the dynamic linker
doesn't work, and fails pretty quickly with an incorrect out-of-memory
error.
This is on i386.
This is the first program I've seen that fails when starting using the
dynamic linker this way. I would like this to work because Plash
(http://plash.beasts.org) launches programs this way.
The only reference to this problem that I have seen is a note in a
Linux kernel patch:
[SPARC]: Adjust 32-bit ELF_ET_DYN_BASE.
We were using 0x08000000 instead of TASK_UNMAPPED_BASE
so that running something like "/lib/ld-linux.so.2 emacs"
would work.
The issue there was that wherever /lib/ld-linux.so.2 gets
mapped (controlled by ELF_ET_DYN_BASE), that is where the
BSS start for the process ends up. Now, emacs allocates
dynamic memory for LISP objects from the BSS, and needs
the top 4 bits of the virtual address to be clear so that
it can encode LISP type and GC marking information there.
But making this obscure emacs case work breaks lots of other
stuff. For example, programs with a reasonably large data
section fail to load via direct ld.so interpreter execution
because the data section is large enough to begin overlapping
with the ELF_ET_DYN_BASE area.
The /lib/ld-linux.so.2 emacs case does not work on a lot of
platforms due to this issue, including i386, so it is not
worth making work on sparc either. It is indeed useful
sometimes when debugging a new experimental build of glibc
for example, but people doing that can hack the value of
ELF_ET_DYN_BASE in their kernels. Perhaps at some point
we will make a sysctl controllable value.
Signed-off-by: David S. Miller <davem@davemloft.net>
<http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/old/patch-2.6.10-rc3-bk14.log>
I don't fully understand this. Starting programs through
/lib/ld-linux.so.2 does not appear to change the addresses at which
object files get mapped.
Do you know what the problem is and whether it is simple to fix?
For comparison, XEmacs does not have this problem.
Cheers,
Mark
next reply other threads:[~2005-11-11 19:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-11 19:57 Mark Seaborn [this message]
2005-11-13 20:54 ` "/lib/ld-linux.so.2 /usr/bin/emacs" fails: "Memory exhausted" Richard M. Stallman
2005-11-15 0:34 ` Mark Seaborn
[not found] <mailman.14913.1131738962.20277.bug-gnu-emacs@gnu.org>
2005-11-11 23:47 ` Romain Francoise
2005-11-14 13:38 ` Mark Seaborn
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=20051111.195752.730551918.mrs@localhost \
--to=mseaborn@onetel.com \
/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.