Closed GoogleCodeExporter closed 9 years ago
This error means that code somewhere is trying to realloc memory that was
allocated
before tcmalloc was loaded (and took over memory management responsibility).
tcmalloc can't realloc code that was originally allocated by glibc.
I don't know how this could happen with LD_PRELOAD. Maybe other libraries are
being
loaded before tcmalloc? Or maybe emacs is doing something dodgy with memory
that
works on libc but not on tcmalloc. It's hard to say.
You could try doing something like 'setenv LD_DEBUG=all', to see if that gives
useful
information about library load ordering.
That said, we know that LD_PRELOAD is not 100% reliable, and we recommend folks
don't
depend on it. If you're up for it, you could try compiling emacs from source
with
tcmalloc included that way, at least to see if that solves your problem.
Original comment by csilv...@gmail.com
on 19 Jun 2009 at 3:18
Original comment by csilv...@gmail.com
on 21 Jun 2009 at 7:39
It turns out emacs is really weird -- it does some process dumping and
undumping when
it runs. See, eg,
http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/DEBUG#n613
for how complicated it can be to get right. Just using LD_PRELOAD on it won't
work.
As for nroff, it's a shell script (at least on my system) and not a binary, so
it's
not totally surprising that it would crash when used with LD_PRELOAD. (The
crash is
actually coming when trying to use bash with tcmalloc, which is likely to also
be
complicated in a similar way to emacs, though I don't know the details.)
zsh seems to work ok under tcmalloc, so you can do
env LD_PRELOAD=/home/csilvers/opensource/google-perftools/.libs/libtcmalloc.so zsh
/usr/bin/nroff
If you have other examples of binaries that you're having trouble with, feel
free to
provide more details about them. Otherwise, I'll close this bug.
Original comment by csilv...@gmail.com
on 15 Oct 2009 at 12:40
I'm closing the bug. It may be possible to get emacs to use tcmalloc, but it
would
probably have to be compiled from scratch to do so (same with bash?), rather
than
using the LD_PRELOAD fix. It might be possible to do some ugly hacks to get
this to
work, but it's probably not worth it. So I'll close the bug WontFix.
Original comment by csilv...@gmail.com
on 10 Mar 2010 at 6:10
Original issue reported on code.google.com by
fredericsmailbox
on 18 Jun 2009 at 6:11